| 45 | } |
| 46 | |
| 47 | void |
| 48 | AES_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 | |
| 67 | void |
| 68 | AES_GMAC_Reinit(void *ctx, const uint8_t *iv, u_int ivlen) |
nothing calls this directly
no test coverage detected