Lines Matching refs:ibuf
127 aes_rval aes_ecb_encrypt(const unsigned char *ibuf, unsigned char *obuf,
143 if(!addr_mod_16(ibuf) && !addr_mod_16(obuf))
145 via_ecb_op5(ksp,cwd,ibuf,obuf,nb);
155 ip = (addr_mod_16(ibuf) ? buf : (uint_8t*)ibuf);
158 if(ip != ibuf)
159 memcpy(buf, ibuf, m * AES_BLOCK_SIZE);
166 ibuf += m * AES_BLOCK_SIZE;
180 aes_encrypt(ibuf, obuf, ctx);
181 ibuf += AES_BLOCK_SIZE;
188 aes_rval aes_ecb_decrypt(const unsigned char *ibuf, unsigned char *obuf,
204 if(!addr_mod_16(ibuf) && !addr_mod_16(obuf))
206 via_ecb_op5(ksp,cwd,ibuf,obuf,nb);
216 ip = (addr_mod_16(ibuf) ? buf : (uint_8t*)ibuf);
219 if(ip != ibuf)
220 memcpy(buf, ibuf, m * AES_BLOCK_SIZE);
227 ibuf += m * AES_BLOCK_SIZE;
241 aes_decrypt(ibuf, obuf, ctx);
242 ibuf += AES_BLOCK_SIZE;
249 aes_rval aes_cbc_encrypt(const unsigned char *ibuf, unsigned char *obuf,
272 if(!addr_mod_16(ibuf) && !addr_mod_16(obuf) && !addr_mod_16(iv))
274 via_cbc_op7(ksp,cwd,ibuf,obuf,nb,ivp,ivp);
284 ip = (addr_mod_16(ibuf) ? buf : (uint_8t*)ibuf);
287 if(ip != ibuf)
288 memcpy(buf, ibuf, m * AES_BLOCK_SIZE);
295 ibuf += m * 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];
320 ibuf += 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];
337 ibuf += AES_BLOCK_SIZE;
357 aes_rval aes_cbc_decrypt(const unsigned char *ibuf, unsigned char *obuf,
381 if(!addr_mod_16(ibuf) && !addr_mod_16(obuf) && !addr_mod_16(iv))
383 via_cbc_op6(ksp,cwd,ibuf,obuf,nb,ivp);
393 ip = (addr_mod_16(ibuf) ? buf : (uint_8t*)ibuf);
396 if(ip != ibuf)
397 memcpy(buf, ibuf, m * AES_BLOCK_SIZE);
404 ibuf += m * AES_BLOCK_SIZE;
422 memcpy(tmp, ibuf, AES_BLOCK_SIZE);
423 aes_decrypt(ibuf, obuf, ctx);
429 ibuf += AES_BLOCK_SIZE;
436 memcpy(tmp, ibuf, AES_BLOCK_SIZE);
437 aes_decrypt(ibuf, obuf, ctx);
447 ibuf += AES_BLOCK_SIZE;