libsrtp/libsrtp-srtp_aes_encrypt.patch

123 lines
4.0 KiB
Diff

--- a/crypto/cipher/aes.c
+++ a/crypto/cipher/aes.c
@@ -1999,7 +1999,7 @@ aes_inv_final_round(v128_t *state, const v128_t *round_key) {
void
-aes_encrypt(v128_t *plaintext, const aes_expanded_key_t *exp_key) {
+srtp_aes_encrypt(v128_t *plaintext, const aes_expanded_key_t *exp_key) {
/* add in the subkey */
v128_xor_eq(plaintext, &exp_key->round[0]);
--- a/crypto/cipher/aes_cbc.c
+++ a/crypto/cipher/aes_cbc.c
@@ -182,7 +182,7 @@ aes_cbc_encrypt(aes_cbc_ctx_t *c,
debug_print(mod_aes_cbc, "inblock: %s",
v128_hex_string(&c->state));
- aes_encrypt(&c->state, &c->expanded_key);
+ srtp_aes_encrypt(&c->state, &c->expanded_key);
debug_print(mod_aes_cbc, "outblock: %s",
v128_hex_string(&c->state));
--- a/crypto/cipher/aes_icm.c
+++ a/crypto/cipher/aes_icm.c
@@ -240,7 +240,7 @@ aes_icm_set_octet(aes_icm_ctx_t *c,
/* fill keystream buffer, if needed */
if (tail_num) {
v128_copy(&c->keystream_buffer, &c->counter);
- aes_encrypt(&c->keystream_buffer, &c->expanded_key);
+ srtp_aes_encrypt(&c->keystream_buffer, &c->expanded_key);
c->bytes_in_buffer = sizeof(v128_t);
debug_print(mod_aes_icm, "counter: %s",
@@ -296,7 +296,7 @@ static inline void
aes_icm_advance_ismacryp(aes_icm_ctx_t *c, uint8_t forIsmacryp) {
/* fill buffer with new keystream */
v128_copy(&c->keystream_buffer, &c->counter);
- aes_encrypt(&c->keystream_buffer, &c->expanded_key);
+ srtp_aes_encrypt(&c->keystream_buffer, &c->expanded_key);
c->bytes_in_buffer = sizeof(v128_t);
debug_print(mod_aes_icm, "counter: %s",
--- a/crypto/include/aes.h
+++ a/crypto/include/aes.h
@@ -70,7 +70,7 @@ aes_expand_decryption_key(const uint8_t *key,
aes_expanded_key_t *expanded_key);
void
-aes_encrypt(v128_t *plaintext, const aes_expanded_key_t *exp_key);
+srtp_aes_encrypt(v128_t *plaintext, const aes_expanded_key_t *exp_key);
void
aes_decrypt(v128_t *plaintext, const aes_expanded_key_t *exp_key);
--- a/crypto/rng/prng.c
+++ a/crypto/rng/prng.c
@@ -108,7 +108,7 @@ x917_prng_get_octet_string(uint8_t *dest, uint32_t len) {
v128_copy(&buffer, &x917_prng.state);
/* apply aes to buffer */
- aes_encrypt(&buffer, &x917_prng.key);
+ srtp_aes_encrypt(&buffer, &x917_prng.key);
/* write data to output */
*dest++ = buffer.v8[0];
@@ -132,7 +132,7 @@ x917_prng_get_octet_string(uint8_t *dest, uint32_t len) {
buffer.v32[0] ^= t;
/* encrypt buffer */
- aes_encrypt(&buffer, &x917_prng.key);
+ srtp_aes_encrypt(&buffer, &x917_prng.key);
/* copy buffer into state */
v128_copy(&x917_prng.state, &buffer);
@@ -150,7 +150,7 @@ x917_prng_get_octet_string(uint8_t *dest, uint32_t len) {
v128_copy(&buffer, &x917_prng.state);
/* apply aes to buffer */
- aes_encrypt(&buffer, &x917_prng.key);
+ srtp_aes_encrypt(&buffer, &x917_prng.key);
/* write data to output */
for (i=0; i < tail_len; i++) {
@@ -163,7 +163,7 @@ x917_prng_get_octet_string(uint8_t *dest, uint32_t len) {
buffer.v32[0] ^= t;
/* encrypt buffer */
- aes_encrypt(&buffer, &x917_prng.key);
+ srtp_aes_encrypt(&buffer, &x917_prng.key);
/* copy buffer into state */
v128_copy(&x917_prng.state, &buffer);
--- a/crypto/test/aes_calc.c
+++ a/crypto/test/aes_calc.c
@@ -105,7 +105,7 @@ main (int argc, char *argv[]) {
exit(1);
}
- aes_encrypt(&data, &exp_key);
+ srtp_aes_encrypt(&data, &exp_key);
/* write ciphertext to output */
if (verbose) {
--- a/tables/aes_tables.c
+++ a/tables/aes_tables.c
@@ -294,7 +294,7 @@ main(void) {
#if AES_INVERSE_TEST
/*
- * test that aes_encrypt and aes_decrypt are actually
+ * test that srtp_aes_encrypt and aes_decrypt are actually
* inverses of each other
*/
@@ -331,7 +331,7 @@ aes_test_inverse(void) {
v128_copy_octet_string(&x, plaintext);
aes_expand_encryption_key(k, expanded_key);
aes_expand_decryption_key(k, decrypt_key);
- aes_encrypt(&x, expanded_key);
+ srtp_aes_encrypt(&x, expanded_key);
aes_decrypt(&x, decrypt_key);
/* compare to expected value then report */