MAC Interface

DESCRIPTION

The Message Authentication Code interface for computing MAC values for authentication purposes. The MAC is usually used in combination with encryption to provide authentication.

EXAMPLE

 SilcMac hmac;

 // Allocate HMAC
 silc_mac_alloc(SILC_MAC_HMAC_SHA256, &hmac);

 // Set secret key to the MAC
 silc_mac_set_key(hmac, key, key_len);

 // Compute MAC
 unsigned char mac[SILC_MAC_MAXLEN];
 SilcUInt32 mac_len;

 silc_mac_make(hmac, data, data_len, digest, &mac_len);

 // Free MAC
 silc_mac_free(hmac);

TABLE OF CONTENTS