Documentation improvements.

This commit is contained in:
Dag-Erling Smørgrav 2022-05-15 18:30:03 +02:00
parent 8ab9839cc2
commit 1af982f951
17 changed files with 588 additions and 95 deletions

View file

@ -15,11 +15,16 @@ libcryb_digest_la_SOURCES = \
cryb_digest.c cryb_digest.c
dist_man3_MANS = \ dist_man3_MANS = \
cryb_md2.3 \
cryb_md4.3 \
cryb_md5.3 \
cryb_sha1.3 \ cryb_sha1.3 \
cryb_sha224.3 \ cryb_sha224.3 \
cryb_sha256.3 \ cryb_sha256.3 \
cryb_sha384.3 \ cryb_sha384.3 \
cryb_sha512.3 cryb_sha512.3 \
\
cryb_digest.3
libcryb_digest_la_CFLAGS = \ libcryb_digest_la_CFLAGS = \
$(CRYB_CORE_CFLAGS) $(CRYB_CORE_CFLAGS)

70
lib/digest/cryb_digest.3 Normal file
View file

@ -0,0 +1,70 @@
.\"-
.\" Copyright (c) 2022 Dag-Erling Smørgrav
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. The name of the author may not be used to endorse or promote
.\" products derived from this software without specific prior written
.\" permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd May 15, 2022
.Dt CRYB_DIGEST 3
.Os
.Sh NAME
.Nm cryb_digest_version
.Nd cryptographic message digest library
.Sh LIBRARY
.Lb libcryb-digest
.Sh SYNOPSIS
.In stddef.h
.In stdint.h
.In cryb/digest.h
.Ft const char *
.Fn cryb_digest_version "void"
.Sh DESCRIPTION
The
.Fn cryb_digest_version
function returns a pointer to a string containing the specific version
of the
.Lb libcryb-digest
library.
.Pp
For descriptions of the other functions in this library, see their
respective manual pages.
.Sh SEE ALSO
.Xr cryb_md2 3 ,
.Xr cryb_md4 3 ,
.Xr cryb_md5 3 ,
.Xr cryb_sha1 3 ,
.Xr cryb_sha224 3 ,
.Xr cryb_sha256 3 ,
.Xr cryb_sha384 3 ,
.Xr cryb_sha512 3
.Sh AUTHORS
.An -nosplit
The
.Fn cryb_digest_version
function was written for the University of Oslo by
.An Dag-Erling Sm\(/orgrav Aq Mt d.e.smorgrav@usit.uio.no .
.Pp
This manual page was written by
.An Dag-Erling Sm\(/orgrav Aq Mt des@des.no .

125
lib/digest/cryb_md2.3 Normal file
View file

@ -0,0 +1,125 @@
.\"-
.\" Copyright (c) 2022 Dag-Erling Smørgrav
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. The name of the author may not be used to endorse or promote
.\" products derived from this software without specific prior written
.\" permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd May 15, 2022
.Dt CRYB_MD2 3
.Os
.Sh NAME
.Nm cryb_md2_init ,
.Nm cryb_md2_update ,
.Nm cryb_md2_final ,
.Nm cryb_md2_complete
.Nd Message-Digest Algorithm 2
.Sh LIBRARY
.Lb libcryb-digest
.Sh SYNOPSIS
.In stddef.h
.In stdint.h
.In cryb/md2.h
.Ft void
.Fn cryb_md2_init "cryb_md2_ctx *context"
.Ft void
.Fn cryb_md2_update "cryb_md2_ctx *context" "const void *data" "size_t len"
.Ft void
.Fn cryb_md2_final "cryb_md2_ctx *context" "uint8_t *digest"
.Ft void
.Fn cryb_md2_complete "const void *data" "size_t len" "uint8_t *digest"
.Sh DESCRIPTION
The
.Nm cryb_md2
family of functions implements the MD2 message digest algorithm as
described in RFC 1319.
.Pp
The
.Fn cryb_md2_init
function initializes the context structure pointed to by
.Va context .
It is the caller's responsibility to allocate this structure.
.Pp
The
.Fn cryb_md2_update
function hashes the next
.Va len
bytes of data pointed to by the
.Va data
pointer into the given hash context.
.Pp
The
.Fn cryb_md2_final
function finalizes the computation and writes the resulting message
digest to the caller-provided buffer pointed to by
.Va digest ,
which must be at least
.Dv MD2_DIGEST_LEN
bytes long.
It is the caller's responsibility to dispose of the context structure
after calling
.Fn cryb_md2_final .
.Pp
The
.Fn cryb_md2_complete
function is a shortcut to calling
.Fn cryb_md2_init ,
.Fn cryb_md2_update ,
and
.Fn cryb_md2_final
when the entire message is available up front in a single contiguous
buffer.
.Sh IMPLEMENTATION NOTES
The
.In cryb/md2.h
header provides macros which allows these functions and the context
type to be referred to without their
.Dq Li cryb_
prefix.
.Pp
The MD2 message digest algorithm has been proven to be vulnerable to
collision attacks and should not be used for cryptographic purposes.
.Sh SEE ALSO
.Xr cryb_digest 3 ,
.Xr cryb_md4 3 ,
.Xr cryb_md5 3
.Sh REFERENCES
.Rs
.%A Kaliski, Burton S.
.%T The MD2 Message-Digest Algorithm
.%D April 1992
.%O RFC 1319
.%U https://datatracker.ietf.org/doc/html/rfc1319
.Re
.Rs
.%A Turner, Sean
.%A Chen, Lily
.%T MD2 to Historic Status
.%D March 2011
.%O RFC 6149
.%U https://datatracker.ietf.org/doc/html/rfc6149
.Re
.Sh AUTHORS
These functions and this manual page were written by
.An Dag-Erling Sm\(/orgrav Aq Mt des@des.no .

125
lib/digest/cryb_md4.3 Normal file
View file

@ -0,0 +1,125 @@
.\"-
.\" Copyright (c) 2022 Dag-Erling Smørgrav
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. The name of the author may not be used to endorse or promote
.\" products derived from this software without specific prior written
.\" permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd May 15, 2022
.Dt CRYB_MD4 3
.Os
.Sh NAME
.Nm cryb_md4_init ,
.Nm cryb_md4_update ,
.Nm cryb_md4_final ,
.Nm cryb_md4_complete
.Nd Message-Digest Algorithm 2
.Sh LIBRARY
.Lb libcryb-digest
.Sh SYNOPSIS
.In stddef.h
.In stdint.h
.In cryb/md4.h
.Ft void
.Fn cryb_md4_init "cryb_md4_ctx *context"
.Ft void
.Fn cryb_md4_update "cryb_md4_ctx *context" "const void *data" "size_t len"
.Ft void
.Fn cryb_md4_final "cryb_md4_ctx *context" "uint8_t *digest"
.Ft void
.Fn cryb_md4_complete "const void *data" "size_t len" "uint8_t *digest"
.Sh DESCRIPTION
The
.Nm cryb_md4
family of functions implements the MD4 message digest algorithm as
described in RFC 1320.
.Pp
The
.Fn cryb_md4_init
function initializes the context structure pointed to by
.Va context .
It is the caller's responsibility to allocate this structure.
.Pp
The
.Fn cryb_md4_update
function hashes the next
.Va len
bytes of data pointed to by the
.Va data
pointer into the given hash context.
.Pp
The
.Fn cryb_md4_final
function finalizes the computation and writes the resulting message
digest to the caller-provided buffer pointed to by
.Va digest ,
which must be at least
.Dv MD4_DIGEST_LEN
bytes long.
It is the caller's responsibility to dispose of the context structure
after calling
.Fn cryb_md4_final .
.Pp
The
.Fn cryb_md4_complete
function is a shortcut to calling
.Fn cryb_md4_init ,
.Fn cryb_md4_update ,
and
.Fn cryb_md4_final
when the entire message is available up front in a single contiguous
buffer.
.Sh IMPLEMENTATION NOTES
The
.In cryb/md4.h
header provides macros which allows these functions and the context
type to be referred to without their
.Dq Li cryb_
prefix.
.Pp
The MD4 message digest algorithm has been proven to be vulnerable to
collision attacks and should not be used for cryptographic purposes.
.Sh SEE ALSO
.Xr cryb_digest 3 ,
.Xr cryb_md2 3 ,
.Xr cryb_md5 3
.Sh REFERENCES
.Rs
.%A Rivest, Ronald
.%T The MD4 Message-Digest Algorithm
.%D April 1992
.%O RFC 1320
.%U https://datatracker.ietf.org/doc/html/rfc1320
.Re
.Rs
.%A Turner, Sean
.%A Chen, Lily
.%T MD4 to Historic Status
.%D March 2011
.%O RFC 6150
.%U https://datatracker.ietf.org/doc/html/rfc6150
.Re
.Sh AUTHORS
These functions and this manual page were written by
.An Dag-Erling Sm\(/orgrav Aq Mt des@des.no .

125
lib/digest/cryb_md5.3 Normal file
View file

@ -0,0 +1,125 @@
.\"-
.\" Copyright (c) 2022 Dag-Erling Smørgrav
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. The name of the author may not be used to endorse or promote
.\" products derived from this software without specific prior written
.\" permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd May 15, 2022
.Dt CRYB_MD5 3
.Os
.Sh NAME
.Nm cryb_md5_init ,
.Nm cryb_md5_update ,
.Nm cryb_md5_final ,
.Nm cryb_md5_complete
.Nd Message-Digest Algorithm 2
.Sh LIBRARY
.Lb libcryb-digest
.Sh SYNOPSIS
.In stddef.h
.In stdint.h
.In cryb/md5.h
.Ft void
.Fn cryb_md5_init "cryb_md5_ctx *context"
.Ft void
.Fn cryb_md5_update "cryb_md5_ctx *context" "const void *data" "size_t len"
.Ft void
.Fn cryb_md5_final "cryb_md5_ctx *context" "uint8_t *digest"
.Ft void
.Fn cryb_md5_complete "const void *data" "size_t len" "uint8_t *digest"
.Sh DESCRIPTION
The
.Nm cryb_md5
family of functions implements the MD5 message digest algorithm as
described in RFC 1321.
.Pp
The
.Fn cryb_md5_init
function initializes the context structure pointed to by
.Va context .
It is the caller's responsibility to allocate this structure.
.Pp
The
.Fn cryb_md5_update
function hashes the next
.Va len
bytes of data pointed to by the
.Va data
pointer into the given hash context.
.Pp
The
.Fn cryb_md5_final
function finalizes the computation and writes the resulting message
digest to the caller-provided buffer pointed to by
.Va digest ,
which must be at least
.Dv MD5_DIGEST_LEN
bytes long.
It is the caller's responsibility to dispose of the context structure
after calling
.Fn cryb_md5_final .
.Pp
The
.Fn cryb_md5_complete
function is a shortcut to calling
.Fn cryb_md5_init ,
.Fn cryb_md5_update ,
and
.Fn cryb_md5_final
when the entire message is available up front in a single contiguous
buffer.
.Sh IMPLEMENTATION NOTES
The
.In cryb/md5.h
header provides macros which allows these functions and the context
type to be referred to without their
.Dq Li cryb_
prefix.
.Pp
The MD5 message digest algorithm has been proven to be vulnerable to
collision attacks and should not be used for cryptographic purposes.
.Sh SEE ALSO
.Xr cryb_digest 3 ,
.Xr cryb_md2 3 ,
.Xr cryb_md4 3
.Sh REFERENCES
.Rs
.%A Rivest, Ronald
.%T The MD5 Message-Digest Algorithm
.%D April 1992
.%O RFC 1321
.%U https://datatracker.ietf.org/doc/html/rfc1321
.Re
.Rs
.%A Turner, Sean
.%A Chen, Lily
.%T Updated Security Considerations for the MD5 Message-Digest and the HMAC-MD5 Algorithms
.%D March 2011
.%O RFC 6151
.%U https://datatracker.ietf.org/doc/html/rfc6151
.Re
.Sh AUTHORS
These functions and this manual page were written by
.An Dag-Erling Sm\(/orgrav Aq Mt des@des.no .

View file

@ -1,6 +1,6 @@
.\"- .\"-
.\" Copyright (c) 2015 The University of Oslo .\" Copyright (c) 2015 The University of Oslo
.\" Copyright (c) 2016 Dag-Erling Smørgrav .\" Copyright (c) 2016-2022 Dag-Erling Smørgrav
.\" All rights reserved. .\" All rights reserved.
.\" .\"
.\" Redistribution and use in source and binary forms, with or without .\" Redistribution and use in source and binary forms, with or without
@ -27,7 +27,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" SUCH DAMAGE.
.\" .\"
.Dd September 17, 2016 .Dd May 15, 2022
.Dt CRYB_SHA1 3 .Dt CRYB_SHA1 3
.Os .Os
.Sh NAME .Sh NAME
@ -86,7 +86,7 @@ The
.Fn cryb_sha1_complete .Fn cryb_sha1_complete
function is a shortcut to calling function is a shortcut to calling
.Fn cryb_sha1_init , .Fn cryb_sha1_init ,
.Fn cryb_sha1_update .Fn cryb_sha1_update ,
and and
.Fn cryb_sha1_final .Fn cryb_sha1_final
when the entire message is available up front in a single contiguous when the entire message is available up front in a single contiguous
@ -114,6 +114,7 @@ collision attacks and should not be used for cryptographic purposes.
.%D March 2012 .%D March 2012
.Re .Re
.Sh AUTHORS .Sh AUTHORS
.An -nosplit
These functions and this manual page were written for the University These functions and this manual page were written for the University
of Oslo by of Oslo by
.An Dag-Erling Sm\(/orgrav Aq Mt d.e.smorgrav@usit.uio.no . .An Dag-Erling Sm\(/orgrav Aq Mt d.e.smorgrav@usit.uio.no .

View file

@ -1,6 +1,6 @@
.\"- .\"-
.\" Copyright (c) 2015 The University of Oslo .\" Copyright (c) 2015 The University of Oslo
.\" Copyright (c) 2016 Dag-Erling Smørgrav .\" Copyright (c) 2016-2022 Dag-Erling Smørgrav
.\" All rights reserved. .\" All rights reserved.
.\" .\"
.\" Redistribution and use in source and binary forms, with or without .\" Redistribution and use in source and binary forms, with or without
@ -27,7 +27,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" SUCH DAMAGE.
.\" .\"
.Dd September 17, 2016 .Dd May 15, 2022
.Dt CRYB_SHA224 3 .Dt CRYB_SHA224 3
.Os .Os
.Sh NAME .Sh NAME
@ -86,7 +86,7 @@ The
.Fn cryb_sha224_complete .Fn cryb_sha224_complete
function is a shortcut to calling function is a shortcut to calling
.Fn cryb_sha224_init , .Fn cryb_sha224_init ,
.Fn cryb_sha224_update .Fn cryb_sha224_update ,
and and
.Fn cryb_sha224_final .Fn cryb_sha224_final
when the entire message is available up front in a single contiguous when the entire message is available up front in a single contiguous
@ -111,6 +111,7 @@ prefix.
.%D March 2012 .%D March 2012
.Re .Re
.Sh AUTHORS .Sh AUTHORS
.An -nosplit
These functions and this manual page were written for the University These functions and this manual page were written for the University
of Oslo by of Oslo by
.An Dag-Erling Sm\(/orgrav Aq Mt d.e.smorgrav@usit.uio.no . .An Dag-Erling Sm\(/orgrav Aq Mt d.e.smorgrav@usit.uio.no .

View file

@ -1,6 +1,6 @@
.\"- .\"-
.\" Copyright (c) 2015 The University of Oslo .\" Copyright (c) 2015 The University of Oslo
.\" Copyright (c) 2016 Dag-Erling Smørgrav .\" Copyright (c) 2016-2022 Dag-Erling Smørgrav
.\" All rights reserved. .\" All rights reserved.
.\" .\"
.\" Redistribution and use in source and binary forms, with or without .\" Redistribution and use in source and binary forms, with or without
@ -27,7 +27,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" SUCH DAMAGE.
.\" .\"
.Dd September 17, 2016 .Dd May 15, 2022
.Dt CRYB_SHA256 3 .Dt CRYB_SHA256 3
.Os .Os
.Sh NAME .Sh NAME
@ -86,7 +86,7 @@ The
.Fn cryb_sha256_complete .Fn cryb_sha256_complete
function is a shortcut to calling function is a shortcut to calling
.Fn cryb_sha256_init , .Fn cryb_sha256_init ,
.Fn cryb_sha256_update .Fn cryb_sha256_update ,
and and
.Fn cryb_sha256_final .Fn cryb_sha256_final
when the entire message is available up front in a single contiguous when the entire message is available up front in a single contiguous
@ -111,6 +111,7 @@ prefix.
.%D March 2012 .%D March 2012
.Re .Re
.Sh AUTHORS .Sh AUTHORS
.An -nosplit
These functions and this manual page were written for the University These functions and this manual page were written for the University
of Oslo by of Oslo by
.An Dag-Erling Sm\(/orgrav Aq Mt d.e.smorgrav@usit.uio.no . .An Dag-Erling Sm\(/orgrav Aq Mt d.e.smorgrav@usit.uio.no .

View file

@ -1,6 +1,6 @@
.\"- .\"-
.\" Copyright (c) 2015 The University of Oslo .\" Copyright (c) 2015 The University of Oslo
.\" Copyright (c) 2016 Dag-Erling Smørgrav .\" Copyright (c) 2016-2022 Dag-Erling Smørgrav
.\" All rights reserved. .\" All rights reserved.
.\" .\"
.\" Redistribution and use in source and binary forms, with or without .\" Redistribution and use in source and binary forms, with or without
@ -27,7 +27,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" SUCH DAMAGE.
.\" .\"
.Dd September 17, 2016 .Dd May 15, 2022
.Dt CRYB_SHA384 3 .Dt CRYB_SHA384 3
.Os .Os
.Sh NAME .Sh NAME
@ -86,7 +86,7 @@ The
.Fn cryb_sha384_complete .Fn cryb_sha384_complete
function is a shortcut to calling function is a shortcut to calling
.Fn cryb_sha384_init , .Fn cryb_sha384_init ,
.Fn cryb_sha384_update .Fn cryb_sha384_update ,
and and
.Fn cryb_sha384_final .Fn cryb_sha384_final
when the entire message is available up front in a single contiguous when the entire message is available up front in a single contiguous
@ -111,6 +111,7 @@ prefix.
.%D March 2012 .%D March 2012
.Re .Re
.Sh AUTHORS .Sh AUTHORS
.An -nosplit
These functions and this manual page were written for the University These functions and this manual page were written for the University
of Oslo by of Oslo by
.An Dag-Erling Sm\(/orgrav Aq Mt d.e.smorgrav@usit.uio.no . .An Dag-Erling Sm\(/orgrav Aq Mt d.e.smorgrav@usit.uio.no .

View file

@ -1,6 +1,6 @@
.\"- .\"-
.\" Copyright (c) 2015 The University of Oslo .\" Copyright (c) 2015 The University of Oslo
.\" Copyright (c) 2016 Dag-Erling Smørgrav .\" Copyright (c) 2016-2022 Dag-Erling Smørgrav
.\" All rights reserved. .\" All rights reserved.
.\" .\"
.\" Redistribution and use in source and binary forms, with or without .\" Redistribution and use in source and binary forms, with or without
@ -27,7 +27,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" SUCH DAMAGE.
.\" .\"
.Dd September 17, 2016 .Dd May 15, 2022
.Dt CRYB_SHA512 3 .Dt CRYB_SHA512 3
.Os .Os
.Sh NAME .Sh NAME
@ -86,7 +86,7 @@ The
.Fn cryb_sha512_complete .Fn cryb_sha512_complete
function is a shortcut to calling function is a shortcut to calling
.Fn cryb_sha512_init , .Fn cryb_sha512_init ,
.Fn cryb_sha512_update .Fn cryb_sha512_update ,
and and
.Fn cryb_sha512_final .Fn cryb_sha512_final
when the entire message is available up front in a single contiguous when the entire message is available up front in a single contiguous
@ -111,6 +111,7 @@ prefix.
.%D March 2012 .%D March 2012
.Re .Re
.Sh AUTHORS .Sh AUTHORS
.An -nosplit
These functions and this manual page were written for the University These functions and this manual page were written for the University
of Oslo by of Oslo by
.An Dag-Erling Sm\(/orgrav Aq Mt d.e.smorgrav@usit.uio.no . .An Dag-Erling Sm\(/orgrav Aq Mt d.e.smorgrav@usit.uio.no .

View file

@ -1,5 +1,5 @@
.\"- .\"-
.\" Copyright (c) 2014-2016 Dag-Erling Smørgrav .\" Copyright (c) 2014-2022 Dag-Erling Smørgrav
.\" All rights reserved. .\" All rights reserved.
.\" .\"
.\" Redistribution and use in source and binary forms, with or without .\" Redistribution and use in source and binary forms, with or without
@ -26,7 +26,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" SUCH DAMAGE.
.\" .\"
.Dd January 10, 2016 .Dd May 15, 2022
.Dt CRYB_PERCENT 3 .Dt CRYB_PERCENT 3
.Os .Os
.Sh NAME .Sh NAME
@ -129,14 +129,15 @@ prefix.
.Xr cryb_base64 3 .Xr cryb_base64 3
.Sh REFERENCES .Sh REFERENCES
.Rs .Rs
.%A "Berners-Lee, T." .%A Berners-Lee, T.
.%A "Fielding, R." .%A Fielding, R.
.%A "Masinter, L." .%A Masinter, L.
.%D "January 2005" .%R Uniform Resource Identifier (URI): Generic Syntax
.%R "Uniform Resource Identifier (URI): Generic Syntax" .%D January 2005
.%O "RFC 3968" .%O RFC 3968
.Re .Re
.Sh AUTHORS .Sh AUTHORS
.An -nosplit
The The
.Fn cryb_percent_decode .Fn cryb_percent_decode
and and

View file

@ -17,6 +17,7 @@ dist_man3_MANS = \
cryb_adler32.3 \ cryb_adler32.3 \
cryb_fletcher.3 \ cryb_fletcher.3 \
cryb_fnv.3 \ cryb_fnv.3 \
cryb_murmur3.3 \
cryb_pearson.3 \ cryb_pearson.3 \
\ \
cryb_hash.3 cryb_hash.3

View file

@ -1,6 +1,5 @@
.\"- .\"-
.\" Copyright (c) 2015-2016 The University of Oslo .\" Copyright (c) 2016-2022 Dag-Erling Smørgrav
.\" Copyright (c) 2016 Dag-Erling Smørgrav
.\" All rights reserved. .\" All rights reserved.
.\" .\"
.\" Redistribution and use in source and binary forms, with or without .\" Redistribution and use in source and binary forms, with or without
@ -27,12 +26,12 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" SUCH DAMAGE.
.\" .\"
.Dd January 8, 2016 .Dd May 15, 2022
.Dt CRYB_ADLER32 3 .Dt CRYB_ADLER32 3
.Os .Os
.Sh NAME .Sh NAME
.Nm cryb_adler32_hash .Nm cryb_adler32_hash
.Nd hash functions .Nd non-cryptographic hash functions
.Sh LIBRARY .Sh LIBRARY
.Lb libcryb-hash .Lb libcryb-hash
.Sh SYNOPSIS .Sh SYNOPSIS
@ -65,13 +64,14 @@ prefix.
.Xr cryb_hash 3 .Xr cryb_hash 3
.Sh REFERENCES .Sh REFERENCES
.Rs .Rs
.%A "Deutsch, P." .%A Deutsch, P.
.%A "Gailly, J.-L." .%A Gailly, J.-L.
.%D "May 1996" .%D May 1996
.%R "ZLIB Compressed Data Format Specification version 3.3" .%R ZLIB Compressed Data Format Specification version 3.3
.%O "RFC 1950" .%O RFC 1950
.Re .Re
.Sh AUTHORS .Sh AUTHORS
.An -nosplit
The The
.Fn cryb_adler32_hash .Fn cryb_adler32_hash
function and this manual page were written by function and this manual page were written by

View file

@ -33,7 +33,7 @@
.Nm cryb_fletcher16_hash , .Nm cryb_fletcher16_hash ,
.Nm cryb_fletcher32_hash , .Nm cryb_fletcher32_hash ,
.Nm cryb_fletcher64_hash .Nm cryb_fletcher64_hash
.Nd hash functions .Nd non-cryptographic hash functions
.Sh LIBRARY .Sh LIBRARY
.Lb libcryb-hash .Lb libcryb-hash
.Sh SYNOPSIS .Sh SYNOPSIS
@ -41,11 +41,11 @@
.In stdint.h .In stdint.h
.In cryb/hash.h .In cryb/hash.h
.Ft uint16_t .Ft uint16_t
.Fn fletcher16_hash "const void *data" "size_t len" .Fn cryb_fletcher16_hash "const void *data" "size_t len"
.Ft uint32_t .Ft uint32_t
.Fn fletcher32_hash "const void *data" "size_t len" .Fn cryb_fletcher32_hash "const void *data" "size_t len"
.Ft uint64_t .Ft uint64_t
.Fn fletcher64_hash "const void *data" "size_t len" .Fn cryb_fletcher64_hash "const void *data" "size_t len"
.Sh DESCRIPTION .Sh DESCRIPTION
The The
.Fn cryb_fletcher16_hash , .Fn cryb_fletcher16_hash ,
@ -75,16 +75,17 @@ argument before calling the checksum function.
.Xr cryb_hash 3 .Xr cryb_hash 3
.Sh STANDARDS .Sh STANDARDS
.Rs .Rs
.%A "Fletcher, John G." .%A Fletcher, John G.
.%D "January 1982" .%T An Arithmetic Checksum for Serial Transmissions
.%T "An Arithmetic Checksum for Serial Transmissions" .%J IEEE Transactions on Communications
.%J "IEEE Transactions on Communications" .%V 30
.%V "30" .%N 1
.%N "1" .%P 247-252
.%P "247-252" .%D January 1982
.%O "doi:10.1109/tcom.1982.1095369" .%O doi:10.1109/tcom.1982.1095369
.Re .Re
.Sh AUTHORS .Sh AUTHORS
.An -nosplit
The The
.Fn cryb_fletcher16 , .Fn cryb_fletcher16 ,
.Fn cryb_fletcher32 .Fn cryb_fletcher32

View file

@ -1,5 +1,5 @@
.\"- .\"-
.\" Copyright (c) 2016 Dag-Erling Smørgrav .\" Copyright (c) 2022 Dag-Erling Smørgrav
.\" All rights reserved. .\" All rights reserved.
.\" .\"
.\" Redistribution and use in source and binary forms, with or without .\" Redistribution and use in source and binary forms, with or without
@ -26,18 +26,12 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" SUCH DAMAGE.
.\" .\"
.Dd September 17, 2016 .Dd May 15, 2022
.Dt CRYB_HASH 3 .Dt CRYB_HASH 3
.Os .Os
.Sh NAME .Sh NAME
.Nm cryb_hash_version , .Nm cryb_hash_version
.Nm cryb_adler32_hash , .Nd non-cryptographic hash function library
.Nm cryb_fletcher16_hash ,
.Nm cryb_fletcher32_hash ,
.Nm cryb_fletcher64_hash ,
.Nm cryb_pearson_hash ,
.Nm cryb_pearson_hash_str
.Nd hash and checksum functions
.Sh LIBRARY .Sh LIBRARY
.Lb libcryb-hash .Lb libcryb-hash
.Sh SYNOPSIS .Sh SYNOPSIS
@ -46,18 +40,6 @@
.In cryb/hash.h .In cryb/hash.h
.Ft const char * .Ft const char *
.Fn cryb_hash_version "void" .Fn cryb_hash_version "void"
.Ft uint32_t
.Fn cryb_adler32_hash "const void *data" "size_t len"
.Ft uint16_t
.Fn fletcher16_hash "const void *data" "size_t len"
.Ft uint32_t
.Fn fletcher32_hash "const void *data" "size_t len"
.Ft uint64_t
.Fn fletcher64_hash "const void *data" "size_t len"
.Ft uint8_t
.Fn cryb_pearson_hash "const void *data" "size_t len"
.Ft uint8_t
.Fn cryb_pearson_hash_str "const char *str"
.Sh DESCRIPTION .Sh DESCRIPTION
The The
.Fn cryb_hash_version .Fn cryb_hash_version
@ -71,22 +53,10 @@ respective manual pages.
.Sh SEE ALSO .Sh SEE ALSO
.Xr cryb_adler32 3 , .Xr cryb_adler32 3 ,
.Xr cryb_fletcher 3 , .Xr cryb_fletcher 3 ,
.Xr cryb_fnv 3 ,
.Xr cryb_murmur3 ,
.Xr cryb_pearson 3 .Xr cryb_pearson 3
.Sh AUTHORS .Sh AUTHORS
The .An -nosplit
.Fn cryb_hash_version , This manual page was written by
.Fn cryb_adler32_hash ,
.Fn cryb_fletcher16 ,
.Fn cryb_fletcher32
and
.Fn cryb_fletcher64
functions and corresponding manual pages were written by
.An Dag-Erling Sm\(/orgrav Aq Mt des@des.no . .An Dag-Erling Sm\(/orgrav Aq Mt des@des.no .
.Pp
The
.Fn cryb_pearson_hash
and
.Fn cryb_pearson_hash_str
functions and corresponding manual pages were written for the
University of Oslo by
.An Dag-Erling Sm\(/orgrav Aq Mt d.e.smorgrav@usit.uio.no .

64
lib/hash/cryb_murmur3.3 Normal file
View file

@ -0,0 +1,64 @@
.\"-
.\" Copyright (c) 2022 Dag-Erling Smørgrav
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. The name of the author may not be used to endorse or promote
.\" products derived from this software without specific prior written
.\" permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd May 15, 2022
.Dt CRYB_MURMUR3 3
.Os
.Sh NAME
.Nm cryb_murmur3_32_hash
.Nd non-cryptographic hash function
.Sh LIBRARY
.Lb libcryb-hash
.Sh SYNOPSIS
.In stddef.h
.In stdint.h
.In cryb/hash.h
.Ft uint32_t
.Fn murmur3_32_hash "const void *data" "size_t len" "uint32_t seed"
.Sh DESCRIPTION
The
.Fn cryb_murmur3_32_hash
function returns a 32-bit hash of the
.Va len
first bytes of the object pointed to by
.Va data
using the 32-bit MurmurHash3 algorithm.
.Sh IMPLEMENTATION NOTES
The
.In cryb/hash.h
header provides macros which allows these functions to be referred to
without their
.Dq Li cryb_
prefix.
.Sh SEE ALSO
.Xr cryb_hash 3
.Sh AUTHORS
The
.Fn cryb_murmur3_32_hash
function and this manual page were written by
.An Dag-Erling Sm\(/orgrav Aq Mt des@des.no .

View file

@ -1,6 +1,6 @@
.\"- .\"-
.\" Copyright (c) 2015-2016 The University of Oslo .\" Copyright (c) 2015-2016 The University of Oslo
.\" Copyright (c) 2016 Dag-Erling Smørgrav .\" Copyright (c) 2016-2022 Dag-Erling Smørgrav
.\" All rights reserved. .\" All rights reserved.
.\" .\"
.\" Redistribution and use in source and binary forms, with or without .\" Redistribution and use in source and binary forms, with or without
@ -27,13 +27,13 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" SUCH DAMAGE.
.\" .\"
.Dd September 17, 2016 .Dd May 15, 2022
.Dt CRYB_PEARSON_HASH 3 .Dt CRYB_PEARSON 3
.Os .Os
.Sh NAME .Sh NAME
.Nm cryb_pearson_hash , .Nm cryb_pearson_hash ,
.Nm cryb_pearson_hash_str .Nm cryb_pearson_hash_str
.Nd hash functions .Nd non-cryptographic hash functions
.Sh LIBRARY .Sh LIBRARY
.Lb libcryb-hash .Lb libcryb-hash
.Sh SYNOPSIS .Sh SYNOPSIS
@ -71,16 +71,17 @@ prefix.
.Xr cryb_hash 3 .Xr cryb_hash 3
.Sh STANDARDS .Sh STANDARDS
.Rs .Rs
.%A "Pearson, Peter K." .%A Pearson, Peter K.
.%D "June 1990" .%T Fast Hashing of Variable-Length Text Strings
.%T "Fast Hashing of Variable-Length Text Strings" .%J Communications of the ACM
.%J "Communications of the ACM" .%V 33
.%V "33" .%N 6
.%N "6" .%P 677
.%P "677" .%D June 1990
.%O "doi:10.1145/78973.78978" .%O doi:10.1145/78973.78978
.Re .Re
.Sh AUTHORS .Sh AUTHORS
.An -nosplit
The The
.Fn cryb_pearson_hash .Fn cryb_pearson_hash
and and