#ifndef CHACHA20_H
#define CHACHA20_H

#ifdef CHACHA20_TEST
void QuarterRoll(register __i0 u_int32 *a,
                 register __i1 u_int32 *b,
                 register __i2 u_int32 *c,
                 register __i3 u_int32 *d);
extern __mem_y u_int32 chachaState[32];
extern u_int32 chachaWork[32];
void Chacha20Block();
u_int16 testQuarterRoll();
u_int16 testSetKey();
u_int16 testChacha20Block();
u_int16 testChacha20Encrypt();
u_int16 test2BlockEnc();
u_int16 testPerformance();
#endif

void Chacha20SetKey(register u_int32 *key, /* 8 32-bit values or 256 bits */
		    register u_int32 counter,
		    register u_int32 *nonce, /* 3 32-bit values or 96 bits */
		    register u_int32 *state);
void Chacha20Encrypt(register u_int16 *msg, register u_int32 *state, register u_int16 len);

void Chacha20Sum32NXY(register __i0 u_int32 *d, register __i2 u_int32 __mem_y *s, register __a0 s_int16 n);
void Chacha20XOR16(register __i0 u_int16 *d, register __i2 u_int32 *s);


#endif
