Home | History | Annotate | Download | only in aes

Lines Matching refs:Counter

54 // NewGCM returns the AES cipher wrapped in Galois Counter Mode. This is only
106 var counter, tagMask [gcmBlockSize]byte
109 // Init counter to nonce||1
110 copy(counter[:], nonce)
111 counter[gcmBlockSize-1] = 1
113 // Otherwise counter = GHASH(nonce)
114 gcmAesData(&g.productTable, nonce, &counter)
115 gcmAesFinish(&g.productTable, &tagMask, &counter, uint64(len(nonce)), uint64(0))
118 aesEncBlock(&tagMask, &counter, g.ks)
125 gcmAesEnc(&g.productTable, out, plaintext, &counter, &tagOut, g.ks)
151 var counter, tagMask [gcmBlockSize]byte
154 // Init counter to nonce||1
155 copy(counter[:], nonce)
156 counter[gcmBlockSize-1] = 1
158 // Otherwise counter = GHASH(nonce)
159 gcmAesData(&g.productTable, nonce, &counter)
160 gcmAesFinish(&g.productTable, &tagMask, &counter, uint64(len(nonce)), uint64(0))
163 aesEncBlock(&tagMask, &counter, g.ks)
170 gcmAesDec(&g.productTable, out, ciphertext, &counter, &expectedTag, g.ks)