Browse Source

Fixup of formatting in the example source code

OPENBSD_2_6
wvdputte 25 years ago
parent
commit
b792344682
2 changed files with 6 additions and 6 deletions
  1. +3
    -3
      src/lib/libc/hash/rmd160.3
  2. +3
    -3
      src/lib/libc/hash/sha1.3

+ 3
- 3
src/lib/libc/hash/rmd160.3 View File

@ -1,4 +1,4 @@
.\" $OpenBSD: rmd160.3,v 1.5 1998/06/21 22:13:42 millert Exp $
.\" $OpenBSD: rmd160.3,v 1.6 1999/04/18 23:31:01 wvdputte Exp $
.\" .\"
.\" Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com> .\" Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com>
.\" All rights reserved. .\" All rights reserved.
@ -167,7 +167,7 @@ RMD160Final(results, &rmd);
/* Print the digest as one long hex value */ /* Print the digest as one long hex value */
printf("0x"); printf("0x");
for (n = 0; n < 20; n++) for (n = 0; n < 20; n++)
printf("%x", results[n]);
printf("%02x", results[n]);
putchar('\\n'); putchar('\\n');
.Ed .Ed
.Pp .Pp
@ -177,7 +177,7 @@ RMD160_CTX rmd;
u_char output[41]; u_char output[41];
char *buf = "abc"; char *buf = "abc";
printf("0x%s", RMD160Data(buf, strlen(buf), output));
printf("0x%s\n", RMD160Data(buf, strlen(buf), output));
.Ed .Ed
.Sh CAVEATS .Sh CAVEATS
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 (ie:


+ 3
- 3
src/lib/libc/hash/sha1.3 View File

@ -1,4 +1,4 @@
.\" $OpenBSD: sha1.3,v 1.10 1998/06/21 22:13:43 millert Exp $
.\" $OpenBSD: sha1.3,v 1.11 1999/04/18 23:31:01 wvdputte Exp $
.\" .\"
.\" Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com> .\" Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com>
.\" All rights reserved. .\" All rights reserved.
@ -164,7 +164,7 @@ SHA1Final(results, &sha);
/* Print the digest as one long hex value */ /* Print the digest as one long hex value */
printf("0x"); printf("0x");
for (n = 0; n < 20; n++) for (n = 0; n < 20; n++)
printf("%x", results[n]);
printf("%02x", results[n]);
putchar('\\n'); putchar('\\n');
.Ed .Ed
.Pp .Pp
@ -174,7 +174,7 @@ SHA1_CTX sha;
u_char output[41]; u_char output[41];
char *buf = "abc"; char *buf = "abc";
printf("0x%s", SHA1Data(buf, strlen(buf), output));
printf("0x%s\n", SHA1Data(buf, strlen(buf), output));
.Ed .Ed
.Sh CAVEATS .Sh CAVEATS
This implementation of SHA-1 has not been validated by NIST This implementation of SHA-1 has not been validated by NIST


Loading…
Cancel
Save