Lines Matching refs:hash
17 #include <crypto/internal/hash.h>
77 static void set_subkey(unsigned char *hash)
79 *(u64 *)&hash[0] = be64_to_cpup((__be64 *)&hash[0]);
80 *(u64 *)&hash[8] = be64_to_cpup((__be64 *)&hash[8]);
87 static void set_aad(struct gcm_ctx *gctx, struct Hash_ctx *hash,
96 gcm_ghash_p10(nXi, hash->Htable+32, aad, i);
105 gcm_ghash_p10(gctx->aad_hash, hash->Htable+32, nXi, 16);
110 memcpy(hash->Htable, gctx->aad_hash, 16);
114 struct Hash_ctx *hash, u8 *assoc, unsigned int assoclen)
118 aes_p10_encrypt(hash->H, hash->H, rdkey);
119 set_subkey(hash->H);
120 gcm_init_htable(hash->Htable+32, hash->H);
138 set_aad(gctx, hash, assoc, assoclen);
141 static void finish_tag(struct gcm_ctx *gctx, struct Hash_ctx *hash, int len)
150 memcpy(hash->Htable, gctx->ivtag, 16);
161 * hash (AAD len and len)
163 gcm_ghash_p10(hash->Htable, hash->Htable+32, aclen, 16);
166 hash->Htable[i] ^= gctx->ivtag[i];
208 struct Hash_ctx *hash = PTR_ALIGN((void *)hashbuf, PPC_ALIGN);
245 gcmp10_init(gctx, iv, (unsigned char *) &ctx->enc_key, hash, assoc, assoclen);
267 &ctx->enc_key, gctx->iv, hash->Htable);
272 &ctx->enc_key, gctx->iv, hash->Htable);
282 /* Finalize hash */
284 finish_tag(gctx, hash, total_processed);
289 scatterwalk_map_and_copy(hash->Htable, req->dst, req->assoclen + cryptlen,
296 if (crypto_memneq(otag, hash->Htable, auth_tag_len)) {
297 memzero_explicit(hash->Htable, 16);