| 113 | } |
| 114 | |
| 115 | void |
| 116 | AES_GMAC_Final(uint8_t *digest, void *ctx) |
| 117 | { |
| 118 | struct aes_gmac_ctx *agc; |
| 119 | uint8_t enccntr[GMAC_BLOCK_LEN]; |
| 120 | struct gf128 a; |
| 121 | |
| 122 | /* XXX - zero additional bytes? */ |
| 123 | agc = ctx; |
| 124 | agc->counter[GMAC_BLOCK_LEN - 1] = 1; |
| 125 | |
| 126 | rijndaelEncrypt(agc->keysched, agc->rounds, agc->counter, enccntr); |
| 127 | a = gf128_add(agc->hash, gf128_read(enccntr)); |
| 128 | gf128_write(a, digest); |
| 129 | |
| 130 | explicit_bzero(enccntr, sizeof enccntr); |
| 131 | } |
nothing calls this directly
no test coverage detected