Changeset View
Changeset View
Standalone View
Standalone View
head/sys/opencrypto/crypto.c
Show First 20 Lines • Show All 438 Lines • ▼ Show 20 Lines | hmac_init_pad(struct auth_hash *axf, const char *key, int klen, void *auth_ctx, | ||||
} else | } else | ||||
memcpy(hmac_key, key, klen); | memcpy(hmac_key, key, klen); | ||||
for (i = 0; i < axf->blocksize; i++) | for (i = 0; i < axf->blocksize; i++) | ||||
hmac_key[i] ^= padval; | hmac_key[i] ^= padval; | ||||
axf->Init(auth_ctx); | axf->Init(auth_ctx); | ||||
axf->Update(auth_ctx, hmac_key, axf->blocksize); | axf->Update(auth_ctx, hmac_key, axf->blocksize); | ||||
explicit_bzero(hmac_key, sizeof(hmac_key)); | |||||
} | } | ||||
void | void | ||||
hmac_init_ipad(struct auth_hash *axf, const char *key, int klen, | hmac_init_ipad(struct auth_hash *axf, const char *key, int klen, | ||||
void *auth_ctx) | void *auth_ctx) | ||||
{ | { | ||||
hmac_init_pad(axf, key, klen, auth_ctx, HMAC_IPAD_VAL); | hmac_init_pad(axf, key, klen, auth_ctx, HMAC_IPAD_VAL); | ||||
▲ Show 20 Lines • Show All 1,861 Lines • Show Last 20 Lines |