Lines Matching full:state
8 INLINE void g(uint32_t *state, size_t a, size_t b, size_t c, size_t d, in g() argument
10 state[a] = state[a] + state[b] + x; in g()
11 state[d] = rotr32(state[d] ^ state[a], 16); in g()
12 state[c] = state[c] + state[d]; in g()
13 state[b] = rotr32(state[b] ^ state[c], 12); in g()
14 state[a] = state[a] + state[b] + y; in g()
15 state[d] = rotr32(state[d] ^ state[a], 8); in g()
16 state[c] = state[c] + state[d]; in g()
17 state[b] = rotr32(state[b] ^ state[c], 7); in g()
20 INLINE void round_fn(uint32_t state[16], const uint32_t *msg, size_t round) { in round_fn()
25 g(state, 0, 4, 8, 12, msg[schedule[0]], msg[schedule[1]]); in round_fn()
26 g(state, 1, 5, 9, 13, msg[schedule[2]], msg[schedule[3]]); in round_fn()
27 g(state, 2, 6, 10, 14, msg[schedule[4]], msg[schedule[5]]); in round_fn()
28 g(state, 3, 7, 11, 15, msg[schedule[6]], msg[schedule[7]]); in round_fn()
31 g(state, 0, 5, 10, 15, msg[schedule[8]], msg[schedule[9]]); in round_fn()
32 g(state, 1, 6, 11, 12, msg[schedule[10]], msg[schedule[11]]); in round_fn()
33 g(state, 2, 7, 8, 13, msg[schedule[12]], msg[schedule[13]]); in round_fn()
34 g(state, 3, 4, 9, 14, msg[schedule[14]], msg[schedule[15]]); in round_fn()
37 INLINE void compress_pre(uint32_t state[16], const uint32_t cv[8], in compress_pre()
58 state[0] = cv[0]; in compress_pre()
59 state[1] = cv[1]; in compress_pre()
60 state[2] = cv[2]; in compress_pre()
61 state[3] = cv[3]; in compress_pre()
62 state[4] = cv[4]; in compress_pre()
63 state[5] = cv[5]; in compress_pre()
64 state[6] = cv[6]; in compress_pre()
65 state[7] = cv[7]; in compress_pre()
66 state[8] = IV[0]; in compress_pre()
67 state[9] = IV[1]; in compress_pre()
68 state[10] = IV[2]; in compress_pre()
69 state[11] = IV[3]; in compress_pre()
70 state[12] = counter_low(counter); in compress_pre()
71 state[13] = counter_high(counter); in compress_pre()
72 state[14] = (uint32_t)block_len; in compress_pre()
73 state[15] = (uint32_t)flags; in compress_pre()
75 round_fn(state, &block_words[0], 0); in compress_pre()
76 round_fn(state, &block_words[0], 1); in compress_pre()
77 round_fn(state, &block_words[0], 2); in compress_pre()
78 round_fn(state, &block_words[0], 3); in compress_pre()
79 round_fn(state, &block_words[0], 4); in compress_pre()
80 round_fn(state, &block_words[0], 5); in compress_pre()
81 round_fn(state, &block_words[0], 6); in compress_pre()
88 uint32_t state[16]; in blake3_compress_in_place_portable() local
89 compress_pre(state, cv, block, block_len, counter, flags); in blake3_compress_in_place_portable()
90 cv[0] = state[0] ^ state[8]; in blake3_compress_in_place_portable()
91 cv[1] = state[1] ^ state[9]; in blake3_compress_in_place_portable()
92 cv[2] = state[2] ^ state[10]; in blake3_compress_in_place_portable()
93 cv[3] = state[3] ^ state[11]; in blake3_compress_in_place_portable()
94 cv[4] = state[4] ^ state[12]; in blake3_compress_in_place_portable()
95 cv[5] = state[5] ^ state[13]; in blake3_compress_in_place_portable()
96 cv[6] = state[6] ^ state[14]; in blake3_compress_in_place_portable()
97 cv[7] = state[7] ^ state[15]; in blake3_compress_in_place_portable()
104 uint32_t state[16]; in blake3_compress_xof_portable() local
105 compress_pre(state, cv, block, block_len, counter, flags); in blake3_compress_xof_portable()
107 store32(&out[0 * 4], state[0] ^ state[8]); in blake3_compress_xof_portable()
108 store32(&out[1 * 4], state[1] ^ state[9]); in blake3_compress_xof_portable()
109 store32(&out[2 * 4], state[2] ^ state[10]); in blake3_compress_xof_portable()
110 store32(&out[3 * 4], state[3] ^ state[11]); in blake3_compress_xof_portable()
111 store32(&out[4 * 4], state[4] ^ state[12]); in blake3_compress_xof_portable()
112 store32(&out[5 * 4], state[5] ^ state[13]); in blake3_compress_xof_portable()
113 store32(&out[6 * 4], state[6] ^ state[14]); in blake3_compress_xof_portable()
114 store32(&out[7 * 4], state[7] ^ state[15]); in blake3_compress_xof_portable()
115 store32(&out[8 * 4], state[8] ^ cv[0]); in blake3_compress_xof_portable()
116 store32(&out[9 * 4], state[9] ^ cv[1]); in blake3_compress_xof_portable()
117 store32(&out[10 * 4], state[10] ^ cv[2]); in blake3_compress_xof_portable()
118 store32(&out[11 * 4], state[11] ^ cv[3]); in blake3_compress_xof_portable()
119 store32(&out[12 * 4], state[12] ^ cv[4]); in blake3_compress_xof_portable()
120 store32(&out[13 * 4], state[13] ^ cv[5]); in blake3_compress_xof_portable()
121 store32(&out[14 * 4], state[14] ^ cv[6]); in blake3_compress_xof_portable()
122 store32(&out[15 * 4], state[15] ^ cv[7]); in blake3_compress_xof_portable()