Lines Matching refs:obuf
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);
156 op = (addr_mod_16(obuf) ? buf : obuf);
163 if(op != obuf)
164 memcpy(obuf, buf, m * AES_BLOCK_SIZE);
167 obuf += m * AES_BLOCK_SIZE;
180 aes_encrypt(ibuf, obuf, ctx);
182 obuf += 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);
217 op = (addr_mod_16(obuf) ? buf : obuf);
224 if(op != obuf)
225 memcpy(obuf, buf, m * AES_BLOCK_SIZE);
228 obuf += m * AES_BLOCK_SIZE;
241 aes_decrypt(ibuf, obuf, ctx);
243 obuf += 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);
285 op = (addr_mod_16(obuf) ? buf : obuf);
292 if(op != obuf)
293 memcpy(obuf, buf, m * AES_BLOCK_SIZE);
296 obuf += m * AES_BLOCK_SIZE;
319 memcpy(obuf, iv, AES_BLOCK_SIZE);
321 obuf += AES_BLOCK_SIZE;
336 memcpy(obuf, iv, AES_BLOCK_SIZE);
338 obuf += 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);
394 op = (addr_mod_16(obuf) ? buf : obuf);
401 if(op != obuf)
402 memcpy(obuf, buf, m * AES_BLOCK_SIZE);
405 obuf += m * AES_BLOCK_SIZE;
419 if(!addr_mod_04(obuf) && !addr_mod_04(iv))
423 aes_decrypt(ibuf, obuf, ctx);
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];
430 obuf += AES_BLOCK_SIZE;
437 aes_decrypt(ibuf, obuf, ctx);
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];
448 obuf += AES_BLOCK_SIZE;