CHACHA_BLOCK_SIZE
if (round_up(stream_len, CHACHA_BLOCK_SIZE) <= req->cryptlen)
stream_len = round_up(stream_len, CHACHA_BLOCK_SIZE);
.chunksize = CHACHA_BLOCK_SIZE,
.chunksize = CHACHA_BLOCK_SIZE,
.chunksize = CHACHA_BLOCK_SIZE,
nbytes = round_down(nbytes, CHACHA_BLOCK_SIZE);
u8 first_block[CHACHA_BLOCK_SIZE];
u8 tmp[CHACHA_BLOCK_SIZE];
if (len < CHACHA_BLOCK_SIZE) {
len -= CHACHA_BLOCK_SIZE;
buf += CHACHA_BLOCK_SIZE;
u8 block[CHACHA_BLOCK_SIZE];
type entropy[CHACHA_BLOCK_SIZE * 3 / (2 * sizeof(type))]; \
u8 out[at_least CHACHA_BLOCK_SIZE], int nrounds);
u8 out[at_least CHACHA_BLOCK_SIZE])
u8 batch[CHACHA_BLOCK_SIZE * 3 / 2];
u8 batch_key[CHACHA_BLOCK_SIZE * 2];
u8 buf[CHACHA_BLOCK_SIZE];
while (bytes > CHACHA_BLOCK_SIZE) {
unsigned int l = min(bytes, CHACHA_BLOCK_SIZE * 4U);
state->x[12] += DIV_ROUND_UP(l, CHACHA_BLOCK_SIZE);
if (bytes != CHACHA_BLOCK_SIZE)
bytes <= CHACHA_BLOCK_SIZE) {
state->x[12] += DIV_ROUND_UP(bytes, CHACHA_BLOCK_SIZE);
int l = min(bytes, CHACHA_BLOCK_SIZE * 5);
if (l <= CHACHA_BLOCK_SIZE) {
u8 buf[CHACHA_BLOCK_SIZE];
state->x[12] += DIV_ROUND_UP(l, CHACHA_BLOCK_SIZE);
if (!static_branch_likely(&have_neon) || bytes <= CHACHA_BLOCK_SIZE ||
u8 out[CHACHA_BLOCK_SIZE], int nrounds)
u8 stream[CHACHA_BLOCK_SIZE] __aligned(sizeof(long));
while (bytes >= CHACHA_BLOCK_SIZE) {
crypto_xor_cpy(dst, src, stream, CHACHA_BLOCK_SIZE);
bytes -= CHACHA_BLOCK_SIZE;
dst += CHACHA_BLOCK_SIZE;
src += CHACHA_BLOCK_SIZE;
u8 chacha_stream[CHACHA_BLOCK_SIZE];
size_t l = min(length, CHACHA_BLOCK_SIZE - partial);
partial = (partial + l) & (CHACHA_BLOCK_SIZE - 1);
if (likely(length >= CHACHA_BLOCK_SIZE || length == sl)) {
l &= ~(CHACHA_BLOCK_SIZE - 1);
CHACHA_BLOCK_SIZE);
state->x[12] += l / CHACHA_BLOCK_SIZE;
if (!static_branch_likely(&have_p10) || bytes <= CHACHA_BLOCK_SIZE ||
u8 block_buffer[CHACHA_BLOCK_SIZE];
unsigned int full_blocks = bytes / CHACHA_BLOCK_SIZE;
unsigned int tail_bytes = bytes % CHACHA_BLOCK_SIZE;
src += full_blocks * CHACHA_BLOCK_SIZE;
dst += full_blocks * CHACHA_BLOCK_SIZE;
if (bytes <= CHACHA_BLOCK_SIZE || nrounds != 20 || !cpu_has_vx()) {
state->x[12] += round_up(bytes, CHACHA_BLOCK_SIZE) /
CHACHA_BLOCK_SIZE;
if (bytes > CHACHA_BLOCK_SIZE) {
while (bytes >= CHACHA_BLOCK_SIZE * 4) {
bytes -= CHACHA_BLOCK_SIZE * 4;
src += CHACHA_BLOCK_SIZE * 4;
dst += CHACHA_BLOCK_SIZE * 4;
if (bytes > CHACHA_BLOCK_SIZE) {
bytes <= CHACHA_BLOCK_SIZE)
len = min(len, maxblocks * CHACHA_BLOCK_SIZE);
return round_up(len, CHACHA_BLOCK_SIZE) / CHACHA_BLOCK_SIZE;
while (bytes >= CHACHA_BLOCK_SIZE * 8) {
bytes -= CHACHA_BLOCK_SIZE * 8;
src += CHACHA_BLOCK_SIZE * 8;
dst += CHACHA_BLOCK_SIZE * 8;
if (bytes > CHACHA_BLOCK_SIZE * 4) {
if (bytes > CHACHA_BLOCK_SIZE * 2) {
while (bytes >= CHACHA_BLOCK_SIZE * 8) {
bytes -= CHACHA_BLOCK_SIZE * 8;
src += CHACHA_BLOCK_SIZE * 8;
dst += CHACHA_BLOCK_SIZE * 8;
if (bytes > CHACHA_BLOCK_SIZE * 4) {
if (bytes > CHACHA_BLOCK_SIZE * 2) {
nblocks = len / CHACHA_BLOCK_SIZE;
buffer += nblocks * CHACHA_BLOCK_SIZE;
len -= nblocks * CHACHA_BLOCK_SIZE;
BUILD_BUG_ON(sizeof(state->batch_key) % CHACHA_BLOCK_SIZE != 0);
sizeof(state->batch_key) / CHACHA_BLOCK_SIZE);