mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-25 01:40:53 +07:00
crypto: sparc/aes - convert to skcipher API
Convert the glue code for the SPARC64 AES opcodes implementations of AES-ECB, AES-CBC, and AES-CTR from the deprecated "blkcipher" API to the "skcipher" API. This is needed in order for the blkcipher API to be removed. Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
fcf801cc55
commit
64db5e7439
@ -24,6 +24,7 @@
|
|||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
#include <crypto/algapi.h>
|
#include <crypto/algapi.h>
|
||||||
#include <crypto/aes.h>
|
#include <crypto/aes.h>
|
||||||
|
#include <crypto/internal/skcipher.h>
|
||||||
|
|
||||||
#include <asm/fpumacro.h>
|
#include <asm/fpumacro.h>
|
||||||
#include <asm/pstate.h>
|
#include <asm/pstate.h>
|
||||||
@ -197,6 +198,12 @@ static int aes_set_key(struct crypto_tfm *tfm, const u8 *in_key,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int aes_set_key_skcipher(struct crypto_skcipher *tfm, const u8 *in_key,
|
||||||
|
unsigned int key_len)
|
||||||
|
{
|
||||||
|
return aes_set_key(crypto_skcipher_tfm(tfm), in_key, key_len);
|
||||||
|
}
|
||||||
|
|
||||||
static void crypto_aes_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
|
static void crypto_aes_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
|
||||||
{
|
{
|
||||||
struct crypto_sparc64_aes_ctx *ctx = crypto_tfm_ctx(tfm);
|
struct crypto_sparc64_aes_ctx *ctx = crypto_tfm_ctx(tfm);
|
||||||
@ -211,131 +218,108 @@ static void crypto_aes_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
|
|||||||
ctx->ops->decrypt(&ctx->key[0], (const u32 *) src, (u32 *) dst);
|
ctx->ops->decrypt(&ctx->key[0], (const u32 *) src, (u32 *) dst);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define AES_BLOCK_MASK (~(AES_BLOCK_SIZE-1))
|
static int ecb_encrypt(struct skcipher_request *req)
|
||||||
|
|
||||||
static int ecb_encrypt(struct blkcipher_desc *desc,
|
|
||||||
struct scatterlist *dst, struct scatterlist *src,
|
|
||||||
unsigned int nbytes)
|
|
||||||
{
|
{
|
||||||
struct crypto_sparc64_aes_ctx *ctx = crypto_blkcipher_ctx(desc->tfm);
|
struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
|
||||||
struct blkcipher_walk walk;
|
const struct crypto_sparc64_aes_ctx *ctx = crypto_skcipher_ctx(tfm);
|
||||||
|
struct skcipher_walk walk;
|
||||||
|
unsigned int nbytes;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
blkcipher_walk_init(&walk, dst, src, nbytes);
|
err = skcipher_walk_virt(&walk, req, true);
|
||||||
err = blkcipher_walk_virt(desc, &walk);
|
if (err)
|
||||||
desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
|
return err;
|
||||||
|
|
||||||
ctx->ops->load_encrypt_keys(&ctx->key[0]);
|
ctx->ops->load_encrypt_keys(&ctx->key[0]);
|
||||||
while ((nbytes = walk.nbytes)) {
|
while ((nbytes = walk.nbytes) != 0) {
|
||||||
unsigned int block_len = nbytes & AES_BLOCK_MASK;
|
ctx->ops->ecb_encrypt(&ctx->key[0], walk.src.virt.addr,
|
||||||
|
walk.dst.virt.addr,
|
||||||
if (likely(block_len)) {
|
round_down(nbytes, AES_BLOCK_SIZE));
|
||||||
ctx->ops->ecb_encrypt(&ctx->key[0],
|
err = skcipher_walk_done(&walk, nbytes % AES_BLOCK_SIZE);
|
||||||
(const u64 *)walk.src.virt.addr,
|
|
||||||
(u64 *) walk.dst.virt.addr,
|
|
||||||
block_len);
|
|
||||||
}
|
|
||||||
nbytes &= AES_BLOCK_SIZE - 1;
|
|
||||||
err = blkcipher_walk_done(desc, &walk, nbytes);
|
|
||||||
}
|
}
|
||||||
fprs_write(0);
|
fprs_write(0);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ecb_decrypt(struct blkcipher_desc *desc,
|
static int ecb_decrypt(struct skcipher_request *req)
|
||||||
struct scatterlist *dst, struct scatterlist *src,
|
|
||||||
unsigned int nbytes)
|
|
||||||
{
|
{
|
||||||
struct crypto_sparc64_aes_ctx *ctx = crypto_blkcipher_ctx(desc->tfm);
|
struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
|
||||||
struct blkcipher_walk walk;
|
const struct crypto_sparc64_aes_ctx *ctx = crypto_skcipher_ctx(tfm);
|
||||||
u64 *key_end;
|
const u64 *key_end;
|
||||||
|
struct skcipher_walk walk;
|
||||||
|
unsigned int nbytes;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
blkcipher_walk_init(&walk, dst, src, nbytes);
|
err = skcipher_walk_virt(&walk, req, true);
|
||||||
err = blkcipher_walk_virt(desc, &walk);
|
if (err)
|
||||||
desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
|
return err;
|
||||||
|
|
||||||
ctx->ops->load_decrypt_keys(&ctx->key[0]);
|
ctx->ops->load_decrypt_keys(&ctx->key[0]);
|
||||||
key_end = &ctx->key[ctx->expanded_key_length / sizeof(u64)];
|
key_end = &ctx->key[ctx->expanded_key_length / sizeof(u64)];
|
||||||
while ((nbytes = walk.nbytes)) {
|
while ((nbytes = walk.nbytes) != 0) {
|
||||||
unsigned int block_len = nbytes & AES_BLOCK_MASK;
|
ctx->ops->ecb_decrypt(key_end, walk.src.virt.addr,
|
||||||
|
walk.dst.virt.addr,
|
||||||
if (likely(block_len)) {
|
round_down(nbytes, AES_BLOCK_SIZE));
|
||||||
ctx->ops->ecb_decrypt(key_end,
|
err = skcipher_walk_done(&walk, nbytes % AES_BLOCK_SIZE);
|
||||||
(const u64 *) walk.src.virt.addr,
|
|
||||||
(u64 *) walk.dst.virt.addr, block_len);
|
|
||||||
}
|
|
||||||
nbytes &= AES_BLOCK_SIZE - 1;
|
|
||||||
err = blkcipher_walk_done(desc, &walk, nbytes);
|
|
||||||
}
|
}
|
||||||
fprs_write(0);
|
fprs_write(0);
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cbc_encrypt(struct blkcipher_desc *desc,
|
static int cbc_encrypt(struct skcipher_request *req)
|
||||||
struct scatterlist *dst, struct scatterlist *src,
|
|
||||||
unsigned int nbytes)
|
|
||||||
{
|
{
|
||||||
struct crypto_sparc64_aes_ctx *ctx = crypto_blkcipher_ctx(desc->tfm);
|
struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
|
||||||
struct blkcipher_walk walk;
|
const struct crypto_sparc64_aes_ctx *ctx = crypto_skcipher_ctx(tfm);
|
||||||
|
struct skcipher_walk walk;
|
||||||
|
unsigned int nbytes;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
blkcipher_walk_init(&walk, dst, src, nbytes);
|
err = skcipher_walk_virt(&walk, req, true);
|
||||||
err = blkcipher_walk_virt(desc, &walk);
|
if (err)
|
||||||
desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
|
return err;
|
||||||
|
|
||||||
ctx->ops->load_encrypt_keys(&ctx->key[0]);
|
ctx->ops->load_encrypt_keys(&ctx->key[0]);
|
||||||
while ((nbytes = walk.nbytes)) {
|
while ((nbytes = walk.nbytes) != 0) {
|
||||||
unsigned int block_len = nbytes & AES_BLOCK_MASK;
|
ctx->ops->cbc_encrypt(&ctx->key[0], walk.src.virt.addr,
|
||||||
|
walk.dst.virt.addr,
|
||||||
if (likely(block_len)) {
|
round_down(nbytes, AES_BLOCK_SIZE),
|
||||||
ctx->ops->cbc_encrypt(&ctx->key[0],
|
walk.iv);
|
||||||
(const u64 *)walk.src.virt.addr,
|
err = skcipher_walk_done(&walk, nbytes % AES_BLOCK_SIZE);
|
||||||
(u64 *) walk.dst.virt.addr,
|
|
||||||
block_len, (u64 *) walk.iv);
|
|
||||||
}
|
|
||||||
nbytes &= AES_BLOCK_SIZE - 1;
|
|
||||||
err = blkcipher_walk_done(desc, &walk, nbytes);
|
|
||||||
}
|
}
|
||||||
fprs_write(0);
|
fprs_write(0);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cbc_decrypt(struct blkcipher_desc *desc,
|
static int cbc_decrypt(struct skcipher_request *req)
|
||||||
struct scatterlist *dst, struct scatterlist *src,
|
|
||||||
unsigned int nbytes)
|
|
||||||
{
|
{
|
||||||
struct crypto_sparc64_aes_ctx *ctx = crypto_blkcipher_ctx(desc->tfm);
|
struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
|
||||||
struct blkcipher_walk walk;
|
const struct crypto_sparc64_aes_ctx *ctx = crypto_skcipher_ctx(tfm);
|
||||||
u64 *key_end;
|
const u64 *key_end;
|
||||||
|
struct skcipher_walk walk;
|
||||||
|
unsigned int nbytes;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
blkcipher_walk_init(&walk, dst, src, nbytes);
|
err = skcipher_walk_virt(&walk, req, true);
|
||||||
err = blkcipher_walk_virt(desc, &walk);
|
if (err)
|
||||||
desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
|
return err;
|
||||||
|
|
||||||
ctx->ops->load_decrypt_keys(&ctx->key[0]);
|
ctx->ops->load_decrypt_keys(&ctx->key[0]);
|
||||||
key_end = &ctx->key[ctx->expanded_key_length / sizeof(u64)];
|
key_end = &ctx->key[ctx->expanded_key_length / sizeof(u64)];
|
||||||
while ((nbytes = walk.nbytes)) {
|
while ((nbytes = walk.nbytes) != 0) {
|
||||||
unsigned int block_len = nbytes & AES_BLOCK_MASK;
|
ctx->ops->cbc_decrypt(key_end, walk.src.virt.addr,
|
||||||
|
walk.dst.virt.addr,
|
||||||
if (likely(block_len)) {
|
round_down(nbytes, AES_BLOCK_SIZE),
|
||||||
ctx->ops->cbc_decrypt(key_end,
|
walk.iv);
|
||||||
(const u64 *) walk.src.virt.addr,
|
err = skcipher_walk_done(&walk, nbytes % AES_BLOCK_SIZE);
|
||||||
(u64 *) walk.dst.virt.addr,
|
|
||||||
block_len, (u64 *) walk.iv);
|
|
||||||
}
|
|
||||||
nbytes &= AES_BLOCK_SIZE - 1;
|
|
||||||
err = blkcipher_walk_done(desc, &walk, nbytes);
|
|
||||||
}
|
}
|
||||||
fprs_write(0);
|
fprs_write(0);
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ctr_crypt_final(struct crypto_sparc64_aes_ctx *ctx,
|
static void ctr_crypt_final(const struct crypto_sparc64_aes_ctx *ctx,
|
||||||
struct blkcipher_walk *walk)
|
struct skcipher_walk *walk)
|
||||||
{
|
{
|
||||||
u8 *ctrblk = walk->iv;
|
u8 *ctrblk = walk->iv;
|
||||||
u64 keystream[AES_BLOCK_SIZE / sizeof(u64)];
|
u64 keystream[AES_BLOCK_SIZE / sizeof(u64)];
|
||||||
@ -349,40 +333,35 @@ static void ctr_crypt_final(struct crypto_sparc64_aes_ctx *ctx,
|
|||||||
crypto_inc(ctrblk, AES_BLOCK_SIZE);
|
crypto_inc(ctrblk, AES_BLOCK_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ctr_crypt(struct blkcipher_desc *desc,
|
static int ctr_crypt(struct skcipher_request *req)
|
||||||
struct scatterlist *dst, struct scatterlist *src,
|
|
||||||
unsigned int nbytes)
|
|
||||||
{
|
{
|
||||||
struct crypto_sparc64_aes_ctx *ctx = crypto_blkcipher_ctx(desc->tfm);
|
struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
|
||||||
struct blkcipher_walk walk;
|
const struct crypto_sparc64_aes_ctx *ctx = crypto_skcipher_ctx(tfm);
|
||||||
|
struct skcipher_walk walk;
|
||||||
|
unsigned int nbytes;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
blkcipher_walk_init(&walk, dst, src, nbytes);
|
err = skcipher_walk_virt(&walk, req, true);
|
||||||
err = blkcipher_walk_virt_block(desc, &walk, AES_BLOCK_SIZE);
|
if (err)
|
||||||
desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
|
return err;
|
||||||
|
|
||||||
ctx->ops->load_encrypt_keys(&ctx->key[0]);
|
ctx->ops->load_encrypt_keys(&ctx->key[0]);
|
||||||
while ((nbytes = walk.nbytes) >= AES_BLOCK_SIZE) {
|
while ((nbytes = walk.nbytes) >= AES_BLOCK_SIZE) {
|
||||||
unsigned int block_len = nbytes & AES_BLOCK_MASK;
|
ctx->ops->ctr_crypt(&ctx->key[0], walk.src.virt.addr,
|
||||||
|
walk.dst.virt.addr,
|
||||||
if (likely(block_len)) {
|
round_down(nbytes, AES_BLOCK_SIZE),
|
||||||
ctx->ops->ctr_crypt(&ctx->key[0],
|
walk.iv);
|
||||||
(const u64 *)walk.src.virt.addr,
|
err = skcipher_walk_done(&walk, nbytes % AES_BLOCK_SIZE);
|
||||||
(u64 *) walk.dst.virt.addr,
|
|
||||||
block_len, (u64 *) walk.iv);
|
|
||||||
}
|
|
||||||
nbytes &= AES_BLOCK_SIZE - 1;
|
|
||||||
err = blkcipher_walk_done(desc, &walk, nbytes);
|
|
||||||
}
|
}
|
||||||
if (walk.nbytes) {
|
if (walk.nbytes) {
|
||||||
ctr_crypt_final(ctx, &walk);
|
ctr_crypt_final(ctx, &walk);
|
||||||
err = blkcipher_walk_done(desc, &walk, 0);
|
err = skcipher_walk_done(&walk, 0);
|
||||||
}
|
}
|
||||||
fprs_write(0);
|
fprs_write(0);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct crypto_alg algs[] = { {
|
static struct crypto_alg cipher_alg = {
|
||||||
.cra_name = "aes",
|
.cra_name = "aes",
|
||||||
.cra_driver_name = "aes-sparc64",
|
.cra_driver_name = "aes-sparc64",
|
||||||
.cra_priority = SPARC_CR_OPCODE_PRIORITY,
|
.cra_priority = SPARC_CR_OPCODE_PRIORITY,
|
||||||
@ -400,66 +379,53 @@ static struct crypto_alg algs[] = { {
|
|||||||
.cia_decrypt = crypto_aes_decrypt
|
.cia_decrypt = crypto_aes_decrypt
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, {
|
};
|
||||||
.cra_name = "ecb(aes)",
|
|
||||||
.cra_driver_name = "ecb-aes-sparc64",
|
static struct skcipher_alg skcipher_algs[] = {
|
||||||
.cra_priority = SPARC_CR_OPCODE_PRIORITY,
|
{
|
||||||
.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER,
|
.base.cra_name = "ecb(aes)",
|
||||||
.cra_blocksize = AES_BLOCK_SIZE,
|
.base.cra_driver_name = "ecb-aes-sparc64",
|
||||||
.cra_ctxsize = sizeof(struct crypto_sparc64_aes_ctx),
|
.base.cra_priority = SPARC_CR_OPCODE_PRIORITY,
|
||||||
.cra_alignmask = 7,
|
.base.cra_blocksize = AES_BLOCK_SIZE,
|
||||||
.cra_type = &crypto_blkcipher_type,
|
.base.cra_ctxsize = sizeof(struct crypto_sparc64_aes_ctx),
|
||||||
.cra_module = THIS_MODULE,
|
.base.cra_alignmask = 7,
|
||||||
.cra_u = {
|
.base.cra_module = THIS_MODULE,
|
||||||
.blkcipher = {
|
|
||||||
.min_keysize = AES_MIN_KEY_SIZE,
|
.min_keysize = AES_MIN_KEY_SIZE,
|
||||||
.max_keysize = AES_MAX_KEY_SIZE,
|
.max_keysize = AES_MAX_KEY_SIZE,
|
||||||
.setkey = aes_set_key,
|
.setkey = aes_set_key_skcipher,
|
||||||
.encrypt = ecb_encrypt,
|
.encrypt = ecb_encrypt,
|
||||||
.decrypt = ecb_decrypt,
|
.decrypt = ecb_decrypt,
|
||||||
},
|
|
||||||
},
|
|
||||||
}, {
|
}, {
|
||||||
.cra_name = "cbc(aes)",
|
.base.cra_name = "cbc(aes)",
|
||||||
.cra_driver_name = "cbc-aes-sparc64",
|
.base.cra_driver_name = "cbc-aes-sparc64",
|
||||||
.cra_priority = SPARC_CR_OPCODE_PRIORITY,
|
.base.cra_priority = SPARC_CR_OPCODE_PRIORITY,
|
||||||
.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER,
|
.base.cra_blocksize = AES_BLOCK_SIZE,
|
||||||
.cra_blocksize = AES_BLOCK_SIZE,
|
.base.cra_ctxsize = sizeof(struct crypto_sparc64_aes_ctx),
|
||||||
.cra_ctxsize = sizeof(struct crypto_sparc64_aes_ctx),
|
.base.cra_alignmask = 7,
|
||||||
.cra_alignmask = 7,
|
.base.cra_module = THIS_MODULE,
|
||||||
.cra_type = &crypto_blkcipher_type,
|
|
||||||
.cra_module = THIS_MODULE,
|
|
||||||
.cra_u = {
|
|
||||||
.blkcipher = {
|
|
||||||
.min_keysize = AES_MIN_KEY_SIZE,
|
.min_keysize = AES_MIN_KEY_SIZE,
|
||||||
.max_keysize = AES_MAX_KEY_SIZE,
|
.max_keysize = AES_MAX_KEY_SIZE,
|
||||||
.ivsize = AES_BLOCK_SIZE,
|
.ivsize = AES_BLOCK_SIZE,
|
||||||
.setkey = aes_set_key,
|
.setkey = aes_set_key_skcipher,
|
||||||
.encrypt = cbc_encrypt,
|
.encrypt = cbc_encrypt,
|
||||||
.decrypt = cbc_decrypt,
|
.decrypt = cbc_decrypt,
|
||||||
},
|
|
||||||
},
|
|
||||||
}, {
|
}, {
|
||||||
.cra_name = "ctr(aes)",
|
.base.cra_name = "ctr(aes)",
|
||||||
.cra_driver_name = "ctr-aes-sparc64",
|
.base.cra_driver_name = "ctr-aes-sparc64",
|
||||||
.cra_priority = SPARC_CR_OPCODE_PRIORITY,
|
.base.cra_priority = SPARC_CR_OPCODE_PRIORITY,
|
||||||
.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER,
|
.base.cra_blocksize = 1,
|
||||||
.cra_blocksize = 1,
|
.base.cra_ctxsize = sizeof(struct crypto_sparc64_aes_ctx),
|
||||||
.cra_ctxsize = sizeof(struct crypto_sparc64_aes_ctx),
|
.base.cra_alignmask = 7,
|
||||||
.cra_alignmask = 7,
|
.base.cra_module = THIS_MODULE,
|
||||||
.cra_type = &crypto_blkcipher_type,
|
|
||||||
.cra_module = THIS_MODULE,
|
|
||||||
.cra_u = {
|
|
||||||
.blkcipher = {
|
|
||||||
.min_keysize = AES_MIN_KEY_SIZE,
|
.min_keysize = AES_MIN_KEY_SIZE,
|
||||||
.max_keysize = AES_MAX_KEY_SIZE,
|
.max_keysize = AES_MAX_KEY_SIZE,
|
||||||
.ivsize = AES_BLOCK_SIZE,
|
.ivsize = AES_BLOCK_SIZE,
|
||||||
.setkey = aes_set_key,
|
.setkey = aes_set_key_skcipher,
|
||||||
.encrypt = ctr_crypt,
|
.encrypt = ctr_crypt,
|
||||||
.decrypt = ctr_crypt,
|
.decrypt = ctr_crypt,
|
||||||
},
|
.chunksize = AES_BLOCK_SIZE,
|
||||||
},
|
}
|
||||||
} };
|
};
|
||||||
|
|
||||||
static bool __init sparc64_has_aes_opcode(void)
|
static bool __init sparc64_has_aes_opcode(void)
|
||||||
{
|
{
|
||||||
@ -477,17 +443,27 @@ static bool __init sparc64_has_aes_opcode(void)
|
|||||||
|
|
||||||
static int __init aes_sparc64_mod_init(void)
|
static int __init aes_sparc64_mod_init(void)
|
||||||
{
|
{
|
||||||
if (sparc64_has_aes_opcode()) {
|
int err;
|
||||||
pr_info("Using sparc64 aes opcodes optimized AES implementation\n");
|
|
||||||
return crypto_register_algs(algs, ARRAY_SIZE(algs));
|
if (!sparc64_has_aes_opcode()) {
|
||||||
}
|
|
||||||
pr_info("sparc64 aes opcodes not available.\n");
|
pr_info("sparc64 aes opcodes not available.\n");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
pr_info("Using sparc64 aes opcodes optimized AES implementation\n");
|
||||||
|
err = crypto_register_alg(&cipher_alg);
|
||||||
|
if (err)
|
||||||
|
return err;
|
||||||
|
err = crypto_register_skciphers(skcipher_algs,
|
||||||
|
ARRAY_SIZE(skcipher_algs));
|
||||||
|
if (err)
|
||||||
|
crypto_unregister_alg(&cipher_alg);
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
static void __exit aes_sparc64_mod_fini(void)
|
static void __exit aes_sparc64_mod_fini(void)
|
||||||
{
|
{
|
||||||
crypto_unregister_algs(algs, ARRAY_SIZE(algs));
|
crypto_unregister_alg(&cipher_alg);
|
||||||
|
crypto_unregister_skciphers(skcipher_algs, ARRAY_SIZE(skcipher_algs));
|
||||||
}
|
}
|
||||||
|
|
||||||
module_init(aes_sparc64_mod_init);
|
module_init(aes_sparc64_mod_init);
|
||||||
|
@ -1098,8 +1098,7 @@ config CRYPTO_AES_NI_INTEL
|
|||||||
config CRYPTO_AES_SPARC64
|
config CRYPTO_AES_SPARC64
|
||||||
tristate "AES cipher algorithms (SPARC64)"
|
tristate "AES cipher algorithms (SPARC64)"
|
||||||
depends on SPARC64
|
depends on SPARC64
|
||||||
select CRYPTO_CRYPTD
|
select CRYPTO_BLKCIPHER
|
||||||
select CRYPTO_ALGAPI
|
|
||||||
help
|
help
|
||||||
Use SPARC64 crypto opcodes for AES algorithm.
|
Use SPARC64 crypto opcodes for AES algorithm.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user