Lines Matching refs:x
15 static void chacha_permute(u32 *x, int nrounds) in chacha_permute() argument
23 x[0] += x[4]; x[12] = rol32(x[12] ^ x[0], 16); in chacha_permute()
24 x[1] += x[5]; x[13] = rol32(x[13] ^ x[1], 16); in chacha_permute()
25 x[2] += x[6]; x[14] = rol32(x[14] ^ x[2], 16); in chacha_permute()
26 x[3] += x[7]; x[15] = rol32(x[15] ^ x[3], 16); in chacha_permute()
28 x[8] += x[12]; x[4] = rol32(x[4] ^ x[8], 12); in chacha_permute()
29 x[9] += x[13]; x[5] = rol32(x[5] ^ x[9], 12); in chacha_permute()
30 x[10] += x[14]; x[6] = rol32(x[6] ^ x[10], 12); in chacha_permute()
31 x[11] += x[15]; x[7] = rol32(x[7] ^ x[11], 12); in chacha_permute()
33 x[0] += x[4]; x[12] = rol32(x[12] ^ x[0], 8); in chacha_permute()
34 x[1] += x[5]; x[13] = rol32(x[13] ^ x[1], 8); in chacha_permute()
35 x[2] += x[6]; x[14] = rol32(x[14] ^ x[2], 8); in chacha_permute()
36 x[3] += x[7]; x[15] = rol32(x[15] ^ x[3], 8); in chacha_permute()
38 x[8] += x[12]; x[4] = rol32(x[4] ^ x[8], 7); in chacha_permute()
39 x[9] += x[13]; x[5] = rol32(x[5] ^ x[9], 7); in chacha_permute()
40 x[10] += x[14]; x[6] = rol32(x[6] ^ x[10], 7); in chacha_permute()
41 x[11] += x[15]; x[7] = rol32(x[7] ^ x[11], 7); in chacha_permute()
43 x[0] += x[5]; x[15] = rol32(x[15] ^ x[0], 16); in chacha_permute()
44 x[1] += x[6]; x[12] = rol32(x[12] ^ x[1], 16); in chacha_permute()
45 x[2] += x[7]; x[13] = rol32(x[13] ^ x[2], 16); in chacha_permute()
46 x[3] += x[4]; x[14] = rol32(x[14] ^ x[3], 16); in chacha_permute()
48 x[10] += x[15]; x[5] = rol32(x[5] ^ x[10], 12); in chacha_permute()
49 x[11] += x[12]; x[6] = rol32(x[6] ^ x[11], 12); in chacha_permute()
50 x[8] += x[13]; x[7] = rol32(x[7] ^ x[8], 12); in chacha_permute()
51 x[9] += x[14]; x[4] = rol32(x[4] ^ x[9], 12); in chacha_permute()
53 x[0] += x[5]; x[15] = rol32(x[15] ^ x[0], 8); in chacha_permute()
54 x[1] += x[6]; x[12] = rol32(x[12] ^ x[1], 8); in chacha_permute()
55 x[2] += x[7]; x[13] = rol32(x[13] ^ x[2], 8); in chacha_permute()
56 x[3] += x[4]; x[14] = rol32(x[14] ^ x[3], 8); in chacha_permute()
58 x[10] += x[15]; x[5] = rol32(x[5] ^ x[10], 7); in chacha_permute()
59 x[11] += x[12]; x[6] = rol32(x[6] ^ x[11], 7); in chacha_permute()
60 x[8] += x[13]; x[7] = rol32(x[7] ^ x[8], 7); in chacha_permute()
61 x[9] += x[14]; x[4] = rol32(x[4] ^ x[9], 7); in chacha_permute()
77 u32 x[16]; in chacha_block() local
80 memcpy(x, state, 64); in chacha_block()
82 chacha_permute(x, nrounds); in chacha_block()
84 for (i = 0; i < ARRAY_SIZE(x); i++) in chacha_block()
85 put_unaligned_le32(x[i] + state[i], &stream[i * sizeof(u32)]); in chacha_block()
104 u32 x[16]; in hchacha_block() local
106 memcpy(x, in, 64); in hchacha_block()
108 chacha_permute(x, nrounds); in hchacha_block()
110 memcpy(&out[0], &x[0], 16); in hchacha_block()
111 memcpy(&out[4], &x[12], 16); in hchacha_block()