Home | History | Annotate | Download | only in aes

Lines Matching refs:counter

14 // (gcmAsm) uses the KMCTR instruction to encrypt using AES in counter mode and
74 // NewGCM returns the AES cipher wrapped in Galois Counter Mode. This is only
135 // cryptBlocksGCM encrypts src using AES in counter mode using the given
136 // function code and key. The rightmost 32-bits of the counter are incremented
137 // between each block as required by the GCM spec. The initial counter value
138 // is given by cnt, which is updated with the value of the next counter value
147 // counterCrypt encrypts src using AES in counter mode and places the result
154 // buffer for counter values.
177 // deriveCounter computes the initial GCM counter state from the given nonce.
180 // GCM has two modes of operation with respect to the initial counter
183 // with a four-byte big-endian counter starting at one, is used
184 // directly as the starting counter. For other nonce sizes, the counter
186 var counter gcmCount
188 copy(counter[:], nonce)
189 counter[gcmBlockSize-1] = 1
195 copy(counter[:], hash[:])
197 return counter
227 counter := g.deriveCounter(nonce)
230 g.block.Encrypt(tagMask[:], counter[:])
231 counter.inc()
233 g.counterCrypt(out, plaintext, &counter)
255 counter := g.deriveCounter(nonce)
258 g.block.Encrypt(tagMask[:], counter[:])
259 counter.inc()
277 g.counterCrypt(out, ciphertext, &counter)
304 // counter state and will be overwritten with the updated counter state.
321 counter := g.deriveCounter(nonce)
325 kmaGCM(fc, g.block.key, out[:len(plaintext)], plaintext, data, &tag, &counter)
348 counter := g.deriveCounter(nonce)
352 kmaGCM(fc, g.block.key, out[:len(ciphertext)], ciphertext, data, &expectedTag, &counter)