• Home
  • Raw
  • Download

Lines Matching refs:cdata

324     struct padlock_cipher_data *cdata = ALIGNED_CIPHER_DATA(ctx);  in padlock_cbc_cipher()  local
327 memcpy(cdata->iv, EVP_CIPHER_CTX_iv(ctx), AES_BLOCK_SIZE); in padlock_cbc_cipher()
328 if ((ret = padlock_cbc_encrypt(out_arg, in_arg, cdata, nbytes))) in padlock_cbc_cipher()
329 memcpy(EVP_CIPHER_CTX_iv_noconst(ctx), cdata->iv, AES_BLOCK_SIZE); in padlock_cbc_cipher()
337 struct padlock_cipher_data *cdata = ALIGNED_CIPHER_DATA(ctx); in padlock_cfb_cipher() local
363 memcpy(cdata->iv, EVP_CIPHER_CTX_iv(ctx), AES_BLOCK_SIZE); in padlock_cfb_cipher()
366 if (!padlock_cfb_encrypt(out_arg, in_arg, cdata, chunk)) in padlock_cfb_cipher()
372 unsigned char *ivp = cdata->iv; in padlock_cfb_cipher()
377 if (cdata->cword.b.encdec) { in padlock_cfb_cipher()
378 cdata->cword.b.encdec = 0; in padlock_cfb_cipher()
380 padlock_aes_block(ivp, ivp, cdata); in padlock_cfb_cipher()
381 cdata->cword.b.encdec = 1; in padlock_cfb_cipher()
390 padlock_aes_block(ivp, ivp, cdata); in padlock_cfb_cipher()
399 memcpy(EVP_CIPHER_CTX_iv_noconst(ctx), cdata->iv, AES_BLOCK_SIZE); in padlock_cfb_cipher()
408 struct padlock_cipher_data *cdata = ALIGNED_CIPHER_DATA(ctx); in padlock_ofb_cipher() local
431 memcpy(cdata->iv, EVP_CIPHER_CTX_iv(ctx), AES_BLOCK_SIZE); in padlock_ofb_cipher()
434 if (!padlock_ofb_encrypt(out_arg, in_arg, cdata, chunk)) in padlock_ofb_cipher()
440 unsigned char *ivp = cdata->iv; in padlock_ofb_cipher()
446 padlock_aes_block(ivp, ivp, cdata); in padlock_ofb_cipher()
454 memcpy(EVP_CIPHER_CTX_iv_noconst(ctx), cdata->iv, AES_BLOCK_SIZE); in padlock_ofb_cipher()
472 struct padlock_cipher_data *cdata = ALIGNED_CIPHER_DATA(ctx); in padlock_ctr_cipher() local
481 cdata, EVP_CIPHER_CTX_iv_noconst(ctx), in padlock_ctr_cipher()
620 struct padlock_cipher_data *cdata; in padlock_aes_init_key() local
627 cdata = ALIGNED_CIPHER_DATA(ctx); in padlock_aes_init_key()
628 memset(cdata, 0, sizeof(*cdata)); in padlock_aes_init_key()
632 cdata->cword.b.encdec = 0; in padlock_aes_init_key()
634 cdata->cword.b.encdec = (EVP_CIPHER_CTX_is_encrypting(ctx) == 0); in padlock_aes_init_key()
635 cdata->cword.b.rounds = 10 + (key_len - 128) / 32; in padlock_aes_init_key()
636 cdata->cword.b.ksize = (key_len - 128) / 64; in padlock_aes_init_key()
643 memcpy(cdata->ks.rd_key, key, AES_KEY_SIZE_128); in padlock_aes_init_key()
644 cdata->cword.b.keygen = 0; in padlock_aes_init_key()
659 AES_set_decrypt_key(key, key_len, &cdata->ks); in padlock_aes_init_key()
661 AES_set_encrypt_key(key, key_len, &cdata->ks); in padlock_aes_init_key()
665 padlock_key_bswap(&cdata->ks); in padlock_aes_init_key()
666 cdata->cword.b.keygen = 1; in padlock_aes_init_key()