switch (self->base.id)
{
- case ZRTP_SRTP_HASH_SHA1: {
+ case ZRTP_SRTP_HASH_HMAC_SHA1: {
sha1_ctx ctx;
if (dst->max_length < SHA1_DIGEST_SIZE) {
return zrtp_status_buffer_size;
void *ctx = NULL;
switch (self->base.id) {
- case ZRTP_SRTP_HASH_SHA1:
+ case ZRTP_SRTP_HASH_HMAC_SHA1:
ctx = zrtp_sys_alloc(sizeof(sha1_ctx));
if (ctx) {
sha1_begin(ctx);
}
switch (self->base.id) {
- case ZRTP_SRTP_HASH_SHA1:
+ case ZRTP_SRTP_HASH_HMAC_SHA1:
sha1_hash((const unsigned char*)msg, length, (sha1_ctx*)ctx);
break;
case ZRTP_HASH_SHA256:
}
switch (self->base.id) {
- case ZRTP_SRTP_HASH_SHA1:
+ case ZRTP_SRTP_HASH_HMAC_SHA1:
if (digest->max_length < SHA1_DIGEST_SIZE) {
return zrtp_status_buffer_size;
}
static void* zrtp_hmac_begin(zrtp_hash_t *self, const zrtp_stringn_t *key) {
switch (self->base.id)
{
- case ZRTP_SRTP_HASH_SHA1:
+ case ZRTP_SRTP_HASH_HMAC_SHA1:
return zrtp_hmac_sha1_begin_c(self, key->buffer, key->length);
case ZRTP_HASH_SHA256:
return zrtp_hmac_sha256_begin_c(self, key->buffer, key->length);
if (0 != length) {
switch (self->base.id) {
- case ZRTP_SRTP_HASH_SHA1:
+ case ZRTP_SRTP_HASH_HMAC_SHA1:
sha1_hash((const unsigned char*)msg, length, &((hmac_sha1_context_t*)ctx)->context);
break;
case ZRTP_HASH_SHA256:
switch (self->base.id)
{
- case ZRTP_SRTP_HASH_SHA1:
+ case ZRTP_SRTP_HASH_HMAC_SHA1:
/* finish up 1st pass */
sha1_end((unsigned char*)dst.buffer, &((hmac_sha1_context_t*)ctx)->context);
}
switch (self->base.id) {
- case ZRTP_SRTP_HASH_SHA1:
+ case ZRTP_SRTP_HASH_HMAC_SHA1:
local_key_len = SHA1_BLOCK_SIZE;
break;
case ZRTP_HASH_SHA256:
if (key_len > local_key_len) {
switch (self->base.id)
{
- case ZRTP_SRTP_HASH_SHA1:
+ case ZRTP_SRTP_HASH_HMAC_SHA1:
sha1_begin(&context1);
sha1_hash((const unsigned char*)key, key_len, &context1);
sha1_end(local_key, &context1);
}
switch (self->base.id) {
- case ZRTP_SRTP_HASH_SHA1:
+ case ZRTP_SRTP_HASH_HMAC_SHA1:
/* perform inner hash */
sha1_begin(&context1); /* init context for 1st pass */
sha1_hash(k_ipad, local_key_len, &context1);/* start with inner pad */
{
uint32_t necessary_len_max = 0;
switch (self->base.id) {
- case ZRTP_SRTP_HASH_SHA1:
+ case ZRTP_SRTP_HASH_HMAC_SHA1:
necessary_len_max = SHA1_DIGEST_SIZE;
break;
case ZRTP_HASH_SHA256:
zrtp_hmac_c(self, key, key_len, msg, msg_len, (zrtp_stringn_t *)&dst);
switch (self->base.id) {
- case ZRTP_SRTP_HASH_SHA1:
+ case ZRTP_SRTP_HASH_HMAC_SHA1:
necessary_len = ZRTP_MIN(necessary_len, SHA1_DIGEST_SIZE);
break;
case ZRTP_HASH_SHA256:
ZRTP_LOG(3, (_ZTU_,"SHA1 Testing\n"));
ZRTP_LOG(3, (_ZTU_, "\t8-bit test... "));
- res = zrtp_sha_test(self, sha1_msg_8, sizeof(sha1_msg_8), sha1_MD_8, ZRTP_SRTP_HASH_SHA1);
+ res = zrtp_sha_test(self, sha1_msg_8, sizeof(sha1_msg_8), sha1_MD_8, ZRTP_SRTP_HASH_HMAC_SHA1);
ZRTP_LOGC(3, ("%s\n", zrtp_status_ok == res?"OK":"FALSE"));
ZRTP_LOG(3, (_ZTU_, "\t128-bit test... "));
- res = zrtp_sha_test(self, sha1_msg_128, sizeof(sha1_msg_128), sha1_MD_128, ZRTP_SRTP_HASH_SHA1);
+ res = zrtp_sha_test(self, sha1_msg_128, sizeof(sha1_msg_128), sha1_MD_128, ZRTP_SRTP_HASH_HMAC_SHA1);
ZRTP_LOGC(3, ("%s\n", zrtp_status_ok == res?"OK":"FALSE"));
ZRTP_LOG(3, (_ZTU_, "\t512-bit test... "));
- res = zrtp_sha_test(self, sha1_msg_512, sizeof(sha1_msg_512), sha1_MD_512, ZRTP_SRTP_HASH_SHA1);
+ res = zrtp_sha_test(self, sha1_msg_512, sizeof(sha1_msg_512), sha1_MD_512, ZRTP_SRTP_HASH_HMAC_SHA1);
ZRTP_LOGC(3, ("%s\n", zrtp_status_ok == res?"OK":"FALSE"));
ZRTP_LOG(3, (_ZTU_, "\t2096-bit test... "));
- res = zrtp_sha_test(self, sha1_msg_2096, sizeof(sha1_msg_2096), sha1_MD_2096, ZRTP_SRTP_HASH_SHA1);
+ res = zrtp_sha_test(self, sha1_msg_2096, sizeof(sha1_msg_2096), sha1_MD_2096, ZRTP_SRTP_HASH_HMAC_SHA1);
ZRTP_LOGC(3, ("%s\n", zrtp_status_ok == res?"OK":"FALSE"));
return res;
test_case1_hmac_sha1_data,
sizeof(test_case1_hmac_sha1_data),
test_case1_hmac_sha1_result,
- ZRTP_SRTP_HASH_SHA1);
+ ZRTP_SRTP_HASH_HMAC_SHA1);
ZRTP_LOGC(3, ("%s\n", zrtp_status_ok == res?"OK":"FALSE"));
ZRTP_LOG(3, (_ZTU_, "\t2 case test... "));
test_case2_hmac_sha1_data,
sizeof(test_case2_hmac_sha1_data),
test_case2_hmac_sha1_result,
- ZRTP_SRTP_HASH_SHA1);
+ ZRTP_SRTP_HASH_HMAC_SHA1);
ZRTP_LOGC(3, ("%s\n", zrtp_status_ok == res?"OK":"FALSE"));
ZRTP_LOG(3, (_ZTU_, "\t3 case test... "));
test_case3_hmac_sha1_data,
sizeof(test_case3_hmac_sha1_data),
test_case3_hmac_sha1_result,
- ZRTP_SRTP_HASH_SHA1);
+ ZRTP_SRTP_HASH_HMAC_SHA1);
ZRTP_LOGC(3, ("%s\n", zrtp_status_ok == res?"OK":"FALSE"));
ZRTP_LOG(3, (_ZTU_, "\t4 case test... "));
test_case4_hmac_sha1_data,
sizeof(test_case4_hmac_sha1_data),
test_case4_hmac_sha1_result,
- ZRTP_SRTP_HASH_SHA1);
+ ZRTP_SRTP_HASH_HMAC_SHA1);
ZRTP_LOGC(3, ("%s\n", zrtp_status_ok == res?"OK":"FALSE"));
ZRTP_LOG(3, (_ZTU_, "\t5 case test... "));
test_case5_hmac_sha1_data,
sizeof(test_case5_hmac_sha1_data),
test_case5_hmac_sha1_result,
- ZRTP_SRTP_HASH_SHA1);
+ ZRTP_SRTP_HASH_HMAC_SHA1);
ZRTP_LOGC(3, ("%s\n", zrtp_status_ok == res?"OK":"FALSE"));
ZRTP_LOG(3, (_ZTU_, "\t6 case test... "));
test_case6_hmac_sha1_data,
sizeof(test_case6_hmac_sha1_data),
test_case6_hmac_sha1_result,
- ZRTP_SRTP_HASH_SHA1);
+ ZRTP_SRTP_HASH_HMAC_SHA1);
ZRTP_LOGC(3, ("%s\n", zrtp_status_ok == res?"OK":"FALSE"));
ZRTP_LOG(3, (_ZTU_, "\t7 case test... "));
test_case7_hmac_sha1_data,
sizeof(test_case7_hmac_sha1_data),
test_case7_hmac_sha1_result,
- ZRTP_SRTP_HASH_SHA1);
+ ZRTP_SRTP_HASH_HMAC_SHA1);
ZRTP_LOGC(3, ("%s\n", zrtp_status_ok == res?"OK":"FALSE"));
return res;
zrtp_memcpy(hash_sha1->base.type, ZRTP_S160, ZRTP_COMP_TYPE_SIZE);
- hash_sha1->base.id = ZRTP_SRTP_HASH_SHA1;
+ hash_sha1->base.id = ZRTP_SRTP_HASH_HMAC_SHA1;
hash_sha1->base.zrtp = global_ctx;
hash_sha1->block_length = SHA1_BLOCK_SIZE;
hash_sha1->digest_length = SHA1_DIGEST_SIZE;