Home | History | Annotate | Download | only in aes

Lines Matching refs:Counter

69 // NewGCM returns the AES cipher wrapped in Galois Counter Mode. This is only
126 // cryptBlocksGCM encrypts src using AES in counter mode using the given
127 // function code and key. The rightmost 32-bits of the counter are incremented
128 // between each block as required by the GCM spec. The initial counter value
129 // is given by cnt, which is updated with the value of the next counter value
138 // counterCrypt encrypts src using AES in counter mode and places the result
145 // buffer for counter values.
168 // deriveCounter computes the initial GCM counter state from the given nonce.
171 // GCM has two modes of operation with respect to the initial counter
174 // with a four-byte big-endian counter starting at one, is used
175 // directly as the starting counter. For other nonce sizes, the counter
177 var counter gcmCount
179 copy(counter[:], nonce)
180 counter[gcmBlockSize-1] = 1
186 copy(counter[:], hash[:])
188 return counter
218 counter := g.deriveCounter(nonce)
221 g.block.Encrypt(tagMask[:], counter[:])
222 counter.inc()
224 g.counterCrypt(out, plaintext, &counter)
246 counter := g.deriveCounter(nonce)
249 g.block.Encrypt(tagMask[:], counter[:])
250 counter.inc()
268 g.counterCrypt(out, ciphertext, &counter)