.In foo
to
	.Fd #include <foo>
Mark up NULL with .Dv.
Use \*[Am], \*[Lt] for HTML output.
Add missing commas in enumerations.
This commit is contained in:
wiz 2005-09-10 22:06:45 +00:00
parent b80a4384df
commit f6da81bb3a
1 changed files with 17 additions and 13 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: sha2.3,v 1.1 2005/08/20 16:14:34 elad Exp $
.\" $NetBSD: sha2.3,v 1.2 2005/09/10 22:06:45 wiz Exp $
.\" $OpenBSD: sha2.3,v 1.11 2004/06/22 01:57:29 jfb Exp $
.\"
.\" Copyright (c) 2003, 2004 Todd C. Miller <Todd.Miller@courtesan.com>
@ -36,8 +36,8 @@
.Nm SHA256_Data
.Nd calculate the NIST Secure Hash Standard (version 2)
.Sh SYNOPSIS
.Fd #include <sys/types.h>
.Fd #include <sha2.h>
.In sys/types.h
.In sha2.h
.Ft void
.Fn SHA256_Init "SHA256_CTX *context"
.Ft void
@ -147,7 +147,7 @@ function is used by
to hash 512-bit blocks and forms the core of the algorithm.
Most programs should use the interface provided by
.Fn SHA256_Init ,
.Fn SHA256_Update
.Fn SHA256_Update ,
and
.Fn SHA256_Final
instead of calling
@ -168,7 +168,9 @@ function calculates the digest for a file and returns the result via
.Fn SHA256_End .
If
.Fn SHA256_File
is unable to open the file, a NULL pointer is returned.
is unable to open the file, a
.Dv NULL
pointer is returned.
.Pp
.Fn SHA256_FileChunk
behaves like
@ -202,13 +204,15 @@ and
functions the
.Ar buf
parameter should either be a string large enough to hold the resulting digest
(e.g.\&
(e.g.,
.Ev SHA256_DIGEST_STRING_LENGTH ,
.Ev SHA384_DIGEST_STRING_LENGTH
.Ev SHA384_DIGEST_STRING_LENGTH ,
or
.Ev SHA512_DIGEST_STRING_LENGTH ,
depending on the function being used)
or a NULL pointer.
or a
.Dv NULL
pointer.
In the latter case, space will be dynamically allocated via
.Xr malloc 3
and should be freed using
@ -227,13 +231,13 @@ int n;
buf = "abc";
n = strlen(buf);
SHA256_Init(&ctx);
SHA256_Update(&ctx, (u_int8_t *)buf, n);
SHA256_Final(results, &ctx);
SHA256_Init(\*[Am]ctx);
SHA256_Update(\*[Am]ctx, (u_int8_t *)buf, n);
SHA256_Final(results, \*[Am]ctx);
/* Print the digest as one long hex value */
printf("0x");
for (n = 0; n < SHA256_DIGEST_LENGTH; n++)
for (n = 0; n \*[Lt] SHA256_DIGEST_LENGTH; n++)
printf("%02x", results[n]);
putchar('\en');
.Ed
@ -275,7 +279,7 @@ helper functions are derived from code written by Poul-Henning Kamp.
This implementation of the Secure Hash Standard has not been validated by
NIST and as such is not in official compliance with the standard.
.Pp
If a message digest is to be copied to a multi-byte type (ie:
If a message digest is to be copied to a multi-byte type (i.e.:
an array of five 32-bit integers) it will be necessary to
perform byte swapping on little endian machines such as the i386, alpha,
and vax.