Changeset View
Changeset View
Standalone View
Standalone View
head/sys/crypto/sha2/sha256c.c
Show First 20 Lines • Show All 292 Lines • ▼ Show 20 Lines | SHA256_Final(unsigned char digest[static SHA256_DIGEST_LENGTH], SHA256_CTX *ctx) | ||||
/* Add padding */ | /* Add padding */ | ||||
SHA256_Pad(ctx); | SHA256_Pad(ctx); | ||||
/* Write the hash */ | /* Write the hash */ | ||||
be32enc_vect(digest, ctx->state, SHA256_DIGEST_LENGTH); | be32enc_vect(digest, ctx->state, SHA256_DIGEST_LENGTH); | ||||
/* Clear the context state */ | /* Clear the context state */ | ||||
memset(ctx, 0, sizeof(*ctx)); | explicit_bzero(ctx, sizeof(*ctx)); | ||||
} | } | ||||
/*** SHA-224: *********************************************************/ | /*** SHA-224: *********************************************************/ | ||||
/* | /* | ||||
* the SHA224 and SHA256 transforms are identical | * the SHA224 and SHA256 transforms are identical | ||||
*/ | */ | ||||
/* SHA-224 initialization. Begins a SHA-224 operation. */ | /* SHA-224 initialization. Begins a SHA-224 operation. */ | ||||
▲ Show 20 Lines • Show All 65 Lines • Show Last 20 Lines |