Lines Matching +full:16 +full:v
1 /* $OpenBSD: chacha.c,v 1.2 2023/07/17 05:26:38 djm Exp $ */
17 #define U8C(v) (v##U) argument
18 #define U32C(v) (v##U) argument
20 #define U8V(v) ((u8)(v) & U8C(0xFF)) argument
21 #define U32V(v) ((u32)(v) & U32C(0xFFFFFFFF)) argument
23 #define ROTL32(v, n) \ argument
24 (U32V((v) << (n)) | ((v) >> (32 - (n))))
29 ((u32)((p)[2]) << 16) | \
32 #define U32TO8_LITTLE(p, v) \ argument
34 (p)[0] = U8V((v) ); \
35 (p)[1] = U8V((v) >> 8); \
36 (p)[2] = U8V((v) >> 16); \
37 (p)[3] = U8V((v) >> 24); \
40 #define ROTATE(v,c) (ROTL32(v,c)) argument
41 #define XOR(v,w) ((v) ^ (w)) argument
42 #define PLUS(v,w) (U32V((v) + (w))) argument
43 #define PLUSONE(v) (PLUS((v),1)) argument
46 a = PLUS(a,b); d = ROTATE(XOR(d,a),16); \
51 static const char sigma[16] = "expand 32-byte k";
52 static const char tau[16] = "expand 16-byte k";
64 k += 16; in chacha_keysetup()
170 x4 = XOR(x4,U8TO32_LITTLE(m + 16)); in chacha_encrypt_bytes()
193 U32TO8_LITTLE(c + 16,x4); in chacha_encrypt_bytes()