summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet6/ah_core.c75
1 files changed, 38 insertions, 37 deletions
diff --git a/sys/netinet6/ah_core.c b/sys/netinet6/ah_core.c
index e181a4e..96400b5 100644
--- a/sys/netinet6/ah_core.c
+++ b/sys/netinet6/ah_core.c
@@ -153,47 +153,48 @@ static void ah_hmac_ripemd160_result __P((struct ah_algorithm_state *,
static void ah_update_mbuf __P((struct mbuf *, int, int,
const struct ah_algorithm *, struct ah_algorithm_state *));
+/* checksum algorithms */
+static const struct ah_algorithm ah_algorithms[] = {
+ { ah_sumsiz_1216, ah_common_mature, 128, 128, "hmac-md5",
+ ah_hmac_md5_init, ah_hmac_md5_loop,
+ ah_hmac_md5_result, },
+ { ah_sumsiz_1216, ah_common_mature, 160, 160, "hmac-sha1",
+ ah_hmac_sha1_init, ah_hmac_sha1_loop,
+ ah_hmac_sha1_result, },
+ { ah_sumsiz_1216, ah_keyed_md5_mature, 128, 128, "keyed-md5",
+ ah_keyed_md5_init, ah_keyed_md5_loop,
+ ah_keyed_md5_result, },
+ { ah_sumsiz_1216, ah_common_mature, 160, 160, "keyed-sha1",
+ ah_keyed_sha1_init, ah_keyed_sha1_loop,
+ ah_keyed_sha1_result, },
+ { ah_sumsiz_zero, ah_none_mature, 0, 2048, "none",
+ ah_none_init, ah_none_loop, ah_none_result, },
+ { ah_sumsiz_1216, ah_common_mature, 256, 256,
+ "hmac-sha2-256",
+ ah_hmac_sha2_256_init, ah_hmac_sha2_256_loop,
+ ah_hmac_sha2_256_result, },
+ { ah_sumsiz_1216, ah_common_mature, 384, 384,
+ "hmac-sha2-384",
+ ah_hmac_sha2_384_init, ah_hmac_sha2_384_loop,
+ ah_hmac_sha2_384_result, },
+ { ah_sumsiz_1216, ah_common_mature, 512, 512,
+ "hmac-sha2-512",
+ ah_hmac_sha2_512_init, ah_hmac_sha2_512_loop,
+ ah_hmac_sha2_512_result, },
+ { ah_sumsiz_1216, ah_common_mature, 160, 160,
+ "hmac-ripemd160",
+ ah_hmac_ripemd160_init, ah_hmac_ripemd160_loop,
+ ah_hmac_ripemd160_result, },
+ { ah_sumsiz_1216, ah_common_mature, 128, 128,
+ "aes-xcbc-mac",
+ ah_aes_xcbc_mac_init, ah_aes_xcbc_mac_loop,
+ ah_aes_xcbc_mac_result, },
+};
+
const struct ah_algorithm *
ah_algorithm_lookup(idx)
int idx;
{
- /* checksum algorithms */
- static struct ah_algorithm ah_algorithms[] = {
- { ah_sumsiz_1216, ah_common_mature, 128, 128, "hmac-md5",
- ah_hmac_md5_init, ah_hmac_md5_loop,
- ah_hmac_md5_result, },
- { ah_sumsiz_1216, ah_common_mature, 160, 160, "hmac-sha1",
- ah_hmac_sha1_init, ah_hmac_sha1_loop,
- ah_hmac_sha1_result, },
- { ah_sumsiz_1216, ah_keyed_md5_mature, 128, 128, "keyed-md5",
- ah_keyed_md5_init, ah_keyed_md5_loop,
- ah_keyed_md5_result, },
- { ah_sumsiz_1216, ah_common_mature, 160, 160, "keyed-sha1",
- ah_keyed_sha1_init, ah_keyed_sha1_loop,
- ah_keyed_sha1_result, },
- { ah_sumsiz_zero, ah_none_mature, 0, 2048, "none",
- ah_none_init, ah_none_loop, ah_none_result, },
- { ah_sumsiz_1216, ah_common_mature, 256, 256,
- "hmac-sha2-256",
- ah_hmac_sha2_256_init, ah_hmac_sha2_256_loop,
- ah_hmac_sha2_256_result, },
- { ah_sumsiz_1216, ah_common_mature, 384, 384,
- "hmac-sha2-384",
- ah_hmac_sha2_384_init, ah_hmac_sha2_384_loop,
- ah_hmac_sha2_384_result, },
- { ah_sumsiz_1216, ah_common_mature, 512, 512,
- "hmac-sha2-512",
- ah_hmac_sha2_512_init, ah_hmac_sha2_512_loop,
- ah_hmac_sha2_512_result, },
- { ah_sumsiz_1216, ah_common_mature, 160, 160,
- "hmac-ripemd160",
- ah_hmac_ripemd160_init, ah_hmac_ripemd160_loop,
- ah_hmac_ripemd160_result, },
- { ah_sumsiz_1216, ah_common_mature, 128, 128,
- "aes-xcbc-mac",
- ah_aes_xcbc_mac_init, ah_aes_xcbc_mac_loop,
- ah_aes_xcbc_mac_result, },
- };
switch (idx) {
case SADB_AALG_MD5HMAC:
OpenPOWER on IntegriCloud