Lines Matching refs:tcw

174 		struct iv_tcw_private tcw;  member
573 struct iv_tcw_private *tcw = &cc->iv_gen_private.tcw; in crypt_iv_tcw_dtr() local
575 kfree_sensitive(tcw->iv_seed); in crypt_iv_tcw_dtr()
576 tcw->iv_seed = NULL; in crypt_iv_tcw_dtr()
577 kfree_sensitive(tcw->whitening); in crypt_iv_tcw_dtr()
578 tcw->whitening = NULL; in crypt_iv_tcw_dtr()
580 if (tcw->crc32_tfm && !IS_ERR(tcw->crc32_tfm)) in crypt_iv_tcw_dtr()
581 crypto_free_shash(tcw->crc32_tfm); in crypt_iv_tcw_dtr()
582 tcw->crc32_tfm = NULL; in crypt_iv_tcw_dtr()
588 struct iv_tcw_private *tcw = &cc->iv_gen_private.tcw; in crypt_iv_tcw_ctr() local
600 tcw->crc32_tfm = crypto_alloc_shash("crc32", 0, in crypt_iv_tcw_ctr()
602 if (IS_ERR(tcw->crc32_tfm)) { in crypt_iv_tcw_ctr()
604 return PTR_ERR(tcw->crc32_tfm); in crypt_iv_tcw_ctr()
607 tcw->iv_seed = kzalloc(cc->iv_size, GFP_KERNEL); in crypt_iv_tcw_ctr()
608 tcw->whitening = kzalloc(TCW_WHITENING_SIZE, GFP_KERNEL); in crypt_iv_tcw_ctr()
609 if (!tcw->iv_seed || !tcw->whitening) { in crypt_iv_tcw_ctr()
620 struct iv_tcw_private *tcw = &cc->iv_gen_private.tcw; in crypt_iv_tcw_init() local
623 memcpy(tcw->iv_seed, &cc->key[key_offset], cc->iv_size); in crypt_iv_tcw_init()
624 memcpy(tcw->whitening, &cc->key[key_offset + cc->iv_size], in crypt_iv_tcw_init()
632 struct iv_tcw_private *tcw = &cc->iv_gen_private.tcw; in crypt_iv_tcw_wipe() local
634 memset(tcw->iv_seed, 0, cc->iv_size); in crypt_iv_tcw_wipe()
635 memset(tcw->whitening, 0, TCW_WHITENING_SIZE); in crypt_iv_tcw_wipe()
644 struct iv_tcw_private *tcw = &cc->iv_gen_private.tcw; in crypt_iv_tcw_whitening() local
647 SHASH_DESC_ON_STACK(desc, tcw->crc32_tfm); in crypt_iv_tcw_whitening()
651 crypto_xor_cpy(buf, tcw->whitening, (u8 *)&sector, 8); in crypt_iv_tcw_whitening()
652 crypto_xor_cpy(&buf[8], tcw->whitening + 8, (u8 *)&sector, 8); in crypt_iv_tcw_whitening()
655 desc->tfm = tcw->crc32_tfm; in crypt_iv_tcw_whitening()
682 struct iv_tcw_private *tcw = &cc->iv_gen_private.tcw; in crypt_iv_tcw_gen() local
696 crypto_xor_cpy(iv, tcw->iv_seed, (u8 *)&sector, 8); in crypt_iv_tcw_gen()
698 crypto_xor_cpy(&iv[8], tcw->iv_seed + 8, (u8 *)&sector, in crypt_iv_tcw_gen()