Index: srtp/crypto/include/aes_icm_ossl.h |
diff --git a/srtp/crypto/include/null_cipher.h b/srtp/crypto/include/aes_icm_ossl.h |
similarity index 63% |
copy from srtp/crypto/include/null_cipher.h |
copy to srtp/crypto/include/aes_icm_ossl.h |
index 39da59a812960feb7aa62069b99474d71f9c1f3f..89da7e06930324f6004fd6b0509c79ea740c26e7 100644 |
--- a/srtp/crypto/include/null_cipher.h |
+++ b/srtp/crypto/include/aes_icm_ossl.h |
@@ -1,34 +1,33 @@ |
/* |
- * null-cipher.h |
- * |
- * header file for the null cipher |
+ * aes_icm.h |
* |
+ * Header for AES Integer Counter Mode. |
* |
* David A. McGrew |
* Cisco Systems, Inc. |
+ * |
*/ |
- |
/* |
- * |
- * Copyright (c) 2001-2006, Cisco Systems, Inc. |
+ * |
+ * Copyright (c) 2001-2005,2012, Cisco Systems, Inc. |
* All rights reserved. |
- * |
+ * |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
- * |
+ * |
* Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
- * |
+ * |
* Redistributions in binary form must reproduce the above |
* copyright notice, this list of conditions and the following |
* disclaimer in the documentation and/or other materials provided |
* with the distribution. |
- * |
+ * |
* Neither the name of the Cisco Systems, Inc. nor the names of its |
* contributors may be used to endorse or promote products derived |
* from this software without specific prior written permission. |
- * |
+ * |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
@@ -44,37 +43,31 @@ |
* |
*/ |
+#ifndef AES_ICM_H |
+#define AES_ICM_H |
-#ifndef NULL_CIPHER_H |
-#define NULL_CIPHER_H |
- |
-#include "datatypes.h" |
#include "cipher.h" |
+#include <openssl/evp.h> |
+#include <openssl/aes.h> |
-typedef struct { |
- char foo ;/* empty, for now */ |
-} null_cipher_ctx_t; |
- |
- |
-/* |
- * none of these functions do anything (though future versions may keep |
- * track of bytes encrypted, number of instances, and/or other info). |
- */ |
+#define SALT_SIZE 14 |
+#define AES_128_KEYSIZE AES_BLOCK_SIZE |
+#define AES_192_KEYSIZE AES_BLOCK_SIZE + AES_BLOCK_SIZE / 2 |
+#define AES_256_KEYSIZE AES_BLOCK_SIZE * 2 |
+#define AES_128_KEYSIZE_WSALT AES_128_KEYSIZE + SALT_SIZE |
+#define AES_192_KEYSIZE_WSALT AES_192_KEYSIZE + SALT_SIZE |
+#define AES_256_KEYSIZE_WSALT AES_256_KEYSIZE + SALT_SIZE |
-err_status_t |
-null_cipher_init(null_cipher_ctx_t *c, const uint8_t *key, int key_len); |
- |
-err_status_t |
-null_cipher_set_segment(null_cipher_ctx_t *c, |
- unsigned long segment_index); |
+typedef struct { |
+ v128_t counter; /* holds the counter value */ |
+ v128_t offset; /* initial offset value */ |
+ v256_t key; |
+ int key_size; |
+ EVP_CIPHER_CTX ctx; |
+} aes_icm_ctx_t; |
-err_status_t |
-null_cipher_encrypt(null_cipher_ctx_t *c, |
- unsigned char *buf, unsigned int *bytes_to_encr); |
+err_status_t aes_icm_openssl_set_iv(aes_icm_ctx_t *c, void *iv, int dir); |
-err_status_t |
-null_cipher_encrypt_aligned(null_cipher_ctx_t *c, |
- unsigned char *buf, int bytes_to_encr); |
+#endif /* AES_ICM_H */ |
-#endif /* NULL_CIPHER_H */ |