From 0275479cb56c7f562f3513fef66c83fc44d1d8c9 Mon Sep 17 00:00:00 2001 From: Erwin Nindl Date: Fri, 22 Jun 2007 13:59:20 +0000 Subject: added libsrtp to svn --- srtp/crypto/include/aes_cbc.h | 50 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 srtp/crypto/include/aes_cbc.h (limited to 'srtp/crypto/include/aes_cbc.h') diff --git a/srtp/crypto/include/aes_cbc.h b/srtp/crypto/include/aes_cbc.h new file mode 100644 index 0000000..9fb6682 --- /dev/null +++ b/srtp/crypto/include/aes_cbc.h @@ -0,0 +1,50 @@ +/* + * aes_cbc.h + * + * Header for AES Cipher Blobk Chaining Mode. + * + * David A. McGrew + * Cisco Systems, Inc. + * + */ + +#ifndef AES_CBC_H +#define AES_CBC_H + +#include "aes.h" +#include "cipher.h" + +typedef struct { + v128_t state; /* cipher chaining state */ + v128_t previous; /* previous ciphertext block */ + aes_expanded_key_t expanded_key; /* the cipher key */ +} aes_cbc_ctx_t; + +err_status_t +aes_cbc_set_key(aes_cbc_ctx_t *c, + const unsigned char *key); + +err_status_t +aes_cbc_encrypt(aes_cbc_ctx_t *c, + unsigned char *buf, + unsigned int *bytes_in_data); + +err_status_t +aes_cbc_context_init(aes_cbc_ctx_t *c, const uint8_t *key, + cipher_direction_t dir); + +err_status_t +aes_cbc_set_iv(aes_cbc_ctx_t *c, void *iv); + +err_status_t +aes_cbc_nist_encrypt(aes_cbc_ctx_t *c, + unsigned char *data, + unsigned int *bytes_in_data); + +err_status_t +aes_cbc_nist_decrypt(aes_cbc_ctx_t *c, + unsigned char *data, + unsigned int *bytes_in_data); + +#endif /* AES_CBC_H */ + -- cgit v1.2.3