sys/geom/eli/g_eli_key.c
/*
 * Calculate HMAC from Data-Key and IV-Key.
 */
Calculate HMAC from Data-Key and IV-Key.
Calculate HMAC from Data - Key and IV - Key .
void
g_eli_mkey_hmac(unsigned char *mkey, const unsigned char *key)
{
	unsigned char hmkey[SHA512_MDLEN];	
	unsigned char *odhmac;	
	g_eli_crypto_hmac(key, G_ELI_USERKEYLEN, "\x00", 1, hmkey, 0);
	odhmac = mkey + G_ELI_DATAIVKEYLEN;
	g_eli_crypto_hmac(hmkey, sizeof(hmkey), mkey, G_ELI_DATAIVKEYLEN,
	    odhmac, 0);
	bzero(hmkey, sizeof(hmkey));
}
void g_eli_mkey_hmac ( unsigned char * mkey , const unsigned char * key ) { unsigned char hmkey [ SHA512_MDLEN ] ; unsigned char * odhmac ; g_eli_crypto_hmac ( key , G_ELI_USERKEYLEN , " \x00 " , 1 , hmkey , 0 ) ; odhmac = mkey + G_ELI_DATAIVKEYLEN ; g_eli_crypto_hmac ( hmkey , sizeof ( hmkey ) , mkey , G_ELI_DATAIVKEYLEN , odhmac , 0 ) ; bzero ( hmkey , sizeof ( hmkey ) ) ; }
Calculate HMAC from Data-Key and IV-Key.
Calculate HMAC from Data - Key and IV - Key .
/* Key for HMAC. */ /* On-disk HMAC. */ /*
	 * The key for HMAC calculations is: hmkey = HMAC_SHA512(Derived-Key, 0)
	 */ /* Calculate HMAC from Data-Key and IV-Key. */