Changeset View
Changeset View
Standalone View
Standalone View
sys/crypto/via/padlock_hash.c
Show First 20 Lines • Show All 280 Lines • ▼ Show 20 Lines | |||||
static int | static int | ||||
padlock_authcompute(struct padlock_session *ses, struct cryptop *crp) | padlock_authcompute(struct padlock_session *ses, struct cryptop *crp) | ||||
{ | { | ||||
u_char hash[HASH_MAX_LEN], hash2[HASH_MAX_LEN]; | u_char hash[HASH_MAX_LEN], hash2[HASH_MAX_LEN]; | ||||
const struct auth_hash *axf; | const struct auth_hash *axf; | ||||
union authctx ctx; | union authctx ctx; | ||||
int error; | int error; | ||||
if (crp->crp_op & CRYPTO_OP_SKIP_DIGEST) | |||||
return (0); | |||||
axf = ses->ses_axf; | axf = ses->ses_axf; | ||||
padlock_copy_ctx(axf, ses->ses_ictx, &ctx); | padlock_copy_ctx(axf, ses->ses_ictx, &ctx); | ||||
error = crypto_apply(crp, crp->crp_aad_start, crp->crp_aad_length, | error = crypto_apply(crp, crp->crp_aad_start, crp->crp_aad_length, | ||||
axf->Update, &ctx); | axf->Update, &ctx); | ||||
if (error != 0) { | if (error != 0) { | ||||
padlock_free_ctx(axf, &ctx); | padlock_free_ctx(axf, &ctx); | ||||
return (error); | return (error); | ||||
▲ Show 20 Lines • Show All 129 Lines • Show Last 20 Lines |