Lines Matching refs:sha3
80 XMEMSET(&md->sha3, 0, sizeof(md->sha3)); in sha3_224_init()
81 md->sha3.capacity_words = 2 * 224 / (8 * sizeof(ulong64)); in sha3_224_init()
88 XMEMSET(&md->sha3, 0, sizeof(md->sha3)); in sha3_256_init()
89 md->sha3.capacity_words = 2 * 256 / (8 * sizeof(ulong64)); in sha3_256_init()
96 XMEMSET(&md->sha3, 0, sizeof(md->sha3)); in sha3_384_init()
97 md->sha3.capacity_words = 2 * 384 / (8 * sizeof(ulong64)); in sha3_384_init()
104 XMEMSET(&md->sha3, 0, sizeof(md->sha3)); in sha3_512_init()
105 md->sha3.capacity_words = 2 * 512 / (8 * sizeof(ulong64)); in sha3_512_init()
113 XMEMSET(&md->sha3, 0, sizeof(md->sha3)); in sha3_shake_init()
114 md->sha3.capacity_words = (unsigned short)(2 * num / (8 * sizeof(ulong64))); in sha3_shake_init()
131 block_size = 200 - md->sha3.capacity_words * 8; in sha3_process()
132 digest_size = md->sha3.capacity_words * 8 / 2; in sha3_process()
133 state = md->sha3.s; in sha3_process()
135 if (md->sha3.byte_index) { in sha3_process()
136 l = MIN(block_size - md->sha3.byte_index, inlen); in sha3_process()
137 memcpy(md->sha3.sb + md->sha3.byte_index, in, l); in sha3_process()
140 md->sha3.byte_index += l; in sha3_process()
141 if (md->sha3.byte_index == block_size) { in sha3_process()
142 crypto_accel_sha3_compress(state, md->sha3.sb, 1, in sha3_process()
144 md->sha3.byte_index = 0; in sha3_process()
159 memcpy(md->sha3.sb + md->sha3.byte_index, in, inlen); in sha3_process()
160 md->sha3.byte_index += inlen; in sha3_process()
189 block_size = 200 - md->sha3.capacity_words * 8; in sha3_done()
190 digest_size = md->sha3.capacity_words * 8 / 2; in sha3_done()
191 state = md->sha3.s; in sha3_done()
192 buf = md->sha3.sb; in sha3_done()
194 buf[md->sha3.byte_index++] = 0x06; in sha3_done()
195 memset(buf + md->sha3.byte_index, 0, block_size - md->sha3.byte_index); in sha3_done()
216 block_size = 200 - md->sha3.capacity_words * 8; in sha3_shake_done()
217 digest_size = md->sha3.capacity_words * 8 / 2; in sha3_shake_done()
218 state = md->sha3.s; in sha3_shake_done()
219 buf = md->sha3.sb; in sha3_shake_done()
221 if (!md->sha3.xof_flag) { in sha3_shake_done()
222 buf[md->sha3.byte_index++] = 0x1f; in sha3_shake_done()
223 memset(buf + md->sha3.byte_index, 0, in sha3_shake_done()
224 block_size - md->sha3.byte_index); in sha3_shake_done()
227 md->sha3.byte_index = 0; in sha3_shake_done()
229 md->sha3.xof_flag = 1; in sha3_shake_done()
233 if (md->sha3.byte_index >= block_size) { in sha3_shake_done()
236 md->sha3.byte_index = 0; in sha3_shake_done()
239 out[n] = buf[md->sha3.byte_index]; in sha3_shake_done()
240 md->sha3.byte_index++; in sha3_shake_done()