Blame SOURCES/libsrtp-srtp_aes_encrypt.patch

ac9624
diff -rup a/crypto/cipher/aes.c b/crypto/cipher/aes.c
ac9624
--- a/crypto/cipher/aes.c	2014-10-13 10:35:33.000000000 -0400
ac9624
+++ b/crypto/cipher/aes.c	2014-10-31 09:25:20.603597823 -0400
ac9624
@@ -2002,7 +2002,7 @@ aes_inv_final_round(v128_t *state, const
ac9624
 
ac9624
 
ac9624
 void
ac9624
-aes_encrypt(v128_t *plaintext, const aes_expanded_key_t *exp_key) {
ac9624
+srtp_aes_encrypt(v128_t *plaintext, const aes_expanded_key_t *exp_key) {
ac9624
 
ac9624
   /* add in the subkey */
ac9624
   v128_xor_eq(plaintext, &exp_key->round[0]);
ac9624
diff -rup a/crypto/cipher/aes_cbc.c b/crypto/cipher/aes_cbc.c
ac9624
--- a/crypto/cipher/aes_cbc.c	2014-10-13 10:35:33.000000000 -0400
ac9624
+++ b/crypto/cipher/aes_cbc.c	2014-10-31 09:25:20.604597828 -0400
ac9624
@@ -192,7 +192,7 @@ aes_cbc_encrypt(aes_cbc_ctx_t *c,
ac9624
     debug_print(mod_aes_cbc, "inblock:  %s", 
ac9624
 	      v128_hex_string(&c->state));
ac9624
 
ac9624
-    aes_encrypt(&c->state, &c->expanded_key);
ac9624
+    srtp_aes_encrypt(&c->state, &c->expanded_key);
ac9624
 
ac9624
     debug_print(mod_aes_cbc, "outblock: %s", 
ac9624
 	      v128_hex_string(&c->state));
ac9624
diff -rup a/crypto/cipher/aes_icm.c b/crypto/cipher/aes_icm.c
ac9624
--- a/crypto/cipher/aes_icm.c	2014-10-13 10:35:33.000000000 -0400
ac9624
+++ b/crypto/cipher/aes_icm.c	2014-10-31 09:25:20.604597828 -0400
ac9624
@@ -260,7 +260,7 @@ aes_icm_set_octet(aes_icm_ctx_t *c,
ac9624
   /* fill keystream buffer, if needed */
ac9624
   if (tail_num) {
ac9624
     v128_copy(&c->keystream_buffer, &c->counter);
ac9624
-    aes_encrypt(&c->keystream_buffer, &c->expanded_key);
ac9624
+    srtp_aes_encrypt(&c->keystream_buffer, &c->expanded_key);
ac9624
     c->bytes_in_buffer = sizeof(v128_t);
ac9624
 
ac9624
     debug_print(mod_aes_icm, "counter:    %s", 
ac9624
@@ -316,7 +316,7 @@ static inline void
ac9624
 aes_icm_advance_ismacryp(aes_icm_ctx_t *c, uint8_t forIsmacryp) {
ac9624
   /* fill buffer with new keystream */
ac9624
   v128_copy(&c->keystream_buffer, &c->counter);
ac9624
-  aes_encrypt(&c->keystream_buffer, &c->expanded_key);
ac9624
+  srtp_aes_encrypt(&c->keystream_buffer, &c->expanded_key);
ac9624
   c->bytes_in_buffer = sizeof(v128_t);
ac9624
 
ac9624
   debug_print(mod_aes_icm, "counter:    %s", 
ac9624
diff -rup a/crypto/include/aes.h b/crypto/include/aes.h
ac9624
--- a/crypto/include/aes.h	2014-10-13 10:35:33.000000000 -0400
ac9624
+++ b/crypto/include/aes.h	2014-10-31 09:25:20.604597828 -0400
ac9624
@@ -68,7 +68,7 @@ aes_expand_decryption_key(const uint8_t
ac9624
 			  aes_expanded_key_t *expanded_key);
ac9624
 
ac9624
 void
ac9624
-aes_encrypt(v128_t *plaintext, const aes_expanded_key_t *exp_key);
ac9624
+srtp_aes_encrypt(v128_t *plaintext, const aes_expanded_key_t *exp_key);
ac9624
 
ac9624
 void
ac9624
 aes_decrypt(v128_t *plaintext, const aes_expanded_key_t *exp_key);
ac9624
diff -rup a/crypto/rng/prng.c b/crypto/rng/prng.c
ac9624
--- a/crypto/rng/prng.c	2014-10-13 10:35:33.000000000 -0400
ac9624
+++ b/crypto/rng/prng.c	2014-10-31 09:25:20.605597833 -0400
ac9624
@@ -112,7 +112,7 @@ x917_prng_get_octet_string(uint8_t *dest
ac9624
     v128_copy(&buffer, &x917_prng.state);
ac9624
 
ac9624
     /* apply aes to buffer */
ac9624
-    aes_encrypt(&buffer, &x917_prng.key);
ac9624
+    srtp_aes_encrypt(&buffer, &x917_prng.key);
ac9624
     
ac9624
     /* write data to output */
ac9624
     *dest++ = buffer.v8[0];
ac9624
@@ -136,7 +136,7 @@ x917_prng_get_octet_string(uint8_t *dest
ac9624
     buffer.v32[0] ^= t;
ac9624
 
ac9624
     /* encrypt buffer */
ac9624
-    aes_encrypt(&buffer, &x917_prng.key);
ac9624
+    srtp_aes_encrypt(&buffer, &x917_prng.key);
ac9624
 
ac9624
     /* copy buffer into state */
ac9624
     v128_copy(&x917_prng.state, &buffer);
ac9624
@@ -154,7 +154,7 @@ x917_prng_get_octet_string(uint8_t *dest
ac9624
     v128_copy(&buffer, &x917_prng.state);
ac9624
 
ac9624
     /* apply aes to buffer */
ac9624
-    aes_encrypt(&buffer, &x917_prng.key);
ac9624
+    srtp_aes_encrypt(&buffer, &x917_prng.key);
ac9624
 
ac9624
     /* write data to output */
ac9624
     for (i=0; i < tail_len; i++) {
ac9624
@@ -167,7 +167,7 @@ x917_prng_get_octet_string(uint8_t *dest
ac9624
     buffer.v32[0] ^= t;
ac9624
 
ac9624
     /* encrypt buffer */
ac9624
-    aes_encrypt(&buffer, &x917_prng.key);
ac9624
+    srtp_aes_encrypt(&buffer, &x917_prng.key);
ac9624
 
ac9624
     /* copy buffer into state */
ac9624
     v128_copy(&x917_prng.state, &buffer);
ac9624
diff -rup a/crypto/test/aes_calc.c b/crypto/test/aes_calc.c
ac9624
--- a/crypto/test/aes_calc.c	2014-10-13 10:35:33.000000000 -0400
ac9624
+++ b/crypto/test/aes_calc.c	2014-10-31 09:25:20.605597833 -0400
ac9624
@@ -109,7 +109,7 @@ main (int argc, char *argv[]) {
ac9624
     exit(1);
ac9624
   }
ac9624
 
ac9624
-  aes_encrypt(&data, &exp_key);
ac9624
+  srtp_aes_encrypt(&data, &exp_key);
ac9624
 
ac9624
   /* write ciphertext to output */
ac9624
   if (verbose) {
ac9624
diff -rup a/tables/aes_tables.c b/tables/aes_tables.c
ac9624
--- a/tables/aes_tables.c	2014-10-13 10:35:33.000000000 -0400
ac9624
+++ b/tables/aes_tables.c	2014-10-31 09:25:20.605597833 -0400
ac9624
@@ -298,7 +298,7 @@ main(void) {
ac9624
 
ac9624
 #if AES_INVERSE_TEST
ac9624
   /* 
ac9624
-   * test that aes_encrypt and aes_decrypt are actually
ac9624
+   * test that srtp_aes_encrypt and aes_decrypt are actually
ac9624
    * inverses of each other 
ac9624
    */
ac9624
     
ac9624
@@ -335,7 +335,7 @@ aes_test_inverse(void) {
ac9624
   v128_copy_octet_string(&x, plaintext);
ac9624
   aes_expand_encryption_key(k, expanded_key);
ac9624
   aes_expand_decryption_key(k, decrypt_key);
ac9624
-  aes_encrypt(&x, expanded_key);
ac9624
+  srtp_aes_encrypt(&x, expanded_key);
ac9624
   aes_decrypt(&x, decrypt_key);
ac9624
   
ac9624
   /* compare to expected value then report */