Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/hash/sha2 Drop Pad functions from sha2(3)



details:   https://anonhg.NetBSD.org/src/rev/cdc1685df4fb
branches:  trunk
changeset: 433888:cdc1685df4fb
user:      kamil <kamil%NetBSD.org@localhost>
date:      Tue Oct 09 11:36:35 2018 +0000

description:
Drop Pad functions from sha2(3)

This man-page first appeared before porting all the features to NetBSD and
actually Pad ones were never ported. Keeping it in the documentation is
misleading and actually caused bugs in handling of these functions in 3rd
party software.

diffstat:

 lib/libc/hash/sha2/sha2.3 |  23 ++---------------------
 1 files changed, 2 insertions(+), 21 deletions(-)

diffs (98 lines):

diff -r 9e98705dcefc -r cdc1685df4fb lib/libc/hash/sha2/sha2.3
--- a/lib/libc/hash/sha2/sha2.3 Tue Oct 09 02:53:11 2018 +0000
+++ b/lib/libc/hash/sha2/sha2.3 Tue Oct 09 11:36:35 2018 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: sha2.3,v 1.8 2017/10/30 15:44:29 wiz Exp $
+.\" $NetBSD: sha2.3,v 1.9 2018/10/09 11:36:35 kamil 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@localhost>
@@ -21,13 +21,12 @@
 .\"
 .\" See http://www.nist.gov/sha/ for the detailed standard
 .\"
-.Dd May 20, 2009
+.Dd October 9, 2018
 .Dt SHA2 3
 .Os
 .Sh NAME
 .Nm SHA224_Init ,
 .Nm SHA224_Update ,
-.Nm SHA224_Pad ,
 .Nm SHA224_Final ,
 .Nm SHA224_Transform ,
 .Nm SHA224_End ,
@@ -36,7 +35,6 @@
 .Nm SHA224_Data ,
 .Nm SHA256_Init ,
 .Nm SHA256_Update ,
-.Nm SHA256_Pad ,
 .Nm SHA256_Final ,
 .Nm SHA256_Transform ,
 .Nm SHA256_End ,
@@ -45,7 +43,6 @@
 .Nm SHA256_Data ,
 .Nm SHA384_Init ,
 .Nm SHA384_Update ,
-.Nm SHA384_Pad ,
 .Nm SHA384_Final ,
 .Nm SHA384_Transform ,
 .Nm SHA384_End ,
@@ -54,7 +51,6 @@
 .Nm SHA384_Data ,
 .Nm SHA512_Init ,
 .Nm SHA512_Update ,
-.Nm SHA512_Pad ,
 .Nm SHA512_Final ,
 .Nm SHA512_Transform ,
 .Nm SHA512_End ,
@@ -70,8 +66,6 @@
 .Ft void
 .Fn SHA224_Update "SHA224_CTX *context" "const uint8_t *data" "size_t len"
 .Ft void
-.Fn SHA224_Pad "SHA224_CTX *context"
-.Ft void
 .Fn SHA224_Final "uint8_t digest[SHA224_DIGEST_LENGTH]" "SHA224_CTX *context"
 .Ft void
 .Fn SHA224_Transform "uint32_t state[8]" "const uint8_t buffer[SHA224_BLOCK_LENGTH]"
@@ -88,8 +82,6 @@
 .Ft void
 .Fn SHA256_Update "SHA256_CTX *context" "const uint8_t *data" "size_t len"
 .Ft void
-.Fn SHA256_Pad "SHA256_CTX *context"
-.Ft void
 .Fn SHA256_Final "uint8_t digest[SHA256_DIGEST_LENGTH]" "SHA256_CTX *context"
 .Ft void
 .Fn SHA256_Transform "uint32_t state[8]" "const uint8_t buffer[SHA256_BLOCK_LENGTH]"
@@ -106,8 +98,6 @@
 .Ft void
 .Fn SHA384_Update "SHA384_CTX *context" "const uint8_t *data" "size_t len"
 .Ft void
-.Fn SHA384_Pad "SHA384_CTX *context"
-.Ft void
 .Fn SHA384_Final "uint8_t digest[SHA384_DIGEST_LENGTH]" "SHA384_CTX *context"
 .Ft void
 .Fn SHA384_Transform "uint64_t state[8]" "const uint8_t buffer[SHA384_BLOCK_LENGTH]"
@@ -124,8 +114,6 @@
 .Ft void
 .Fn SHA512_Update "SHA512_CTX *context" "const uint8_t *data" "size_t len"
 .Ft void
-.Fn SHA512_Pad "SHA512_CTX *context"
-.Ft void
 .Fn SHA512_Final "uint8_t digest[SHA512_DIGEST_LENGTH]" "SHA512_CTX *context"
 .Ft void
 .Fn SHA512_Transform "uint64_t state[8]" "const uint8_t buffer[SHA512_BLOCK_LENGTH]"
@@ -179,13 +167,6 @@
 parameter.
 .Pp
 The
-.Fn SHA256_Pad
-function can be used to apply padding to the message digest as in
-.Fn SHA256_Final ,
-but the current context can still be used with
-.Fn SHA256_Update .
-.Pp
-The
 .Fn SHA256_Transform
 function is used by
 .Fn SHA256_Update



Home | Main Index | Thread Index | Old Index