Lines Matching defs:iv
250 int len, unsigned char *iv, const aes_encrypt_ctx ctx[1])
259 { uint_8t *ksp = (uint_8t*)(ctx->ks), *ivp = iv;
266 if(addr_mod_16(iv)) /* ensure an aligned iv */
269 memcpy(liv, iv, AES_BLOCK_SIZE);
272 if(!addr_mod_16(ibuf) && !addr_mod_16(obuf) && !addr_mod_16(iv))
301 if(iv != ivp)
302 memcpy(iv, ivp, AES_BLOCK_SIZE);
311 if(!addr_mod_04(ibuf) && !addr_mod_04(iv))
314 lp32(iv)[0] ^= lp32(ibuf)[0];
315 lp32(iv)[1] ^= lp32(ibuf)[1];
316 lp32(iv)[2] ^= lp32(ibuf)[2];
317 lp32(iv)[3] ^= lp32(ibuf)[3];
318 aes_encrypt(iv, iv, ctx);
319 memcpy(obuf, iv, AES_BLOCK_SIZE);
327 iv[ 0] ^= ibuf[ 0]; iv[ 1] ^= ibuf[ 1];
328 iv[ 2] ^= ibuf[ 2]; iv[ 3] ^= ibuf[ 3];
329 iv[ 4] ^= ibuf[ 4]; iv[ 5] ^= ibuf[ 5];
330 iv[ 6] ^= ibuf[ 6]; iv[ 7] ^= ibuf[ 7];
331 iv[ 8] ^= ibuf[ 8]; iv[ 9] ^= ibuf[ 9];
332 iv[10] ^= ibuf[10]; iv[11] ^= ibuf[11];
333 iv[12] ^= ibuf[12]; iv[13] ^= ibuf[13];
334 iv[14] ^= ibuf[14]; iv[15] ^= ibuf[15];
335 aes_encrypt(iv, iv, ctx);
336 memcpy(obuf, iv, AES_BLOCK_SIZE);
358 int len, unsigned char *iv, const aes_decrypt_ctx ctx[1])
368 { uint_8t *ksp = kd_adr(ctx), *ivp = iv;
375 if(addr_mod_16(iv)) /* ensure an aligned iv */
378 memcpy(liv, iv, AES_BLOCK_SIZE);
381 if(!addr_mod_16(ibuf) && !addr_mod_16(obuf) && !addr_mod_16(iv))
410 if(iv != ivp)
411 memcpy(iv, ivp, AES_BLOCK_SIZE);
419 if(!addr_mod_04(obuf) && !addr_mod_04(iv))
424 lp32(obuf)[0] ^= lp32(iv)[0];
425 lp32(obuf)[1] ^= lp32(iv)[1];
426 lp32(obuf)[2] ^= lp32(iv)[2];
427 lp32(obuf)[3] ^= lp32(iv)[3];
428 memcpy(iv, tmp, AES_BLOCK_SIZE);
438 obuf[ 0] ^= iv[ 0]; obuf[ 1] ^= iv[ 1];
439 obuf[ 2] ^= iv[ 2]; obuf[ 3] ^= iv[ 3];
440 obuf[ 4] ^= iv[ 4]; obuf[ 5] ^= iv[ 5];
441 obuf[ 6] ^= iv[ 6]; obuf[ 7] ^= iv[ 7];
442 obuf[ 8] ^= iv[ 8]; obuf[ 9] ^= iv[ 9];
443 obuf[10] ^= iv[10]; obuf[11] ^= iv[11];
444 obuf[12] ^= iv[12]; obuf[13] ^= iv[13];
445 obuf[14] ^= iv[14]; obuf[15] ^= iv[15];
446 memcpy(iv, tmp, AES_BLOCK_SIZE);