aboutsummaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
Diffstat (limited to 'crypto')
-rw-r--r--crypto/Kconfig98
-rw-r--r--crypto/authenc.c4
-rw-r--r--crypto/crypto_user.c7
3 files changed, 103 insertions, 6 deletions
diff --git a/crypto/Kconfig b/crypto/Kconfig
index 27307981f88e..50402dc0ea35 100644
--- a/crypto/Kconfig
+++ b/crypto/Kconfig
@@ -336,6 +336,15 @@ config CRYPTO_CRC32C_INTEL
336 gain performance compared with software implementation. 336 gain performance compared with software implementation.
337 Module will be crc32c-intel. 337 Module will be crc32c-intel.
338 338
339config CRYPTO_CRC32C_SPARC64
340 tristate "CRC32c CRC algorithm (SPARC64)"
341 depends on SPARC64
342 select CRYPTO_HASH
343 select CRC32
344 help
345 CRC32c CRC algorithm implemented using sparc64 crypto instructions,
346 when available.
347
339config CRYPTO_GHASH 348config CRYPTO_GHASH
340 tristate "GHASH digest algorithm" 349 tristate "GHASH digest algorithm"
341 select CRYPTO_GF128MUL 350 select CRYPTO_GF128MUL
@@ -354,6 +363,15 @@ config CRYPTO_MD5
354 help 363 help
355 MD5 message digest algorithm (RFC1321). 364 MD5 message digest algorithm (RFC1321).
356 365
366config CRYPTO_MD5_SPARC64
367 tristate "MD5 digest algorithm (SPARC64)"
368 depends on SPARC64
369 select CRYPTO_MD5
370 select CRYPTO_HASH
371 help
372 MD5 message digest algorithm (RFC1321) implemented
373 using sparc64 crypto instructions, when available.
374
357config CRYPTO_MICHAEL_MIC 375config CRYPTO_MICHAEL_MIC
358 tristate "Michael MIC keyed digest algorithm" 376 tristate "Michael MIC keyed digest algorithm"
359 select CRYPTO_HASH 377 select CRYPTO_HASH
@@ -433,6 +451,15 @@ config CRYPTO_SHA1_SSSE3
433 using Supplemental SSE3 (SSSE3) instructions or Advanced Vector 451 using Supplemental SSE3 (SSSE3) instructions or Advanced Vector
434 Extensions (AVX), when available. 452 Extensions (AVX), when available.
435 453
454config CRYPTO_SHA1_SPARC64
455 tristate "SHA1 digest algorithm (SPARC64)"
456 depends on SPARC64
457 select CRYPTO_SHA1
458 select CRYPTO_HASH
459 help
460 SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2) implemented
461 using sparc64 crypto instructions, when available.
462
436config CRYPTO_SHA1_ARM 463config CRYPTO_SHA1_ARM
437 tristate "SHA1 digest algorithm (ARM-asm)" 464 tristate "SHA1 digest algorithm (ARM-asm)"
438 depends on ARM 465 depends on ARM
@@ -454,6 +481,15 @@ config CRYPTO_SHA256
454 This code also includes SHA-224, a 224 bit hash with 112 bits 481 This code also includes SHA-224, a 224 bit hash with 112 bits
455 of security against collision attacks. 482 of security against collision attacks.
456 483
484config CRYPTO_SHA256_SPARC64
485 tristate "SHA224 and SHA256 digest algorithm (SPARC64)"
486 depends on SPARC64
487 select CRYPTO_SHA256
488 select CRYPTO_HASH
489 help
490 SHA-256 secure hash standard (DFIPS 180-2) implemented
491 using sparc64 crypto instructions, when available.
492
457config CRYPTO_SHA512 493config CRYPTO_SHA512
458 tristate "SHA384 and SHA512 digest algorithms" 494 tristate "SHA384 and SHA512 digest algorithms"
459 select CRYPTO_HASH 495 select CRYPTO_HASH
@@ -466,6 +502,15 @@ config CRYPTO_SHA512
466 This code also includes SHA-384, a 384 bit hash with 192 bits 502 This code also includes SHA-384, a 384 bit hash with 192 bits
467 of security against collision attacks. 503 of security against collision attacks.
468 504
505config CRYPTO_SHA512_SPARC64
506 tristate "SHA384 and SHA512 digest algorithm (SPARC64)"
507 depends on SPARC64
508 select CRYPTO_SHA512
509 select CRYPTO_HASH
510 help
511 SHA-512 secure hash standard (DFIPS 180-2) implemented
512 using sparc64 crypto instructions, when available.
513
469config CRYPTO_TGR192 514config CRYPTO_TGR192
470 tristate "Tiger digest algorithms" 515 tristate "Tiger digest algorithms"
471 select CRYPTO_HASH 516 select CRYPTO_HASH
@@ -599,6 +644,34 @@ config CRYPTO_AES_NI_INTEL
599 ECB, CBC, LRW, PCBC, XTS. The 64 bit version has additional 644 ECB, CBC, LRW, PCBC, XTS. The 64 bit version has additional
600 acceleration for CTR. 645 acceleration for CTR.
601 646
647config CRYPTO_AES_SPARC64
648 tristate "AES cipher algorithms (SPARC64)"
649 depends on SPARC64
650 select CRYPTO_CRYPTD
651 select CRYPTO_ALGAPI
652 help
653 Use SPARC64 crypto opcodes for AES algorithm.
654
655 AES cipher algorithms (FIPS-197). AES uses the Rijndael
656 algorithm.
657
658 Rijndael appears to be consistently a very good performer in
659 both hardware and software across a wide range of computing
660 environments regardless of its use in feedback or non-feedback
661 modes. Its key setup time is excellent, and its key agility is
662 good. Rijndael's very low memory requirements make it very well
663 suited for restricted-space environments, in which it also
664 demonstrates excellent performance. Rijndael's operations are
665 among the easiest to defend against power and timing attacks.
666
667 The AES specifies three key sizes: 128, 192 and 256 bits
668
669 See <http://csrc.nist.gov/encryption/aes/> for more information.
670
671 In addition to AES cipher algorithm support, the acceleration
672 for some popular block cipher mode is supported too, including
673 ECB and CBC.
674
602config CRYPTO_AES_ARM 675config CRYPTO_AES_ARM
603 tristate "AES cipher algorithms (ARM-asm)" 676 tristate "AES cipher algorithms (ARM-asm)"
604 depends on ARM 677 depends on ARM
@@ -720,6 +793,22 @@ config CRYPTO_CAMELLIA_X86_64
720 See also: 793 See also:
721 <https://info.isl.ntt.co.jp/crypt/eng/camellia/index_s.html> 794 <https://info.isl.ntt.co.jp/crypt/eng/camellia/index_s.html>
722 795
796config CRYPTO_CAMELLIA_SPARC64
797 tristate "Camellia cipher algorithm (SPARC64)"
798 depends on SPARC64
799 depends on CRYPTO
800 select CRYPTO_ALGAPI
801 help
802 Camellia cipher algorithm module (SPARC64).
803
804 Camellia is a symmetric key block cipher developed jointly
805 at NTT and Mitsubishi Electric Corporation.
806
807 The Camellia specifies three key sizes: 128, 192 and 256 bits.
808
809 See also:
810 <https://info.isl.ntt.co.jp/crypt/eng/camellia/index_s.html>
811
723config CRYPTO_CAST5 812config CRYPTO_CAST5
724 tristate "CAST5 (CAST-128) cipher algorithm" 813 tristate "CAST5 (CAST-128) cipher algorithm"
725 select CRYPTO_ALGAPI 814 select CRYPTO_ALGAPI
@@ -771,6 +860,15 @@ config CRYPTO_DES
771 help 860 help
772 DES cipher algorithm (FIPS 46-2), and Triple DES EDE (FIPS 46-3). 861 DES cipher algorithm (FIPS 46-2), and Triple DES EDE (FIPS 46-3).
773 862
863config CRYPTO_DES_SPARC64
864 tristate "DES and Triple DES EDE cipher algorithms (SPARC64)"
865 depends on SPARC64
866 select CRYPTO_ALGAPI
867 select CRYPTO_DES
868 help
869 DES cipher algorithm (FIPS 46-2), and Triple DES EDE (FIPS 46-3),
870 optimized using SPARC64 crypto opcodes.
871
774config CRYPTO_FCRYPT 872config CRYPTO_FCRYPT
775 tristate "FCrypt cipher algorithm" 873 tristate "FCrypt cipher algorithm"
776 select CRYPTO_ALGAPI 874 select CRYPTO_ALGAPI
diff --git a/crypto/authenc.c b/crypto/authenc.c
index 5ef7ba6b6a76..d0583a4489e6 100644
--- a/crypto/authenc.c
+++ b/crypto/authenc.c
@@ -336,7 +336,7 @@ static int crypto_authenc_genicv(struct aead_request *req, u8 *iv,
336 cryptlen += ivsize; 336 cryptlen += ivsize;
337 } 337 }
338 338
339 if (sg_is_last(assoc)) { 339 if (req->assoclen && sg_is_last(assoc)) {
340 authenc_ahash_fn = crypto_authenc_ahash; 340 authenc_ahash_fn = crypto_authenc_ahash;
341 sg_init_table(asg, 2); 341 sg_init_table(asg, 2);
342 sg_set_page(asg, sg_page(assoc), assoc->length, assoc->offset); 342 sg_set_page(asg, sg_page(assoc), assoc->length, assoc->offset);
@@ -490,7 +490,7 @@ static int crypto_authenc_iverify(struct aead_request *req, u8 *iv,
490 cryptlen += ivsize; 490 cryptlen += ivsize;
491 } 491 }
492 492
493 if (sg_is_last(assoc)) { 493 if (req->assoclen && sg_is_last(assoc)) {
494 authenc_ahash_fn = crypto_authenc_ahash; 494 authenc_ahash_fn = crypto_authenc_ahash;
495 sg_init_table(asg, 2); 495 sg_init_table(asg, 2);
496 sg_set_page(asg, sg_page(assoc), assoc->length, assoc->offset); 496 sg_set_page(asg, sg_page(assoc), assoc->length, assoc->offset);
diff --git a/crypto/crypto_user.c b/crypto/crypto_user.c
index b590471abfa1..35d700a97d79 100644
--- a/crypto/crypto_user.c
+++ b/crypto/crypto_user.c
@@ -166,7 +166,7 @@ static int crypto_report_alg(struct crypto_alg *alg,
166 struct crypto_user_alg *ualg; 166 struct crypto_user_alg *ualg;
167 int err = 0; 167 int err = 0;
168 168
169 nlh = nlmsg_put(skb, NETLINK_CB(in_skb).pid, info->nlmsg_seq, 169 nlh = nlmsg_put(skb, NETLINK_CB(in_skb).portid, info->nlmsg_seq,
170 CRYPTO_MSG_GETALG, sizeof(*ualg), info->nlmsg_flags); 170 CRYPTO_MSG_GETALG, sizeof(*ualg), info->nlmsg_flags);
171 if (!nlh) { 171 if (!nlh) {
172 err = -EMSGSIZE; 172 err = -EMSGSIZE;
@@ -216,7 +216,7 @@ static int crypto_report(struct sk_buff *in_skb, struct nlmsghdr *in_nlh,
216 if (err) 216 if (err)
217 return err; 217 return err;
218 218
219 return nlmsg_unicast(crypto_nlsk, skb, NETLINK_CB(in_skb).pid); 219 return nlmsg_unicast(crypto_nlsk, skb, NETLINK_CB(in_skb).portid);
220} 220}
221 221
222static int crypto_dump_report(struct sk_buff *skb, struct netlink_callback *cb) 222static int crypto_dump_report(struct sk_buff *skb, struct netlink_callback *cb)
@@ -500,8 +500,7 @@ static int __init crypto_user_init(void)
500 .input = crypto_netlink_rcv, 500 .input = crypto_netlink_rcv,
501 }; 501 };
502 502
503 crypto_nlsk = netlink_kernel_create(&init_net, NETLINK_CRYPTO, 503 crypto_nlsk = netlink_kernel_create(&init_net, NETLINK_CRYPTO, &cfg);
504 THIS_MODULE, &cfg);
505 if (!crypto_nlsk) 504 if (!crypto_nlsk)
506 return -ENOMEM; 505 return -ENOMEM;
507 506