Source-Changes-HG archive

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

[src/trunk]: src/sys/crypto Const poison.



details:   https://anonhg.NetBSD.org/src/rev/7c2ceb92a3e5
branches:  trunk
changeset: 550981:7c2ceb92a3e5
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Tue Aug 26 19:58:36 2003 +0000

description:
Const poison.

diffstat:

 sys/crypto/cast128/cast128.c   |  12 +++++++-----
 sys/crypto/cast128/cast128.h   |  10 ++++++----
 sys/crypto/rijndael/rijndael.c |  10 +++++-----
 sys/crypto/rijndael/rijndael.h |   8 ++++----
 4 files changed, 22 insertions(+), 18 deletions(-)

diffs (135 lines):

diff -r 22687ab18c59 -r 7c2ceb92a3e5 sys/crypto/cast128/cast128.c
--- a/sys/crypto/cast128/cast128.c      Tue Aug 26 19:23:49 2003 +0000
+++ b/sys/crypto/cast128/cast128.c      Tue Aug 26 19:58:36 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cast128.c,v 1.6 2003/08/26 16:37:36 thorpej Exp $      */
+/*     $NetBSD: cast128.c,v 1.7 2003/08/26 20:03:57 thorpej Exp $      */
 /*      $OpenBSD: cast.c,v 1.2 2000/06/06 06:49:47 deraadt Exp $       */
 
 /*
@@ -9,7 +9,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cast128.c,v 1.6 2003/08/26 16:37:36 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cast128.c,v 1.7 2003/08/26 20:03:57 thorpej Exp $");
 
 #include <sys/types.h>
 #include <crypto/cast128/cast128.h>
@@ -41,7 +41,8 @@
 
 /***** Encryption Function *****/
 
-void cast128_encrypt(cast128_key* key, u_int8_t* inblock, u_int8_t* outblock)
+void cast128_encrypt(const cast128_key* key, const u_int8_t* inblock,
+    u_int8_t* outblock)
 {
 u_int32_t t, l, r;
 
@@ -86,7 +87,8 @@
 
 /***** Decryption Function *****/
 
-void cast128_decrypt(cast128_key* key, u_int8_t* inblock, u_int8_t* outblock)
+void cast128_decrypt(const cast128_key* key, const u_int8_t* inblock,
+    u_int8_t* outblock)
 {
 u_int32_t t, l, r;
 
@@ -131,7 +133,7 @@
 
 /***** Key Schedual *****/
 
-void cast128_setkey(cast128_key* key, u_int8_t* rawkey, int keybytes)
+void cast128_setkey(cast128_key* key, const u_int8_t* rawkey, int keybytes)
 {
 u_int32_t t[4], z[4], x[4];
 int i;
diff -r 22687ab18c59 -r 7c2ceb92a3e5 sys/crypto/cast128/cast128.h
--- a/sys/crypto/cast128/cast128.h      Tue Aug 26 19:23:49 2003 +0000
+++ b/sys/crypto/cast128/cast128.h      Tue Aug 26 19:58:36 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cast128.h,v 1.5 2003/08/26 16:37:37 thorpej Exp $ */
+/*     $NetBSD: cast128.h,v 1.6 2003/08/26 20:03:57 thorpej Exp $ */
 /*      $OpenBSD: cast.h,v 1.2 2002/03/14 01:26:51 millert Exp $       */
 
 /*
@@ -16,8 +16,10 @@
        int             rounds;         /* Number of rounds to use, 12 or 16 */
 } cast128_key;
 
-void cast128_setkey(cast128_key *key, u_int8_t *rawkey, int keybytes);
-void cast128_encrypt(cast128_key *key, u_int8_t *inblock, u_int8_t *outblock);
-void cast128_decrypt(cast128_key *key, u_int8_t *inblock, u_int8_t *outblock);
+void cast128_setkey(cast128_key *key, const u_int8_t *rawkey, int keybytes);
+void cast128_encrypt(const cast128_key *key, const u_int8_t *inblock,
+                    u_int8_t *outblock);
+void cast128_decrypt(const cast128_key *key, const u_int8_t *inblock,
+                    u_int8_t *outblock);
 
 #endif /* _CAST128_H_ */
diff -r 22687ab18c59 -r 7c2ceb92a3e5 sys/crypto/rijndael/rijndael.c
--- a/sys/crypto/rijndael/rijndael.c    Tue Aug 26 19:23:49 2003 +0000
+++ b/sys/crypto/rijndael/rijndael.c    Tue Aug 26 19:58:36 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rijndael.c,v 1.1 2003/08/26 14:24:05 thorpej Exp $     */
+/*     $NetBSD: rijndael.c,v 1.2 2003/08/26 19:58:36 thorpej Exp $     */
 
 /**             
  * rijndael-alg-fst.c 
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rijndael.c,v 1.1 2003/08/26 14:24:05 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rijndael.c,v 1.2 2003/08/26 19:58:36 thorpej Exp $");
 
 #include <sys/types.h>
 #include <sys/systm.h>
@@ -35,7 +35,7 @@
 #include <crypto/rijndael/rijndael.h>
 
 void
-rijndael_set_key(rijndael_ctx *ctx, u_char *key, int bits, int encrypt)
+rijndael_set_key(rijndael_ctx *ctx, const u_char *key, int bits, int encrypt)
 {
 
        ctx->Nr = rijndaelKeySetupEnc(ctx->ek, key, bits);
@@ -49,14 +49,14 @@
 }
 
 void
-rijndael_decrypt(rijndael_ctx *ctx, u_char *src, u_char *dst)
+rijndael_decrypt(rijndael_ctx *ctx, const u_char *src, u_char *dst)
 {
 
        rijndaelDecrypt(ctx->dk, ctx->Nr, src, dst);
 }
 
 void
-rijndael_encrypt(rijndael_ctx *ctx, u_char *src, u_char *dst)
+rijndael_encrypt(rijndael_ctx *ctx, const u_char *src, u_char *dst)
 {
 
        rijndaelEncrypt(ctx->ek, ctx->Nr, src, dst);
diff -r 22687ab18c59 -r 7c2ceb92a3e5 sys/crypto/rijndael/rijndael.h
--- a/sys/crypto/rijndael/rijndael.h    Tue Aug 26 19:23:49 2003 +0000
+++ b/sys/crypto/rijndael/rijndael.h    Tue Aug 26 19:58:36 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rijndael.h,v 1.5 2003/08/26 14:24:06 thorpej Exp $     */
+/*     $NetBSD: rijndael.h,v 1.6 2003/08/26 19:58:37 thorpej Exp $     */
 /*     $KAME: rijndael.h,v 1.3 2003/07/15 10:47:16 itojun Exp $        */
 
 /**
@@ -40,8 +40,8 @@
        uint32_t dk[4 * (RIJNDAEL_MAXNR + 1)];  /* decrypt key schedule */
 } rijndael_ctx;
 
-void   rijndael_set_key(rijndael_ctx *, u_char *, int, int);
-void   rijndael_decrypt(rijndael_ctx *, u_char *, u_char *);
-void   rijndael_encrypt(rijndael_ctx *, u_char *, u_char *);
+void   rijndael_set_key(rijndael_ctx *, const u_char *, int, int);
+void   rijndael_decrypt(rijndael_ctx *, const u_char *, u_char *);
+void   rijndael_encrypt(rijndael_ctx *, const u_char *, u_char *);
 
 #endif /* __RIJNDAEL_H */



Home | Main Index | Thread Index | Old Index