Source-Changes-HG archive

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

[src/trunk]: src/sys/opencrypto const'fy algorithm descriptors



details:   https://anonhg.NetBSD.org/src/rev/60f31c6430d1
branches:  trunk
changeset: 763052:60f31c6430d1
user:      drochner <drochner%NetBSD.org@localhost>
date:      Wed Mar 09 11:43:36 2011 +0000

description:
const'fy algorithm descriptors

diffstat:

 sys/opencrypto/xform.c |  54 +++++++++++++++++++++++++-------------------------
 sys/opencrypto/xform.h |  52 ++++++++++++++++++++++++------------------------
 2 files changed, 53 insertions(+), 53 deletions(-)

diffs (242 lines):

diff -r 73c1a528cb87 -r 60f31c6430d1 sys/opencrypto/xform.c
--- a/sys/opencrypto/xform.c    Wed Mar 09 11:36:43 2011 +0000
+++ b/sys/opencrypto/xform.c    Wed Mar 09 11:43:36 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xform.c,v 1.20 2011/02/25 20:13:10 drochner Exp $ */
+/*     $NetBSD: xform.c,v 1.21 2011/03/09 11:43:36 drochner Exp $ */
 /*     $FreeBSD: src/sys/opencrypto/xform.c,v 1.1.2.1 2002/11/21 23:34:23 sam Exp $    */
 /*     $OpenBSD: xform.c,v 1.19 2002/08/16 22:47:25 dhartmei Exp $     */
 
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xform.c,v 1.20 2011/02/25 20:13:10 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xform.c,v 1.21 2011/03/09 11:43:36 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/malloc.h>
@@ -89,130 +89,130 @@
 };
 
 /* Encryption instances */
