Thread (18 messages) 18 messages, 3 authors, 2021-03-10

Re: [PATCH v11 02/10] crypto: Add support for ECDSA signature verification

From: Stefan Berger <stefanb@linux.ibm.com>
Date: 2021-03-08 17:05:08
Also in: keyrings, linux-crypto, lkml

On 3/5/21 3:59 PM, Stefan Berger wrote:
quoted hunk ↗ jump to hunk
diff --git a/crypto/Kconfig b/crypto/Kconfig
index a367fcfeb5d4..a31df40591f5 100644
--- a/crypto/Kconfig
+++ b/crypto/Kconfig
@@ -247,6 +247,16 @@ config CRYPTO_ECDH
  	help
  	  Generic implementation of the ECDH algorithm
  
@@ -70,6 +72,30 @@ struct ecc_curve {
  	u64 *b;
  };
  
+/**
+ * ecc_swap_digits() - Copy ndigits from big endian array to native array
+ * @in:       Input array
+ * @out:      Output array
+ * @ndigits:  Number of digits to copy
+ */
+static inline void ecc_swap_digits(const u64 *in, u64 *out, unsigned int ndigits)
+{
+	const __be64 *src = (__force __be64 *)in;
+	int i;
+
+	for (i = 0; i < ndigits; i++)
+		out[i] = be64_to_cpu(src[ndigits - 1 - i]);
+}
+
+/**
+ * ecc_get_curve()  - Get a curve given its curve_id
+ *
There's still an additional empty line here (as is the case with other 
existing functions in this file). I will fix this one in v12.

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help