Lines Matching refs:gctx
87 static void set_aad(struct gcm_ctx *gctx, struct Hash_ctx *hash, in set_aad() argument
93 gctx->aadLen = alen; in set_aad()
104 memset(gctx->aad_hash, 0, 16); in set_aad()
105 gcm_ghash_p10(gctx->aad_hash, hash->Htable+32, nXi, 16); in set_aad()
107 memcpy(gctx->aad_hash, nXi, 16); in set_aad()
110 memcpy(hash->Htable, gctx->aad_hash, 16); in set_aad()
113 static void gcmp10_init(struct gcm_ctx *gctx, u8 *iv, unsigned char *rdkey, in gcmp10_init() argument
124 gctx->Plen = 0; in gcmp10_init()
129 aes_p10_encrypt(iv, gctx->ivtag, rdkey); in gcmp10_init()
133 memcpy(gctx->iv, iv, 16); in gcmp10_init()
135 gctx->aadLen = assoclen; in gcmp10_init()
136 memset(gctx->aad_hash, 0, 16); in gcmp10_init()
138 set_aad(gctx, hash, assoc, assoclen); in gcmp10_init()
141 static void finish_tag(struct gcm_ctx *gctx, struct Hash_ctx *hash, int len) in finish_tag() argument
147 __be64 alen = cpu_to_be64(gctx->aadLen << 3); in finish_tag()
149 if (len == 0 && gctx->aadLen == 0) { in finish_tag()
150 memcpy(hash->Htable, gctx->ivtag, 16); in finish_tag()
166 hash->Htable[i] ^= gctx->ivtag[i]; in finish_tag()
206 struct gcm_ctx *gctx = PTR_ALIGN((void *)databuf, PPC_ALIGN); in p10_aes_gcm_crypt() local
245 gcmp10_init(gctx, iv, (unsigned char *) &ctx->enc_key, hash, assoc, assoclen); in p10_aes_gcm_crypt()
267 &ctx->enc_key, gctx->iv, hash->Htable); in p10_aes_gcm_crypt()
272 &ctx->enc_key, gctx->iv, hash->Htable); in p10_aes_gcm_crypt()
284 finish_tag(gctx, hash, total_processed); in p10_aes_gcm_crypt()