mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 21:38:32 +08:00
crypto: ccree - remove bitlocker cipher
Remove the bitlocker cipher which is not supported by the kernel. Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
a93492cae3
commit
1d8b41ff69
@ -75,8 +75,7 @@ static int validate_keys_sizes(struct cc_cipher_ctx *ctx_p, u32 size)
|
||||
switch (size) {
|
||||
case CC_AES_128_BIT_KEY_SIZE:
|
||||
case CC_AES_192_BIT_KEY_SIZE:
|
||||
if (ctx_p->cipher_mode != DRV_CIPHER_XTS &&
|
||||
ctx_p->cipher_mode != DRV_CIPHER_BITLOCKER)
|
||||
if (ctx_p->cipher_mode != DRV_CIPHER_XTS)
|
||||
return 0;
|
||||
break;
|
||||
case CC_AES_256_BIT_KEY_SIZE:
|
||||
@ -84,8 +83,7 @@ static int validate_keys_sizes(struct cc_cipher_ctx *ctx_p, u32 size)
|
||||
case (CC_AES_192_BIT_KEY_SIZE * 2):
|
||||
case (CC_AES_256_BIT_KEY_SIZE * 2):
|
||||
if (ctx_p->cipher_mode == DRV_CIPHER_XTS ||
|
||||
ctx_p->cipher_mode == DRV_CIPHER_ESSIV ||
|
||||
ctx_p->cipher_mode == DRV_CIPHER_BITLOCKER)
|
||||
ctx_p->cipher_mode == DRV_CIPHER_ESSIV)
|
||||
return 0;
|
||||
break;
|
||||
default:
|
||||
@ -122,7 +120,6 @@ static int validate_data_size(struct cc_cipher_ctx *ctx_p,
|
||||
case DRV_CIPHER_ECB:
|
||||
case DRV_CIPHER_CBC:
|
||||
case DRV_CIPHER_ESSIV:
|
||||
case DRV_CIPHER_BITLOCKER:
|
||||
if (IS_ALIGNED(size, AES_BLOCK_SIZE))
|
||||
return 0;
|
||||
break;
|
||||
@ -348,8 +345,7 @@ static int cc_cipher_sethkey(struct crypto_skcipher *sktfm, const u8 *key,
|
||||
}
|
||||
|
||||
if (ctx_p->cipher_mode == DRV_CIPHER_XTS ||
|
||||
ctx_p->cipher_mode == DRV_CIPHER_ESSIV ||
|
||||
ctx_p->cipher_mode == DRV_CIPHER_BITLOCKER) {
|
||||
ctx_p->cipher_mode == DRV_CIPHER_ESSIV) {
|
||||
if (hki.hw_key1 == hki.hw_key2) {
|
||||
dev_err(dev, "Illegal hw key numbers (%d,%d)\n",
|
||||
hki.hw_key1, hki.hw_key2);
|
||||
@ -547,7 +543,6 @@ static void cc_setup_readiv_desc(struct crypto_tfm *tfm,
|
||||
break;
|
||||
case DRV_CIPHER_XTS:
|
||||
case DRV_CIPHER_ESSIV:
|
||||
case DRV_CIPHER_BITLOCKER:
|
||||
/* IV */
|
||||
hw_desc_init(&desc[*seq_size]);
|
||||
set_setup_mode(&desc[*seq_size], SETUP_WRITE_STATE1);
|
||||
@ -602,7 +597,6 @@ static void cc_setup_state_desc(struct crypto_tfm *tfm,
|
||||
break;
|
||||
case DRV_CIPHER_XTS:
|
||||
case DRV_CIPHER_ESSIV:
|
||||
case DRV_CIPHER_BITLOCKER:
|
||||
break;
|
||||
default:
|
||||
dev_err(dev, "Unsupported cipher mode (%d)\n", cipher_mode);
|
||||
@ -636,7 +630,6 @@ static void cc_setup_xex_state_desc(struct crypto_tfm *tfm,
|
||||
break;
|
||||
case DRV_CIPHER_XTS:
|
||||
case DRV_CIPHER_ESSIV:
|
||||
case DRV_CIPHER_BITLOCKER:
|
||||
|
||||
if (cipher_mode == DRV_CIPHER_ESSIV)
|
||||
key_len = SHA256_DIGEST_SIZE;
|
||||
@ -750,7 +743,6 @@ static void cc_setup_key_desc(struct crypto_tfm *tfm,
|
||||
break;
|
||||
case DRV_CIPHER_XTS:
|
||||
case DRV_CIPHER_ESSIV:
|
||||
case DRV_CIPHER_BITLOCKER:
|
||||
/* Load AES key */
|
||||
hw_desc_init(&desc[*seq_size]);
|
||||
set_cipher_mode(&desc[*seq_size], cipher_mode);
|
||||
@ -1048,24 +1040,6 @@ static const struct cc_alg_template skcipher_algs[] = {
|
||||
.std_body = CC_STD_NIST,
|
||||
.sec_func = true,
|
||||
},
|
||||
{
|
||||
.name = "bitlocker(paes)",
|
||||
.driver_name = "bitlocker-paes-ccree",
|
||||
.blocksize = AES_BLOCK_SIZE,
|
||||
.template_skcipher = {
|
||||
.setkey = cc_cipher_sethkey,
|
||||
.encrypt = cc_cipher_encrypt,
|
||||
.decrypt = cc_cipher_decrypt,
|
||||
.min_keysize = CC_HW_KEY_SIZE,
|
||||
.max_keysize = CC_HW_KEY_SIZE,
|
||||
.ivsize = AES_BLOCK_SIZE,
|
||||
},
|
||||
.cipher_mode = DRV_CIPHER_BITLOCKER,
|
||||
.flow_mode = S_DIN_to_AES,
|
||||
.min_hw_rev = CC_HW_REV_712,
|
||||
.std_body = CC_STD_NIST,
|
||||
.sec_func = true,
|
||||
},
|
||||
{
|
||||
.name = "ecb(paes)",
|
||||
.driver_name = "ecb-paes-ccree",
|
||||
@ -1194,23 +1168,6 @@ static const struct cc_alg_template skcipher_algs[] = {
|
||||
.min_hw_rev = CC_HW_REV_712,
|
||||
.std_body = CC_STD_NIST,
|
||||
},
|
||||
{
|
||||
.name = "bitlocker(aes)",
|
||||
.driver_name = "bitlocker-aes-ccree",
|
||||
.blocksize = AES_BLOCK_SIZE,
|
||||
.template_skcipher = {
|
||||
.setkey = cc_cipher_setkey,
|
||||
.encrypt = cc_cipher_encrypt,
|
||||
.decrypt = cc_cipher_decrypt,
|
||||
.min_keysize = AES_MIN_KEY_SIZE * 2,
|
||||
.max_keysize = AES_MAX_KEY_SIZE * 2,
|
||||
.ivsize = AES_BLOCK_SIZE,
|
||||
},
|
||||
.cipher_mode = DRV_CIPHER_BITLOCKER,
|
||||
.flow_mode = S_DIN_to_AES,
|
||||
.min_hw_rev = CC_HW_REV_712,
|
||||
.std_body = CC_STD_NIST,
|
||||
},
|
||||
{
|
||||
.name = "ecb(aes)",
|
||||
.driver_name = "ecb-aes-ccree",
|
||||
|
@ -108,7 +108,6 @@ enum drv_cipher_mode {
|
||||
DRV_CIPHER_CBC_CTS = 11,
|
||||
DRV_CIPHER_GCTR = 12,
|
||||
DRV_CIPHER_ESSIV = 13,
|
||||
DRV_CIPHER_BITLOCKER = 14,
|
||||
DRV_CIPHER_RESERVE32B = S32_MAX
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user