Commit 857009c1 authored by jfigus's avatar jfigus

Rename all public functions, types, and defines to begin with srtp_ prefix to...

Rename all public functions, types, and defines to begin with srtp_ prefix to comply with modern library coding convention.
parent 339b61dc
......@@ -1476,32 +1476,32 @@ aes_256_expand_encryption_key(const unsigned char *key,
}
}
err_status_t
srtp_err_status_t
aes_expand_encryption_key(const uint8_t *key,
int key_len,
aes_expanded_key_t *expanded_key) {
if (key_len == 16) {
aes_128_expand_encryption_key(key, expanded_key);
return err_status_ok;
return srtp_err_status_ok;
}
else if (key_len == 24) {
/* AES-192 not yet supported */
return err_status_bad_param;
return srtp_err_status_bad_param;
}
else if (key_len == 32) {
aes_256_expand_encryption_key(key, expanded_key);
return err_status_ok;
return srtp_err_status_ok;
}
else
return err_status_bad_param;
return srtp_err_status_bad_param;
}
err_status_t
srtp_err_status_t
aes_expand_decryption_key(const uint8_t *key,
int key_len,
aes_expanded_key_t *expanded_key) {
int i;
err_status_t status;
srtp_err_status_t status;
int num_rounds = expanded_key->num_rounds;
status = aes_expand_encryption_key(key, key_len, expanded_key);
......@@ -1587,7 +1587,7 @@ aes_expand_decryption_key(const uint8_t *key,
#endif
}
return err_status_ok;
return srtp_err_status_ok;
}
#ifdef CPU_CISC
......
......@@ -57,7 +57,7 @@ debug_module_t mod_aes_cbc = {
err_status_t
srtp_err_status_t
aes_cbc_alloc(cipher_t **c, int key_len, int tlen) {
extern cipher_type_t aes_cbc;
uint8_t *pointer;
......@@ -67,13 +67,13 @@ aes_cbc_alloc(cipher_t **c, int key_len, int tlen) {
"allocating cipher with key length %d", key_len);
if (key_len != 16 && key_len != 24 && key_len != 32)
return err_status_bad_param;
return srtp_err_status_bad_param;
/* allocate memory a cipher of type aes_cbc */
tmp = (sizeof(aes_cbc_ctx_t) + sizeof(cipher_t));
pointer = (uint8_t*)crypto_alloc(tmp);
if (pointer == NULL)
return err_status_alloc_fail;
return srtp_err_status_alloc_fail;
/* set pointers */
*c = (cipher_t *)pointer;
......@@ -84,10 +84,10 @@ aes_cbc_alloc(cipher_t **c, int key_len, int tlen) {
/* set key size */
(*c)->key_len = key_len;
return err_status_ok;
return srtp_err_status_ok;
}
err_status_t
srtp_err_status_t
aes_cbc_dealloc(cipher_t *c) {
extern cipher_type_t aes_cbc;
......@@ -98,10 +98,10 @@ aes_cbc_dealloc(cipher_t *c) {
/* free memory */
crypto_free(c);
return err_status_ok;
return srtp_err_status_ok;
}
err_status_t
srtp_err_status_t
aes_cbc_context_init(aes_cbc_ctx_t *c, const uint8_t *key, int key_len) {
debug_print(mod_aes_cbc,
......@@ -114,13 +114,13 @@ aes_cbc_context_init(aes_cbc_ctx_t *c, const uint8_t *key, int key_len) {
c->key_len = (key_len <= 32 ? key_len : 32);
memcpy(c->key, key, c->key_len);
return err_status_ok;
return srtp_err_status_ok;
}
err_status_t
srtp_err_status_t
aes_cbc_set_iv(aes_cbc_ctx_t *c, void *iv, int direction) {
err_status_t status;
srtp_err_status_t status;
int i;
/* v128_t *input = iv; */
uint8_t *input = (uint8_t*) iv;
......@@ -146,13 +146,13 @@ aes_cbc_set_iv(aes_cbc_ctx_t *c, void *iv, int direction) {
return status;
break;
default:
return err_status_bad_param;
return srtp_err_status_bad_param;
}
return err_status_ok;
return srtp_err_status_ok;
}
err_status_t
srtp_err_status_t
aes_cbc_encrypt(aes_cbc_ctx_t *c,
unsigned char *data,
unsigned int *bytes_in_data) {
......@@ -165,7 +165,7 @@ aes_cbc_encrypt(aes_cbc_ctx_t *c,
* verify that we're 16-octet aligned
*/
if (*bytes_in_data & 0xf)
return err_status_bad_param;
return srtp_err_status_bad_param;
/*
* note that we assume that the initialization vector has already
......@@ -199,10 +199,10 @@ aes_cbc_encrypt(aes_cbc_ctx_t *c,
bytes_to_encr -= 16;
}
return err_status_ok;
return srtp_err_status_ok;
}
err_status_t
srtp_err_status_t
aes_cbc_decrypt(aes_cbc_ctx_t *c,
unsigned char *data,
unsigned int *bytes_in_data) {
......@@ -217,7 +217,7 @@ aes_cbc_decrypt(aes_cbc_ctx_t *c,
* verify that we're 16-octet aligned
*/
if (*bytes_in_data & 0x0f)
return err_status_bad_param;
return srtp_err_status_bad_param;
/* set 'previous' block to iv*/
for (i=0; i < 16; i++) {
......@@ -261,18 +261,18 @@ aes_cbc_decrypt(aes_cbc_ctx_t *c,
bytes_to_encr -= 16;
}
return err_status_ok;
return srtp_err_status_ok;
}
err_status_t
srtp_err_status_t
aes_cbc_nist_encrypt(aes_cbc_ctx_t *c,
unsigned char *data,
unsigned int *bytes_in_data) {
int i;
unsigned char *pad_start;
int num_pad_bytes;
err_status_t status;
srtp_err_status_t status;
/*
* determine the number of padding bytes that we need to add -
......@@ -297,17 +297,17 @@ aes_cbc_nist_encrypt(aes_cbc_ctx_t *c,
if (status)
return status;
return err_status_ok;
return srtp_err_status_ok;
}
err_status_t
srtp_err_status_t
aes_cbc_nist_decrypt(aes_cbc_ctx_t *c,
unsigned char *data,
unsigned int *bytes_in_data) {
unsigned char *pad_end;
int num_pad_bytes;
err_status_t status;
srtp_err_status_t status;
/*
* cbc decrypt the padded data
......@@ -330,7 +330,7 @@ aes_cbc_nist_decrypt(aes_cbc_ctx_t *c,
/* decrement data size */
*bytes_in_data -= num_pad_bytes;
return err_status_ok;
return srtp_err_status_ok;
}
......@@ -552,7 +552,7 @@ cipher_type_t aes_cbc = {
(char *) aes_cbc_description,
(cipher_test_case_t *) &aes_cbc_test_case_3,
(debug_module_t *) &mod_aes_cbc,
(cipher_type_id_t) AES_CBC
(srtp_cipher_type_id_t) AES_CBC
};
This diff is collapsed.
......@@ -92,7 +92,7 @@ debug_module_t mod_aes_icm = {
*
*/
err_status_t
srtp_err_status_t
aes_icm_alloc_ismacryp(cipher_t **c, int key_len, int forIsmacryp) {
extern cipher_type_t aes_icm;
uint8_t *pointer;
......@@ -111,13 +111,13 @@ aes_icm_alloc_ismacryp(cipher_t **c, int key_len, int forIsmacryp) {
*/
if (!(forIsmacryp && key_len > 16 && key_len < 30) &&
key_len != 30 && key_len != 38 && key_len != 46)
return err_status_bad_param;
return srtp_err_status_bad_param;
/* allocate memory a cipher of type aes_icm */
tmp = (sizeof(aes_icm_ctx_t) + sizeof(cipher_t));
pointer = (uint8_t*)crypto_alloc(tmp);
if (pointer == NULL)
return err_status_alloc_fail;
return srtp_err_status_alloc_fail;
/* set pointers */
*c = (cipher_t *)pointer;
......@@ -138,14 +138,14 @@ aes_icm_alloc_ismacryp(cipher_t **c, int key_len, int forIsmacryp) {
/* set key size */
(*c)->key_len = key_len;
return err_status_ok;
return srtp_err_status_ok;
}
err_status_t aes_icm_alloc(cipher_t **c, int key_len, int forIsmacryp) {
srtp_err_status_t aes_icm_alloc(cipher_t **c, int key_len, int forIsmacryp) {
return aes_icm_alloc_ismacryp(c, key_len, 0);
}
err_status_t
srtp_err_status_t
aes_icm_dealloc(cipher_t *c) {
extern cipher_type_t aes_icm;
......@@ -156,7 +156,7 @@ aes_icm_dealloc(cipher_t *c) {
/* free memory */
crypto_free(c);
return err_status_ok;
return srtp_err_status_ok;
}
......@@ -170,9 +170,9 @@ aes_icm_dealloc(cipher_t *c) {
* randomizes the starting point in the keystream
*/
err_status_t
srtp_err_status_t
aes_icm_context_init(aes_icm_ctx_t *c, const uint8_t *key, int key_len) {
err_status_t status;
srtp_err_status_t status;
int base_key_len, copy_len;
if (key_len > 16 && key_len < 30) /* Ismacryp */
......@@ -180,7 +180,7 @@ aes_icm_context_init(aes_icm_ctx_t *c, const uint8_t *key, int key_len) {
else if (key_len == 30 || key_len == 38 || key_len == 46)
base_key_len = key_len - 14;
else
return err_status_bad_param;
return srtp_err_status_bad_param;
/*
* set counter and initial values to 'offset' value, being careful not to
......@@ -213,7 +213,7 @@ aes_icm_context_init(aes_icm_ctx_t *c, const uint8_t *key, int key_len) {
/* indicate that the keystream_buffer is empty */
c->bytes_in_buffer = 0;
return err_status_ok;
return srtp_err_status_ok;
}
/*
......@@ -222,7 +222,7 @@ aes_icm_context_init(aes_icm_ctx_t *c, const uint8_t *key, int key_len) {
* is the ith octet
*/
err_status_t
srtp_err_status_t
aes_icm_set_octet(aes_icm_ctx_t *c,
uint64_t octet_num) {
......@@ -271,7 +271,7 @@ aes_icm_set_octet(aes_icm_ctx_t *c,
c->bytes_in_buffer = 0;
}
return err_status_ok;
return srtp_err_status_ok;
}
/*
......@@ -279,7 +279,7 @@ aes_icm_set_octet(aes_icm_ctx_t *c,
* the offset
*/
err_status_t
srtp_err_status_t
aes_icm_set_iv(aes_icm_ctx_t *c, void *iv, int direction) {
v128_t *nonce = (v128_t *) iv;
......@@ -294,7 +294,7 @@ aes_icm_set_iv(aes_icm_ctx_t *c, void *iv, int direction) {
/* indicate that the keystream_buffer is empty */
c->bytes_in_buffer = 0;
return err_status_ok;
return srtp_err_status_ok;
}
......@@ -344,7 +344,7 @@ aes_icm_advance_ismacryp(aes_icm_ctx_t *c, uint8_t forIsmacryp) {
* - fill buffer then add in remaining (< 16) bytes of keystream
*/
err_status_t
srtp_err_status_t
aes_icm_encrypt_ismacryp(aes_icm_ctx_t *c,
unsigned char *buf, unsigned int *enc_len,
int forIsmacryp) {
......@@ -354,7 +354,7 @@ aes_icm_encrypt_ismacryp(aes_icm_ctx_t *c,
/* check that there's enough segment left but not for ismacryp*/
if (!forIsmacryp && (bytes_to_encr + htons(c->counter.v16[7])) > 0xffff)
return err_status_terminus;
return srtp_err_status_terminus;
debug_print(mod_aes_icm, "block index: %d",
htons(c->counter.v16[7]));
......@@ -370,7 +370,7 @@ aes_icm_encrypt_ismacryp(aes_icm_ctx_t *c,
c->bytes_in_buffer -= bytes_to_encr;
/* return now to avoid the main loop */
return err_status_ok;
return srtp_err_status_ok;
} else {
......@@ -449,15 +449,15 @@ aes_icm_encrypt_ismacryp(aes_icm_ctx_t *c,
}
return err_status_ok;
return srtp_err_status_ok;
}
err_status_t
srtp_err_status_t
aes_icm_encrypt(aes_icm_ctx_t *c, unsigned char *buf, unsigned int *enc_len) {
return aes_icm_encrypt_ismacryp(c, buf, enc_len, 0);
}
err_status_t
srtp_err_status_t
aes_icm_output(aes_icm_ctx_t *c, uint8_t *buffer, unsigned int num_octets_to_output) {
unsigned int len = num_octets_to_output;
......@@ -576,6 +576,6 @@ cipher_type_t aes_icm = {
(char *) aes_icm_description,
(cipher_test_case_t *) &aes_icm_test_case_1,
(debug_module_t *) &mod_aes_icm,
(cipher_type_id_t) AES_ICM
(srtp_cipher_type_id_t) AES_ICM
};
......@@ -110,7 +110,7 @@ extern cipher_type_t aes_icm_256;
* value. The tlen argument is for the AEAD tag length, which
* isn't used in counter mode.
*/
err_status_t aes_icm_openssl_alloc (cipher_t **c, int key_len, int tlen)
srtp_err_status_t aes_icm_openssl_alloc (cipher_t **c, int key_len, int tlen)
{
aes_icm_ctx_t *icm;
int tmp;
......@@ -123,14 +123,14 @@ err_status_t aes_icm_openssl_alloc (cipher_t **c, int key_len, int tlen)
*/
if (key_len != AES_128_KEYSIZE_WSALT && key_len != AES_192_KEYSIZE_WSALT &&
key_len != AES_256_KEYSIZE_WSALT) {
return err_status_bad_param;
return srtp_err_status_bad_param;
}
/* allocate memory a cipher of type aes_icm */
tmp = sizeof(cipher_t) + sizeof(aes_icm_ctx_t);
allptr = (uint8_t*)crypto_alloc(tmp);
if (allptr == NULL) {
return err_status_alloc_fail;
return srtp_err_status_alloc_fail;
}
/* set pointers */
......@@ -161,19 +161,19 @@ err_status_t aes_icm_openssl_alloc (cipher_t **c, int key_len, int tlen)
(*c)->key_len = key_len;
EVP_CIPHER_CTX_init(&icm->ctx);
return err_status_ok;
return srtp_err_status_ok;
}
/*
* This function deallocates an instance of this engine
*/
err_status_t aes_icm_openssl_dealloc (cipher_t *c)
srtp_err_status_t aes_icm_openssl_dealloc (cipher_t *c)
{
aes_icm_ctx_t *ctx;
if (c == NULL) {
return err_status_bad_param;
return srtp_err_status_bad_param;
}
/*
......@@ -191,7 +191,7 @@ err_status_t aes_icm_openssl_dealloc (cipher_t *c)
/* free memory */
crypto_free(c);
return err_status_ok;
return srtp_err_status_ok;
}
/*
......@@ -203,7 +203,7 @@ err_status_t aes_icm_openssl_dealloc (cipher_t *c)
* the salt is unpredictable (but not necessarily secret) data which
* randomizes the starting point in the keystream
*/
err_status_t aes_icm_openssl_context_init (aes_icm_ctx_t *c, const uint8_t *key, int len)
srtp_err_status_t aes_icm_openssl_context_init (aes_icm_ctx_t *c, const uint8_t *key, int len)
{
/*
* set counter and initial values to 'offset' value, being careful not to
......@@ -211,7 +211,7 @@ err_status_t aes_icm_openssl_context_init (aes_icm_ctx_t *c, const uint8_t *key,
*/
if (c->key_size + SALT_SIZE != len)
return err_status_bad_param;
return srtp_err_status_bad_param;
v128_set_to_zero(&c->counter);
v128_set_to_zero(&c->offset);
......@@ -242,7 +242,7 @@ err_status_t aes_icm_openssl_context_init (aes_icm_ctx_t *c, const uint8_t *key,
EVP_CIPHER_CTX_cleanup(&c->ctx);
return err_status_ok;
return srtp_err_status_ok;
}
......@@ -250,7 +250,7 @@ err_status_t aes_icm_openssl_context_init (aes_icm_ctx_t *c, const uint8_t *key,
* aes_icm_set_iv(c, iv) sets the counter value to the exor of iv with
* the offset
*/
err_status_t aes_icm_openssl_set_iv (aes_icm_ctx_t *c, void *iv, int dir)
srtp_err_status_t aes_icm_openssl_set_iv (aes_icm_ctx_t *c, void *iv, int dir)
{
const EVP_CIPHER *evp;
v128_t *nonce = (v128_t*)iv;
......@@ -272,15 +272,15 @@ err_status_t aes_icm_openssl_set_iv (aes_icm_ctx_t *c, void *iv, int dir)
evp = EVP_aes_128_ctr();
break;
default:
return err_status_bad_param;
return srtp_err_status_bad_param;
break;
}
if (!EVP_EncryptInit_ex(&c->ctx, evp,
NULL, c->key.v8, c->counter.v8)) {
return err_status_fail;
return srtp_err_status_fail;
} else {
return err_status_ok;
return srtp_err_status_ok;
}
}
......@@ -292,23 +292,23 @@ err_status_t aes_icm_openssl_set_iv (aes_icm_ctx_t *c, void *iv, int dir)
* buf data to encrypt
* enc_len length of encrypt buffer
*/
err_status_t aes_icm_openssl_encrypt (aes_icm_ctx_t *c, unsigned char *buf, unsigned int *enc_len)
srtp_err_status_t aes_icm_openssl_encrypt (aes_icm_ctx_t *c, unsigned char *buf, unsigned int *enc_len)
{
int len = 0;
debug_print(mod_aes_icm, "rs0: %s", v128_hex_string(&c->counter));
if (!EVP_EncryptUpdate(&c->ctx, buf, &len, buf, *enc_len)) {
return err_status_cipher_fail;
return srtp_err_status_cipher_fail;
}
*enc_len = len;
if (!EVP_EncryptFinal_ex(&c->ctx, buf, &len)) {
return err_status_cipher_fail;
return srtp_err_status_cipher_fail;
}
*enc_len += len;
return err_status_ok;
return srtp_err_status_ok;
}
uint16_t aes_icm_bytes_encrypted(aes_icm_ctx_t *c)
......@@ -476,7 +476,7 @@ cipher_type_t aes_icm = {
(char*) aes_icm_openssl_description,
(cipher_test_case_t*) &aes_icm_test_case_0,
(debug_module_t*) &mod_aes_icm,
(cipher_type_id_t) AES_ICM
(srtp_cipher_type_id_t) AES_ICM
};
/*
......@@ -495,7 +495,7 @@ cipher_type_t aes_icm_192 = {
(char*) aes_icm_192_openssl_description,
(cipher_test_case_t*) &aes_icm_192_test_case_1,
(debug_module_t*) &mod_aes_icm,
(cipher_type_id_t) AES_192_ICM
(srtp_cipher_type_id_t) AES_192_ICM
};
/*
......@@ -514,6 +514,6 @@ cipher_type_t aes_icm_256 = {
(char*) aes_icm_256_openssl_description,
(cipher_test_case_t*) &aes_icm_256_test_case_2,
(debug_module_t*) &mod_aes_icm,
(cipher_type_id_t) AES_256_ICM
(srtp_cipher_type_id_t) AES_256_ICM
};
......@@ -58,7 +58,7 @@ debug_module_t mod_cipher = {
"cipher" /* printable module name */
};
err_status_t
srtp_err_status_t
cipher_output(cipher_t *c, uint8_t *buffer, int num_octets_to_output) {
/* zeroize the buffer */
......@@ -85,11 +85,11 @@ cipher_get_key_length(const cipher_t *c) {
#define NUM_RAND_TESTS 128
#define MAX_KEY_LEN 64
err_status_t
srtp_err_status_t
cipher_type_test(const cipher_type_t *ct, const cipher_test_case_t *test_data) {
const cipher_test_case_t *test_case = test_data;
cipher_t *c;
err_status_t status;
srtp_err_status_t status;
uint8_t buffer[SELF_TEST_BUF_OCTETS];
uint8_t buffer2[SELF_TEST_BUF_OCTETS];
int tag_len;
......@@ -104,7 +104,7 @@ cipher_type_test(const cipher_type_t *ct, const cipher_test_case_t *test_data) {
* return an error if we don't - we need to be paranoid here
*/
if (test_case == NULL)
return err_status_cant_check;
return srtp_err_status_cant_check;
/*
* loop over all test cases, perform known-answer tests of both the
......@@ -131,7 +131,7 @@ cipher_type_test(const cipher_type_t *ct, const cipher_test_case_t *test_data) {
/* copy plaintext into test buffer */
if (test_case->ciphertext_length_octets > SELF_TEST_BUF_OCTETS) {
cipher_dealloc(c);
return err_status_bad_param;
return srtp_err_status_bad_param;
}
for (i=0; i < test_case->plaintext_length_octets; i++)
buffer[i] = test_case->plaintext[i];
......@@ -191,11 +191,11 @@ cipher_type_test(const cipher_type_t *ct, const cipher_test_case_t *test_data) {
/* compare the resulting ciphertext with that in the test case */
if (len != test_case->ciphertext_length_octets)
return err_status_algo_fail;
status = err_status_ok;
return srtp_err_status_algo_fail;
status = srtp_err_status_ok;
for (i=0; i < test_case->ciphertext_length_octets; i++)
if (buffer[i] != test_case->ciphertext[i]) {
status = err_status_algo_fail;
status = srtp_err_status_algo_fail;
debug_print(mod_cipher, "test case %d failed", case_num);
debug_print(mod_cipher, "(failure at byte %d)", i);
break;
......@@ -210,7 +210,7 @@ cipher_type_test(const cipher_type_t *ct, const cipher_test_case_t *test_data) {
2*test_case->plaintext_length_octets));
cipher_dealloc(c);
return err_status_algo_fail;
return srtp_err_status_algo_fail;
}
/*
......@@ -228,7 +228,7 @@ cipher_type_test(const cipher_type_t *ct, const cipher_test_case_t *test_data) {
/* copy ciphertext into test buffer */
if (test_case->ciphertext_length_octets > SELF_TEST_BUF_OCTETS) {
cipher_dealloc(c);
return err_status_bad_param;
return srtp_err_status_bad_param;
}
for (i=0; i < test_case->ciphertext_length_octets; i++)
buffer[i] = test_case->ciphertext[i];
......@@ -273,11 +273,11 @@ cipher_type_test(const cipher_type_t *ct, const cipher_test_case_t *test_data) {
/* compare the resulting plaintext with that in the test case */
if (len != test_case->plaintext_length_octets)
return err_status_algo_fail;
status = err_status_ok;
return srtp_err_status_algo_fail;
status = srtp_err_status_ok;
for (i=0; i < test_case->plaintext_length_octets; i++)
if (buffer[i] != test_case->plaintext[i]) {
status = err_status_algo_fail;
status = srtp_err_status_algo_fail;
debug_print(mod_cipher, "test case %d failed", case_num);
debug_print(mod_cipher, "(failure at byte %d)", i);
}
......@@ -291,7 +291,7 @@ cipher_type_test(const cipher_type_t *ct, const cipher_test_case_t *test_data) {
2*test_case->plaintext_length_octets));
cipher_dealloc(c);
return err_status_algo_fail;
return srtp_err_status_algo_fail;
}
/* deallocate the cipher */
......@@ -338,7 +338,7 @@ cipher_type_test(const cipher_type_t *ct, const cipher_test_case_t *test_data) {
/* choose a key at random */
if (test_case->key_length_octets > MAX_KEY_LEN)
return err_status_cant_check;
return srtp_err_status_cant_check;
status = rand_source_get_octet_string(key, test_case->key_length_octets);
if (status) return status;
......@@ -435,18 +435,18 @@ cipher_type_test(const cipher_type_t *ct, const cipher_test_case_t *test_data) {
/* compare the resulting plaintext with the original one */
if (length != plaintext_len) {
return err_status_algo_fail;
return srtp_err_status_algo_fail;
}
status = err_status_ok;
status = srtp_err_status_ok;
for (i=0; i < plaintext_len; i++)
if (buffer[i] != buffer2[i]) {
status = err_status_algo_fail;
status = srtp_err_status_algo_fail;
debug_print(mod_cipher, "random test case %d failed", case_num);
debug_print(mod_cipher, "(failure at byte %d)", i);
}
if (status) {
cipher_dealloc(c);
return err_status_algo_fail;
return srtp_err_status_algo_fail;
}
}
......@@ -455,7 +455,7 @@ cipher_type_test(const cipher_type_t *ct, const cipher_test_case_t *test_data) {
if (status)
return status;
return err_status_ok;
return srtp_err_status_ok;
}
......@@ -464,7 +464,7 @@ cipher_type_test(const cipher_type_t *ct, const cipher_test_case_t *test_data) {
* list of test data.
*/
err_status_t
srtp_err_status_t
cipher_type_self_test(const cipher_type_t *ct) {
return cipher_type_test(ct, ct->test_data);
}
......
......@@ -56,7 +56,7 @@
extern debug_module_t mod_cipher;
err_status_t
srtp_err_status_t
null_cipher_alloc(cipher_t **c, int key_len, int tlen) {
extern cipher_type_t null_cipher;
uint8_t *pointer;
......@@ -67,7 +67,7 @@ null_cipher_alloc(cipher_t **c, int key_len, int tlen) {
/* allocate memory a cipher of type null_cipher */
pointer = (uint8_t*)crypto_alloc(sizeof(null_cipher_ctx_t) + sizeof(cipher_t));
if (pointer == NULL)
return err_status_alloc_fail;
return srtp_err_status_alloc_fail;
/* set pointers */
*c = (cipher_t *)pointer;
......@@ -78,11 +78,11 @@ null_cipher_alloc(cipher_t **c, int key_len, int tlen) {
/* set key size */
(*c)->key_len = key_len;
return err_status_ok;
return srtp_err_status_ok;
}
err_status_t
srtp_err_status_t
null_cipher_dealloc(cipher_t *c) {
extern cipher_type_t null_cipher;
......@@ -93,27 +93,27 @@ null_cipher_dealloc(cipher_t *c) {
/* free memory of type null_cipher */
crypto_free(c);
return err_status_ok;
return srtp_err_status_ok;
}
err_status_t
srtp_err_status_t
null_cipher_init(null_cipher_ctx_t *ctx, const uint8_t *key, int key_len) {
debug_print(mod_cipher, "initializing null cipher", NULL);
return err_status_ok;
return srtp_err_status_ok;
}
err_status_t
srtp_