Source-Changes-HG archive

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

[src/trunk]: src define block length



details:   https://anonhg.NetBSD.org/src/rev/78b9a10abdc6
branches:  trunk
changeset: 346217:78b9a10abdc6
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Jul 01 16:42:46 2016 +0000

description:
define block length

diffstat:

 include/md2.h    |  3 ++-
 sys/sys/md4.h    |  5 +++--
 sys/sys/md5.h    |  5 +++--
 sys/sys/rmd160.h |  5 +++--
 sys/sys/sha1.h   |  5 +++--
 5 files changed, 14 insertions(+), 9 deletions(-)

diffs (112 lines):

diff -r ebbcfa2c812b -r 78b9a10abdc6 include/md2.h
--- a/include/md2.h     Fri Jul 01 14:48:51 2016 +0000
+++ b/include/md2.h     Fri Jul 01 16:42:46 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md2.h,v 1.6 2005/12/26 19:01:47 perry Exp $    */
+/*     $NetBSD: md2.h,v 1.7 2016/07/01 16:42:46 christos Exp $ */
 
 #ifndef _MD2_H_
 #define _MD2_H_
@@ -8,6 +8,7 @@
 
 #define        MD2_DIGEST_LENGTH               16
 #define        MD2_DIGEST_STRING_LENGTH        33
+#define        MD2_BLOCK_LENGTH                16
 
 /* MD2 context. */
 typedef struct MD2Context {
diff -r ebbcfa2c812b -r 78b9a10abdc6 sys/sys/md4.h
--- a/sys/sys/md4.h     Fri Jul 01 14:48:51 2016 +0000
+++ b/sys/sys/md4.h     Fri Jul 01 16:42:46 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md4.h,v 1.7 2005/12/26 18:41:36 perry Exp $    */
+/*     $NetBSD: md4.h,v 1.8 2016/07/01 16:43:16 christos Exp $ */
 
 /*
  * This file is derived from the RSA Data Security, Inc. MD4 Message-Digest
@@ -36,12 +36,13 @@
 #include <sys/types.h>
 
 #define MD4_DIGEST_LENGTH 16
+#define MD4_BLOCK_LENGTH 64
 
 /* MD4 context. */
 typedef struct MD4Context {
        uint32_t state[4];      /* state (ABCD) */
        uint32_t count[2];      /* number of bits, modulo 2^64 (lsb first) */
-       unsigned char buffer[64]; /* input buffer */
+       unsigned char buffer[MD4_BLOCK_LENGTH]; /* input buffer */
 } MD4_CTX;
 
 __BEGIN_DECLS
diff -r ebbcfa2c812b -r 78b9a10abdc6 sys/sys/md5.h
--- a/sys/sys/md5.h     Fri Jul 01 14:48:51 2016 +0000
+++ b/sys/sys/md5.h     Fri Jul 01 16:42:46 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md5.h,v 1.9 2005/12/26 18:41:36 perry Exp $    */
+/*     $NetBSD: md5.h,v 1.10 2016/07/01 16:43:16 christos Exp $        */
 
 /*
  * This file is derived from the RSA Data Security, Inc. MD5 Message-Digest
@@ -36,12 +36,13 @@
 
 #define MD5_DIGEST_LENGTH              16
 #define        MD5_DIGEST_STRING_LENGTH        33
+#define MD5_BLOCK_LENGTH               64
 
 /* MD5 context. */
 typedef struct MD5Context {
        uint32_t state[4];      /* state (ABCD) */
        uint32_t count[2];      /* number of bits, modulo 2^64 (lsb first) */
-       unsigned char buffer[64]; /* input buffer */
+       unsigned char buffer[MD5_BLOCK_LENGTH]; /* input buffer */
 } MD5_CTX;
 
 __BEGIN_DECLS
diff -r ebbcfa2c812b -r 78b9a10abdc6 sys/sys/rmd160.h
--- a/sys/sys/rmd160.h  Fri Jul 01 14:48:51 2016 +0000
+++ b/sys/sys/rmd160.h  Fri Jul 01 16:42:46 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rmd160.h,v 1.2 2008/02/16 17:37:13 apb Exp $   */
+/*     $NetBSD: rmd160.h,v 1.3 2016/07/01 16:43:16 christos Exp $      */
 /*     $KAME: rmd160.h,v 1.2 2003/07/25 09:37:55 itojun Exp $  */
 /*     $OpenBSD: rmd160.h,v 1.3 2002/03/14 01:26:51 millert Exp $      */
 /*
@@ -32,12 +32,13 @@
 
 #define RMD160_DIGEST_LENGTH           20
 #define RMD160_DIGEST_STRING_LENGTH    41
+#define RMD160_BLOCK_LENGTH            64
 
 /* RMD160 context. */
 typedef struct RMD160Context {
        uint32_t state[5];      /* state */
        uint64_t count;         /* number of bits, modulo 2^64 */
-       u_char buffer[64];      /* input buffer */
+       u_char buffer[RMD160_BLOCK_LENGTH];     /* input buffer */
 } RMD160_CTX;
 
 __BEGIN_DECLS
diff -r ebbcfa2c812b -r 78b9a10abdc6 sys/sys/sha1.h
--- a/sys/sys/sha1.h    Fri Jul 01 14:48:51 2016 +0000
+++ b/sys/sys/sha1.h    Fri Jul 01 16:42:46 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sha1.h,v 1.14 2009/11/06 20:31:19 joerg Exp $  */
+/*     $NetBSD: sha1.h,v 1.15 2016/07/01 16:43:16 christos Exp $       */
 
 /*
  * SHA-1 in C
@@ -14,11 +14,12 @@
 
 #define SHA1_DIGEST_LENGTH             20
 #define SHA1_DIGEST_STRING_LENGTH      41
+#define SHA1_BLOCK_LENGTH              64
 
 typedef struct {
        uint32_t state[5];
        uint32_t count[2];
-       uint8_t buffer[64];
+       uint8_t buffer[SHA1_BLOCK_LENGTH];
 } SHA1_CTX;
 
 __BEGIN_DECLS



Home | Main Index | Thread Index | Old Index