svn rev #21624: branches/aes-ccm/src/lib/crypto/enc_provider/

lhoward@MIT.EDU lhoward at MIT.EDU
Mon Dec 29 01:01:43 EST 2008


http://src.mit.edu/fisheye/changelog/krb5/?cs=21624
Commit By: lhoward
Log Message:
cleanup


Changed Files:
U   branches/aes-ccm/src/lib/crypto/enc_provider/aes_ctr.c
Modified: branches/aes-ccm/src/lib/crypto/enc_provider/aes_ctr.c
===================================================================
--- branches/aes-ccm/src/lib/crypto/enc_provider/aes_ctr.c	2008-12-29 05:55:26 UTC (rev 21623)
+++ branches/aes-ccm/src/lib/crypto/enc_provider/aes_ctr.c	2008-12-29 06:01:42 UTC (rev 21624)
@@ -244,7 +244,7 @@
 }
 
 static krb5_error_code
-k5_aes_make_key(const krb5_data *randombits, krb5_keyblock *key)
+k5_aes_make_key_ctr(const krb5_data *randombits, krb5_keyblock *key)
 {
     if (key->length != 16 && key->length != 32)
 	return(KRB5_BAD_KEYSIZE);
@@ -258,14 +258,14 @@
 }
 
 static krb5_error_code
-krb5int_aes_init_state (const krb5_keyblock *key, krb5_keyusage usage,
-			krb5_data *state)
+krb5int_aes_init_state_ctr (const krb5_keyblock *key, krb5_keyusage usage,
+			    krb5_data *state)
 {
-    state->length = 16;
-    state->data = (void *) malloc(16);
+    state->length = BLOCK_SIZE;
+    state->data = calloc(1, state->length);
     if (state->data == NULL)
 	return ENOMEM;
-    memset(state->data, 0, state->length);
+    state->data[0] = CCM_DEFAULT_COUNTER_LEN - 1;
     return 0;
 }
 
@@ -274,8 +274,8 @@
     16, 16,
     krb5int_aes_encrypt_ctr,
     krb5int_aes_decrypt_ctr,
-    k5_aes_make_key,
-    krb5int_aes_init_state,
+    k5_aes_make_key_ctr,
+    krb5int_aes_init_state_ctr,
     krb5int_default_free_state,
     krb5int_aes_encrypt_ctr_iov,
     krb5int_aes_decrypt_ctr_iov
@@ -286,8 +286,8 @@
     32, 32,
     krb5int_aes_encrypt_ctr,
     krb5int_aes_decrypt_ctr,
-    k5_aes_make_key,
-    krb5int_aes_init_state,
+    k5_aes_make_key_ctr,
+    krb5int_aes_init_state_ctr,
     krb5int_default_free_state,
     krb5int_aes_encrypt_ctr_iov,
     krb5int_aes_decrypt_ctr_iov




More information about the cvs-krb5 mailing list