Lines Matching full:state
33 static inline void g(uint32_t *state, size_t a, size_t b, size_t c, size_t d, in g() argument
36 state[a] = state[a] + state[b] + x; in g()
37 state[d] = rotr32(state[d] ^ state[a], 16); in g()
38 state[c] = state[c] + state[d]; in g()
39 state[b] = rotr32(state[b] ^ state[c], 12); in g()
40 state[a] = state[a] + state[b] + y; in g()
41 state[d] = rotr32(state[d] ^ state[a], 8); in g()
42 state[c] = state[c] + state[d]; in g()
43 state[b] = rotr32(state[b] ^ state[c], 7); in g()
46 static inline void round_fn(uint32_t state[16], const uint32_t *msg, in round_fn()
53 g(state, 0, 4, 8, 12, msg[schedule[0]], msg[schedule[1]]); in round_fn()
54 g(state, 1, 5, 9, 13, msg[schedule[2]], msg[schedule[3]]); in round_fn()
55 g(state, 2, 6, 10, 14, msg[schedule[4]], msg[schedule[5]]); in round_fn()
56 g(state, 3, 7, 11, 15, msg[schedule[6]], msg[schedule[7]]); in round_fn()
59 g(state, 0, 5, 10, 15, msg[schedule[8]], msg[schedule[9]]); in round_fn()
60 g(state, 1, 6, 11, 12, msg[schedule[10]], msg[schedule[11]]); in round_fn()
61 g(state, 2, 7, 8, 13, msg[schedule[12]], msg[schedule[13]]); in round_fn()
62 g(state, 3, 4, 9, 14, msg[schedule[14]], msg[schedule[15]]); in round_fn()
65 static inline void compress_pre(uint32_t state[16], const uint32_t cv[8], in compress_pre()
87 state[0] = cv[0]; in compress_pre()
88 state[1] = cv[1]; in compress_pre()
89 state[2] = cv[2]; in compress_pre()
90 state[3] = cv[3]; in compress_pre()
91 state[4] = cv[4]; in compress_pre()
92 state[5] = cv[5]; in compress_pre()
93 state[6] = cv[6]; in compress_pre()
94 state[7] = cv[7]; in compress_pre()
95 state[8] = BLAKE3_IV[0]; in compress_pre()
96 state[9] = BLAKE3_IV[1]; in compress_pre()
97 state[10] = BLAKE3_IV[2]; in compress_pre()
98 state[11] = BLAKE3_IV[3]; in compress_pre()
99 state[12] = counter_low(counter); in compress_pre()
100 state[13] = counter_high(counter); in compress_pre()
101 state[14] = (uint32_t)block_len; in compress_pre()
102 state[15] = (uint32_t)flags; in compress_pre()
104 round_fn(state, &block_words[0], 0); in compress_pre()
105 round_fn(state, &block_words[0], 1); in compress_pre()
106 round_fn(state, &block_words[0], 2); in compress_pre()
107 round_fn(state, &block_words[0], 3); in compress_pre()
108 round_fn(state, &block_words[0], 4); in compress_pre()
109 round_fn(state, &block_words[0], 5); in compress_pre()
110 round_fn(state, &block_words[0], 6); in compress_pre()
117 uint32_t state[16]; in blake3_compress_in_place_generic() local
118 compress_pre(state, cv, block, block_len, counter, flags); in blake3_compress_in_place_generic()
119 cv[0] = state[0] ^ state[8]; in blake3_compress_in_place_generic()
120 cv[1] = state[1] ^ state[9]; in blake3_compress_in_place_generic()
121 cv[2] = state[2] ^ state[10]; in blake3_compress_in_place_generic()
122 cv[3] = state[3] ^ state[11]; in blake3_compress_in_place_generic()
123 cv[4] = state[4] ^ state[12]; in blake3_compress_in_place_generic()
124 cv[5] = state[5] ^ state[13]; in blake3_compress_in_place_generic()
125 cv[6] = state[6] ^ state[14]; in blake3_compress_in_place_generic()
126 cv[7] = state[7] ^ state[15]; in blake3_compress_in_place_generic()
153 uint32_t state[16]; in blake3_compress_xof_generic() local
154 compress_pre(state, cv, block, block_len, counter, flags); in blake3_compress_xof_generic()
156 store32(&out[0 * 4], state[0] ^ state[8]); in blake3_compress_xof_generic()
157 store32(&out[1 * 4], state[1] ^ state[9]); in blake3_compress_xof_generic()
158 store32(&out[2 * 4], state[2] ^ state[10]); in blake3_compress_xof_generic()
159 store32(&out[3 * 4], state[3] ^ state[11]); in blake3_compress_xof_generic()
160 store32(&out[4 * 4], state[4] ^ state[12]); in blake3_compress_xof_generic()
161 store32(&out[5 * 4], state[5] ^ state[13]); in blake3_compress_xof_generic()
162 store32(&out[6 * 4], state[6] ^ state[14]); in blake3_compress_xof_generic()
163 store32(&out[7 * 4], state[7] ^ state[15]); in blake3_compress_xof_generic()
164 store32(&out[8 * 4], state[8] ^ cv[0]); in blake3_compress_xof_generic()
165 store32(&out[9 * 4], state[9] ^ cv[1]); in blake3_compress_xof_generic()
166 store32(&out[10 * 4], state[10] ^ cv[2]); in blake3_compress_xof_generic()
167 store32(&out[11 * 4], state[11] ^ cv[3]); in blake3_compress_xof_generic()
168 store32(&out[12 * 4], state[12] ^ cv[4]); in blake3_compress_xof_generic()
169 store32(&out[13 * 4], state[13] ^ cv[5]); in blake3_compress_xof_generic()
170 store32(&out[14 * 4], state[14] ^ cv[6]); in blake3_compress_xof_generic()
171 store32(&out[15 * 4], state[15] ^ cv[7]); in blake3_compress_xof_generic()