/*
chacha-merged.c version 20080118
D. J. Bernstein
Public domain.
*/
/* $OpenBSD: chacha_private.h,v 1.2 2013/10/04 07:02:27 djm Exp $ */
#include <chacha.h>
#include <stddef.h>
typedef unsigned char u8;
typedef unsigned int u32;
typedef unsigned int u_int;
#define U8C(v) (v##U)
#define U32C(v) (v##U)
#define ROTL32(v, n) \
(U32V((v) << (n)) | ((v) >> (32 - (n))))
#define U8TO32_LITTLE(p) \
(((u32)((p)[0]) ) | \
#define U32TO8_LITTLE(p, v) \
do { \
(p)[0] = U8V((v) ); \
} while (0)
#define XOR(v,w) ((v) ^ (w))
#define QUARTERROUND(a,b,c,d) \
void
{
const char *constants;
k += 16;
} else { /* kbits == 128 */
}
}
void
{
x->chacha_input[12] = 0;
x->chacha_input[13] = 0;
}
void
{
u_int i;
if (!bytes) return;
j0 = x->chacha_input[0];
for (;;) {
if (bytes < 64) {
m = tmp;
ctarget = c;
c = tmp;
}
for (i = 20;i > 0;i -= 2) {
}
#ifndef KEYSTREAM_ONLY
#endif
if (!j12) {
/* stopping at 2^70 bytes per nonce is user's responsibility */
}
U32TO8_LITTLE(c + 0,x0);
if (bytes <= 64) {
if (bytes < 64) {
}
return;
}
bytes -= 64;
c += 64;
#ifndef KEYSTREAM_ONLY
m += 64;
#endif
}
}