Lines Matching refs:counter
27 unsigned int counter[CHACHA_CTR_SIZE / 4];
50 key->counter[i/4] = CHACHA_U8TOU32(iv+i);
76 key->counter[0]++;
77 if (key->counter[0] == 0)
78 key->counter[1]++;
84 ctr32 = key->counter[0];
96 * As ChaCha20_ctr32 operates on 32-bit counter, caller
107 ChaCha20_ctr32(out, inp, blocks, key->key.d, key->counter);
112 key->counter[0] = ctr32;
113 if (ctr32 == 0) key->counter[1]++;
119 key->key.d, key->counter);
132 CHACHA_CTR_SIZE, /* iv_len, 128-bit counter in the context */
192 actx->nonce[0] = actx->key.counter[1];
193 actx->nonce[1] = actx->key.counter[2];
194 actx->nonce[2] = actx->key.counter[3];
230 actx->key.counter[0] = 0;
233 actx->key.counter);
256 actx->key.counter[0] = 0;
258 actx->key.key.d, actx->key.counter);
288 actx->key.counter[0] = 0;
290 actx->key.key.d, actx->key.counter);
292 actx->key.counter[0] = 1;
301 ChaCha20_ctr32(out, in, plen, actx->key.key.d, actx->key.counter);
305 ChaCha20_ctr32(out, in, plen, actx->key.key.d, actx->key.counter);
375 actx->key.counter[0] = 0;
377 actx->key.key.d, actx->key.counter);
379 actx->key.counter[0] = 1;
546 actx->nonce[0] = actx->key.counter[1]
548 actx->nonce[1] = actx->key.counter[2]
550 actx->nonce[2] = actx->key.counter[3]
592 actx->key.counter[1] = actx->nonce[0];
593 actx->key.counter[2] = actx->nonce[1] ^ CHACHA_U8TOU32(aad);
594 actx->key.counter[3] = actx->nonce[2] ^ CHACHA_U8TOU32(aad+4);