Lines Matching refs:BELT_BLOCK_LEN
117 void belt_encrypt(const u8 in[BELT_BLOCK_LEN], u8 out[BELT_BLOCK_LEN], const u8 ks[BELT_KEY_SCHED_L… in belt_encrypt() argument
158 void belt_decrypt(const u8 in[BELT_BLOCK_LEN], u8 out[BELT_BLOCK_LEN], const u8 ks[BELT_KEY_SCHED_L… in belt_decrypt() argument
201 static void sigma1_xor(const u8 x[2 * BELT_BLOCK_LEN], const u8 h[2 * BELT_BLOCK_LEN], u8 s[BELT_BL… in sigma1_xor() argument
202 u8 tmp1[BELT_BLOCK_LEN]; in sigma1_xor()
205 for(i = 0; i < (BELT_BLOCK_LEN / 2); i++){ in sigma1_xor()
206 tmp1[i] = (h[i] ^ h[i + BELT_BLOCK_LEN]); in sigma1_xor()
207 …tmp1[i + (BELT_BLOCK_LEN / 2)] = (h[i + (BELT_BLOCK_LEN / 2)] ^ h[i + BELT_BLOCK_LEN + (BELT_BLOCK… in sigma1_xor()
211 u8 tmp2[BELT_BLOCK_LEN]; in sigma1_xor()
215 for(i = 0; i < (BELT_BLOCK_LEN / 2); i++){ in sigma1_xor()
217 s[i + (BELT_BLOCK_LEN / 2)] ^= (tmp1[i + (BELT_BLOCK_LEN / 2)] ^ tmp2[i + (BELT_BLOCK_LEN / 2)]); in sigma1_xor()
222 for(i = 0; i < (BELT_BLOCK_LEN / 2); i++){ in sigma1_xor()
224 s[i + (BELT_BLOCK_LEN / 2)] ^= tmp1[i + (BELT_BLOCK_LEN / 2)]; in sigma1_xor()
231 static void sigma2(const u8 x[2 * BELT_BLOCK_LEN], u8 const h[2 * BELT_BLOCK_LEN], u8 result[2 * BE… in sigma2() argument
234 u8 tmp[BELT_BLOCK_LEN]; in sigma2()
238 IGNORE_RET_VAL(local_memcpy(&tmp[0], &h[0], BELT_BLOCK_LEN)); in sigma2()
241 IGNORE_RET_VAL(local_memcpy(&teta[BELT_BLOCK_LEN], &h[BELT_BLOCK_LEN], BELT_BLOCK_LEN)); in sigma2()
244 for(i = 0; i < BELT_BLOCK_LEN; i++){ in sigma2()
247 teta[i + BELT_BLOCK_LEN] = tmp[i]; in sigma2()
250 belt_encrypt(&x[BELT_BLOCK_LEN], &result[BELT_BLOCK_LEN], teta); in sigma2()
252 for(i = 0; i < (BELT_BLOCK_LEN / 2); i++){ in sigma2()
253 result[i + BELT_BLOCK_LEN] ^= x[i + BELT_BLOCK_LEN]; in sigma2()
254 result[i + BELT_BLOCK_LEN + (BELT_BLOCK_LEN / 2)] ^= x[i + BELT_BLOCK_LEN + (BELT_BLOCK_LEN / 2)]; in sigma2()
260 …tatic void _belt_hash_process(const u8 x[2 * BELT_BLOCK_LEN], u8 h[2 * BELT_BLOCK_LEN], u8 s[BELT_… in _belt_hash_process() argument
271 _belt_hash_process(data, ctx->belt_hash_h, &(ctx->belt_hash_state[BELT_BLOCK_LEN])); in belt_hash_process()
276 … int belt_hash_finalize(const u8 s[2 * BELT_BLOCK_LEN], const u8 h[2 * BELT_BLOCK_LEN], u8 res[2 *… in belt_hash_finalize() argument