summaryrefslogtreecommitdiffstats
path: root/crypto/ecc.h
diff options
context:
space:
mode:
authorStephan Müller <smueller@chronox.de>2020-07-20 19:09:23 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2020-07-31 18:08:59 +1000
commit6914dd53eb7af7cbc66edf7992d600b1e952c40d (patch)
tree242bdb80540704daa7210315b70f9890047346b5 /crypto/ecc.h
parent2ed5ba61cc78f102656eedc0b4c80fd14a5e8c7c (diff)
downloadlinux-stable-6914dd53eb7af7cbc66edf7992d600b1e952c40d.tar.gz
linux-stable-6914dd53eb7af7cbc66edf7992d600b1e952c40d.tar.bz2
linux-stable-6914dd53eb7af7cbc66edf7992d600b1e952c40d.zip
crypto: ecc - SP800-56A rev 3 local public key validation
After the generation of a local public key, SP800-56A rev 3 section 5.6.2.1.3 mandates a validation of that key with a full validation compliant to section 5.6.2.3.3. Only if the full validation passes, the key is allowed to be used. The patch adds the full key validation compliant to 5.6.2.3.3 and performs the required check on the generated public key. Signed-off-by: Stephan Mueller <smueller@chronox.de> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/ecc.h')
-rw-r--r--crypto/ecc.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/crypto/ecc.h b/crypto/ecc.h
index ab0eb70b9c09..d4e546b9ad79 100644
--- a/crypto/ecc.h
+++ b/crypto/ecc.h
@@ -148,6 +148,20 @@ int ecc_is_pubkey_valid_partial(const struct ecc_curve *curve,
struct ecc_point *pk);
/**
+ * ecc_is_pubkey_valid_full() - Full public key validation
+ *
+ * @curve: elliptic curve domain parameters
+ * @pk: public key as a point
+ *
+ * Valdiate public key according to SP800-56A section 5.6.2.3.3 ECC Full
+ * Public-Key Validation Routine.
+ *
+ * Return: 0 if validation is successful, -EINVAL if validation is failed.
+ */
+int ecc_is_pubkey_valid_full(const struct ecc_curve *curve,
+ struct ecc_point *pk);
+
+/**
* vli_is_zero() - Determine is vli is zero
*
* @vli: vli to check.