MCPcopy Create free account
hub / github.com/F-Stack/f-stack / AES_GMAC_Setkey

Function AES_GMAC_Setkey

freebsd/opencrypto/gmac.c:47–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47void
48AES_GMAC_Setkey(void *ctx, const uint8_t *key, u_int klen)
49{
50 struct aes_gmac_ctx *agc;
51 const uint8_t zeros[GMAC_BLOCK_LEN] = {};
52 struct gf128 h;
53 uint8_t hbuf[GMAC_BLOCK_LEN];
54
55 agc = ctx;
56 agc->rounds = rijndaelKeySetupEnc(agc->keysched, key, klen * 8);
57
58 rijndaelEncrypt(agc->keysched, agc->rounds, zeros, hbuf);
59
60 h = gf128_read(hbuf);
61 gf128_genmultable4(h, &agc->ghashtbl);
62
63 explicit_bzero(&h, sizeof h);
64 explicit_bzero(hbuf, sizeof hbuf);
65}
66
67void
68AES_GMAC_Reinit(void *ctx, const uint8_t *iv, u_int ivlen)

Callers

nothing calls this directly

Calls 5

rijndaelKeySetupEncFunction · 0.85
rijndaelEncryptFunction · 0.85
gf128_readFunction · 0.85
gf128_genmultable4Function · 0.85
explicit_bzeroFunction · 0.85

Tested by

no test coverage detected