Source-Changes-HG archive

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

[src/netbsd-3]: src/sys/crypto/sha2 Pull up revision 1.5 (requested by tron i...



details:   https://anonhg.NetBSD.org/src/rev/dc0ca1042f47
branches:  netbsd-3
changeset: 576798:dc0ca1042f47
user:      riz <riz%NetBSD.org@localhost>
date:      Sun Jul 24 17:48:04 2005 +0000

description:
Pull up revision 1.5 (requested by tron in ticket #610):
Remove unused functions SHA*_End() and SHA*_Data().

diffstat:

 sys/crypto/sha2/sha2.c |  99 +------------------------------------------------
 1 files changed, 2 insertions(+), 97 deletions(-)

diffs (131 lines):

diff -r a7c75004b78a -r dc0ca1042f47 sys/crypto/sha2/sha2.c
--- a/sys/crypto/sha2/sha2.c    Sun Jul 24 11:10:15 2005 +0000
+++ b/sys/crypto/sha2/sha2.c    Sun Jul 24 17:48:04 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sha2.c,v 1.3 2005/02/26 23:04:17 perry Exp $   */
+/*     $NetBSD: sha2.c,v 1.3.2.1 2005/07/24 17:48:04 riz Exp $ */
 /*     $KAME: sha2.c,v 1.9 2003/07/20 00:28:38 itojun Exp $    */
 
 /*
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sha2.c,v 1.3 2005/02/26 23:04:17 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sha2.c,v 1.3.2.1 2005/07/24 17:48:04 riz Exp $");
 
 #include <sys/types.h>
 #include <sys/time.h>
@@ -613,38 +613,6 @@
        usedspace = 0;
 }
 
-char *SHA256_End(SHA256_CTX* context, char buffer[]) {
-       sha2_byte       digest[SHA256_DIGEST_LENGTH], *d = digest;
-       int             i;
-
-       /* Sanity check: */
-       assert(context != (SHA256_CTX*)0);
-
-       if (buffer != (char*)0) {
-               SHA256_Final(digest, context);
-
-               for (i = 0; i < SHA256_DIGEST_LENGTH; i++) {
-                       *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4];
-                       *buffer++ = sha2_hex_digits[*d & 0x0f];
-                       d++;
-               }
-               *buffer = (char)0;
-       } else {
-               bzero(context, sizeof(*context));
-       }
-       bzero(digest, SHA256_DIGEST_LENGTH);
-       return buffer;
-}
-
-char* SHA256_Data(const sha2_byte* data, size_t len, char digest[SHA256_DIGEST_STRING_LENGTH]) {
-       SHA256_CTX      context;
-
-       SHA256_Init(&context);
-       SHA256_Update(&context, data, len);
-       return SHA256_End(&context, digest);
-}
-
-
 /*** SHA-512: *********************************************************/
 void SHA512_Init(SHA512_CTX* context) {
        if (context == (SHA512_CTX*)0) {
@@ -942,38 +910,6 @@
        bzero(context, sizeof(*context));
 }
 
-char *SHA512_End(SHA512_CTX* context, char buffer[]) {
-       sha2_byte       digest[SHA512_DIGEST_LENGTH], *d = digest;
-       int             i;
-
-       /* Sanity check: */
-       assert(context != (SHA512_CTX*)0);
-
-       if (buffer != (char*)0) {
-               SHA512_Final(digest, context);
-
-               for (i = 0; i < SHA512_DIGEST_LENGTH; i++) {
-                       *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4];
-                       *buffer++ = sha2_hex_digits[*d & 0x0f];
-                       d++;
-               }
-               *buffer = (char)0;
-       } else {
-               bzero(context, sizeof(*context));
-       }
-       bzero(digest, SHA512_DIGEST_LENGTH);
-       return buffer;
-}
-
-char* SHA512_Data(const sha2_byte* data, size_t len, char digest[SHA512_DIGEST_STRING_LENGTH]) {
-       SHA512_CTX      context;
-
-       SHA512_Init(&context);
-       SHA512_Update(&context, data, len);
-       return SHA512_End(&context, digest);
-}
-
-
 /*** SHA-384: *********************************************************/
 void SHA384_Init(SHA384_CTX* context) {
        if (context == (SHA384_CTX*)0) {
@@ -1016,34 +952,3 @@
        /* Zero out state data */
        bzero(context, sizeof(*context));
 }
-
-char *SHA384_End(SHA384_CTX* context, char buffer[]) {
-       sha2_byte       digest[SHA384_DIGEST_LENGTH], *d = digest;
-       int             i;
-
-       /* Sanity check: */
-       assert(context != (SHA384_CTX*)0);
-
-       if (buffer != (char*)0) {
-               SHA384_Final(digest, context);
-
-               for (i = 0; i < SHA384_DIGEST_LENGTH; i++) {
-                       *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4];
-                       *buffer++ = sha2_hex_digits[*d & 0x0f];
-                       d++;
-               }
-               *buffer = (char)0;
-       } else {
-               bzero(context, sizeof(*context));
-       }
-       bzero(digest, SHA384_DIGEST_LENGTH);
-       return buffer;
-}
-
-char* SHA384_Data(const sha2_byte* data, size_t len, char digest[SHA384_DIGEST_STRING_LENGTH]) {
-       SHA384_CTX      context;
-
-       SHA384_Init(&context);
-       SHA384_Update(&context, data, len);
-       return SHA384_End(&context, digest);
-}



Home | Main Index | Thread Index | Old Index