silc_log_set_debug_string("*crypt*,*hash*,*sha256*,*hmac*");
}
silc_log_set_debug_string("*crypt*,*hash*,*sha256*,*hmac*");
}
- silc_hmac_init_with_key(hmac, key1, key1_len);
- silc_hmac_update(hmac, data1, strlen(data1));
- silc_hmac_final(hmac, digest, &len);
+ silc_mac_init_with_key(hmac, key1, key1_len);
+ silc_mac_update(hmac, data1, strlen(data1));
+ silc_mac_final(hmac, digest, &len);
SILC_LOG_HEXDUMP(("Key"), (unsigned char *)key1, key1_len);
SILC_LOG_HEXDUMP(("Message"), (unsigned char *)data1, strlen(data1));
SILC_LOG_HEXDUMP(("Digest"), digest, len);
SILC_LOG_HEXDUMP(("Key"), (unsigned char *)key1, key1_len);
SILC_LOG_HEXDUMP(("Message"), (unsigned char *)data1, strlen(data1));
SILC_LOG_HEXDUMP(("Digest"), digest, len);
- silc_hmac_init_with_key(hmac, key2, key2_len);
- silc_hmac_update(hmac, data2, strlen(data2));
- silc_hmac_final(hmac, digest, &len);
+ silc_mac_init_with_key(hmac, key2, key2_len);
+ silc_mac_update(hmac, data2, strlen(data2));
+ silc_mac_final(hmac, digest, &len);
SILC_LOG_HEXDUMP(("Key"), (unsigned char *)key2, key2_len);
SILC_LOG_HEXDUMP(("Message"), (unsigned char *)data2, strlen(data2));
SILC_LOG_HEXDUMP(("Digest"), digest, len);
SILC_LOG_HEXDUMP(("Key"), (unsigned char *)key2, key2_len);
SILC_LOG_HEXDUMP(("Message"), (unsigned char *)data2, strlen(data2));
SILC_LOG_HEXDUMP(("Digest"), digest, len);
- silc_hmac_init_with_key(hmac, key3, key3_len);
- silc_hmac_update(hmac, data3, strlen(data3));
- silc_hmac_final(hmac, digest, &len);
+ silc_mac_init_with_key(hmac, key3, key3_len);
+ silc_mac_update(hmac, data3, strlen(data3));
+ silc_mac_final(hmac, digest, &len);
SILC_LOG_HEXDUMP(("Key"), (unsigned char *)key3, key3_len);
SILC_LOG_HEXDUMP(("Message"), (unsigned char *)data3, strlen(data3));
SILC_LOG_HEXDUMP(("Digest"), digest, len);
SILC_LOG_HEXDUMP(("Key"), (unsigned char *)key3, key3_len);
SILC_LOG_HEXDUMP(("Message"), (unsigned char *)data3, strlen(data3));
SILC_LOG_HEXDUMP(("Digest"), digest, len);
/* Fourth test vector */
SILC_LOG_DEBUG(("Fourth test vector"));
memset(key4, '\xaa', key4_len);
/* Fourth test vector */
SILC_LOG_DEBUG(("Fourth test vector"));
memset(key4, '\xaa', key4_len);
- silc_hmac_init_with_key(hmac, key4, key4_len);
- silc_hmac_update(hmac, data4, strlen(data4));
- silc_hmac_final(hmac, digest, &len);
+ silc_mac_init_with_key(hmac, key4, key4_len);
+ silc_mac_update(hmac, data4, strlen(data4));
+ silc_mac_final(hmac, digest, &len);
SILC_LOG_HEXDUMP(("Key"), (unsigned char *)key4, key4_len);
SILC_LOG_HEXDUMP(("Message"), (unsigned char *)data4, sizeof(data4));
SILC_LOG_HEXDUMP(("Digest"), digest, len);
SILC_LOG_HEXDUMP(("Key"), (unsigned char *)key4, key4_len);
SILC_LOG_HEXDUMP(("Message"), (unsigned char *)data4, sizeof(data4));
SILC_LOG_HEXDUMP(("Digest"), digest, len);
SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");