-struct enc_xform enc_xform_null = {
+const struct enc_xform enc_xform_null = {
        CRYPTO_NULL_CBC, "NULL",
        /* NB: blocksize of 4 is to generate a properly aligned ESP header */
        4, 0, 256 /* 2048 bits, max key */
 };
 
-struct enc_xform enc_xform_des = {
+const struct enc_xform enc_xform_des = {
        CRYPTO_DES_CBC, "DES",
        8, 8, 8
 };
 
-struct enc_xform enc_xform_3des = {
+const struct enc_xform enc_xform_3des = {
        CRYPTO_3DES_CBC, "3DES",
        8, 24, 24
 };
 
-struct enc_xform enc_xform_blf = {
+const struct enc_xform enc_xform_blf = {
        CRYPTO_BLF_CBC, "Blowfish",
        8, 5, 56 /* 448 bits, max key */
 };
 
-struct enc_xform enc_xform_cast5 = {
+const struct enc_xform enc_xform_cast5 = {
        CRYPTO_CAST_CBC, "CAST-128",
        8, 5, 16
 };
 
-struct enc_xform enc_xform_skipjack = {
+const struct enc_xform enc_xform_skipjack = {
        CRYPTO_SKIPJACK_CBC, "Skipjack",
        8, 10, 10
 };
 
-struct enc_xform enc_xform_rijndael128 = {
+const struct enc_xform enc_xform_rijndael128 = {
        CRYPTO_RIJNDAEL128_CBC, "Rijndael-128/AES",
        16, 8, 32
 };
 
-struct enc_xform enc_xform_arc4 = {
+const struct enc_xform enc_xform_arc4 = {
        CRYPTO_ARC4, "ARC4",
        1, 1, 32
 };
 
 /* Authentication instances */
-struct auth_hash auth_hash_null = {
+const struct auth_hash auth_hash_null = {
        CRYPTO_NULL_HMAC, "NULL-HMAC",
        0, 0, 12, 64, sizeof(int)               /* NB: context isn't used */
 };
 
-struct auth_hash auth_hash_hmac_md5 = {
+const struct auth_hash auth_hash_hmac_md5 = {
        CRYPTO_MD5_HMAC, "HMAC-MD5",
        16, 16, 16, 64, sizeof(MD5_CTX)
 };
 
-struct auth_hash auth_hash_hmac_sha1 = {
+const struct auth_hash auth_hash_hmac_sha1 = {
        CRYPTO_SHA1_HMAC, "HMAC-SHA1",
        20, 20, 20, 64, sizeof(SHA1_CTX)
 };
 
-struct auth_hash auth_hash_hmac_ripemd_160 = {
+const struct auth_hash auth_hash_hmac_ripemd_160 = {
        CRYPTO_RIPEMD160_HMAC, "HMAC-RIPEMD-160",
        20, 20, 20, 64, sizeof(RMD160_CTX)
 };
 
-struct auth_hash auth_hash_hmac_md5_96 = {
+const struct auth_hash auth_hash_hmac_md5_96 = {
        CRYPTO_MD5_HMAC_96, "HMAC-MD5-96",
        16, 16, 12, 64, sizeof(MD5_CTX)
 };
 
-struct auth_hash auth_hash_hmac_sha1_96 = {
+const struct auth_hash auth_hash_hmac_sha1_96 = {
        CRYPTO_SHA1_HMAC_96, "HMAC-SHA1-96",
        20, 20, 12, 64, sizeof(SHA1_CTX)
 };
 
-struct auth_hash auth_hash_hmac_ripemd_160_96 = {
+const struct auth_hash auth_hash_hmac_ripemd_160_96 = {
        CRYPTO_RIPEMD160_HMAC_96, "HMAC-RIPEMD-160",
        20, 20, 12, 64, sizeof(RMD160_CTX)
 };
 
-struct auth_hash auth_hash_key_md5 = {
+const struct auth_hash auth_hash_key_md5 = {
        CRYPTO_MD5_KPDK, "Keyed MD5",
        0, 16, 16, 0, sizeof(MD5_CTX)
 };
 
-struct auth_hash auth_hash_key_sha1 = {
+const struct auth_hash auth_hash_key_sha1 = {
        CRYPTO_SHA1_KPDK, "Keyed SHA1",
        0, 20, 20, 0, sizeof(SHA1_CTX)
 };
 
-struct auth_hash auth_hash_md5 = {
+const struct auth_hash auth_hash_md5 = {
        CRYPTO_MD5, "MD5",
        0, 16, 16, 0, sizeof(MD5_CTX)
 };
 
-struct auth_hash auth_hash_sha1 = {
+const struct auth_hash auth_hash_sha1 = {
        CRYPTO_SHA1, "SHA1",
        0, 20, 20, 0, sizeof(SHA1_CTX)
 };
 
-struct auth_hash auth_hash_hmac_sha2_256 = {
+const struct auth_hash auth_hash_hmac_sha2_256 = {
        CRYPTO_SHA2_256_HMAC, "HMAC-SHA2",
        32, 32, 16, 64, sizeof(SHA256_CTX)
 };
 
-struct auth_hash auth_hash_hmac_sha2_384 = {
+const struct auth_hash auth_hash_hmac_sha2_384 = {
        CRYPTO_SHA2_384_HMAC, "HMAC-SHA2-384",
        48, 48, 24, 128, sizeof(SHA384_CTX)
 };
 
-struct auth_hash auth_hash_hmac_sha2_512 = {
+const struct auth_hash auth_hash_hmac_sha2_512 = {
        CRYPTO_SHA2_512_HMAC, "HMAC-SHA2-512",
        64, 64, 32, 128, sizeof(SHA512_CTX)
 };
 
 /* Compression instance */
-struct comp_algo comp_algo_deflate = {
+const struct comp_algo comp_algo_deflate = {
        CRYPTO_DEFLATE_COMP, "Deflate",
        90
 };
 
-struct comp_algo comp_algo_deflate_nogrow = {
+const struct comp_algo comp_algo_deflate_nogrow = {
        CRYPTO_DEFLATE_COMP_NOGROW, "Deflate",
        90
 };
 
-struct comp_algo comp_algo_gzip = {
+const struct comp_algo comp_algo_gzip = {
        CRYPTO_GZIP_COMP, "GZIP",
        90
 };
diff -r 73c1a528cb87 -r 60f31c6430d1 sys/opencrypto/xform.h
--- a/sys/opencrypto/xform.h    Wed Mar 09 11:36:43 2011 +0000
+++ b/sys/opencrypto/xform.h    Wed Mar 09 11:43:36 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xform.h,v 1.12 2011/02/25 20:13:10 drochner Exp $ */
+/*     $NetBSD: xform.h,v 1.13 2011/03/09 11:43:36 drochner Exp $ */
 /*     $FreeBSD: src/sys/opencrypto/xform.h,v 1.1.2.1 2002/11/21 23:34:23 sam Exp $    */
 /*     $OpenBSD: xform.h,v 1.10 2002/04/22 23:10:09 deraadt Exp $      */
 
@@ -61,33 +61,33 @@
 extern const u_int8_t hmac_ipad_buffer[128];
 extern const u_int8_t hmac_opad_buffer[128];
 
-extern struct enc_xform enc_xform_null;
-extern struct enc_xform enc_xform_des;
-extern struct enc_xform enc_xform_3des;
-extern struct enc_xform enc_xform_blf;
-extern struct enc_xform enc_xform_cast5;
-extern struct enc_xform enc_xform_skipjack;
-extern struct enc_xform enc_xform_rijndael128;
-extern struct enc_xform enc_xform_arc4;
+extern const struct enc_xform enc_xform_null;
+extern const struct enc_xform enc_xform_des;
+extern const struct enc_xform enc_xform_3des;
+extern const struct enc_xform enc_xform_blf;
+extern const struct enc_xform enc_xform_cast5;
+extern const struct enc_xform enc_xform_skipjack;
+extern const struct enc_xform enc_xform_rijndael128;
+extern const struct enc_xform enc_xform_arc4;
 
-extern struct auth_hash auth_hash_null;
-extern struct auth_hash auth_hash_md5;
-extern struct auth_hash auth_hash_sha1;
-extern struct auth_hash auth_hash_key_md5;
-extern struct auth_hash auth_hash_key_sha1;
-extern struct auth_hash auth_hash_hmac_md5;
-extern struct auth_hash auth_hash_hmac_sha1;
-extern struct auth_hash auth_hash_hmac_ripemd_160;
-extern struct auth_hash auth_hash_hmac_md5_96;
-extern struct auth_hash auth_hash_hmac_sha1_96;
-extern struct auth_hash auth_hash_hmac_ripemd_160_96;
-extern struct auth_hash auth_hash_hmac_sha2_256;
-extern struct auth_hash auth_hash_hmac_sha2_384;
-extern struct auth_hash auth_hash_hmac_sha2_512;
+extern const struct auth_hash auth_hash_null;
+extern const struct auth_hash auth_hash_md5;
+extern const struct auth_hash auth_hash_sha1;
+extern const struct auth_hash auth_hash_key_md5;
+extern const struct auth_hash auth_hash_key_sha1;
+extern const struct auth_hash auth_hash_hmac_md5;
+extern const struct auth_hash auth_hash_hmac_sha1;
+extern const struct auth_hash auth_hash_hmac_ripemd_160;
+extern const struct auth_hash auth_hash_hmac_md5_96;
+extern const struct auth_hash auth_hash_hmac_sha1_96;
+extern const struct auth_hash auth_hash_hmac_ripemd_160_96;
+extern const struct auth_hash auth_hash_hmac_sha2_256;
+extern const struct auth_hash auth_hash_hmac_sha2_384;
+extern const struct auth_hash auth_hash_hmac_sha2_512;
 
-extern struct comp_algo comp_algo_deflate;
-extern struct comp_algo comp_algo_deflate_nogrow;
-extern struct comp_algo comp_algo_gzip;
+extern const struct comp_algo comp_algo_deflate;
+extern const struct comp_algo comp_algo_deflate_nogrow;
+extern const struct comp_algo comp_algo_gzip;
 
 #ifdef _KERNEL
 #include <sys/malloc.h>



Home | Main Index | Thread Index | Old Index