From 34fbd9910a779c7fb5bb7ccc07e4ae68ae35e997 Mon Sep 17 00:00:00 2001
From: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Date: Tue, 7 Jan 2020 01:16:44 +0300
Subject: [PATCH] ecc: prefix optimized ECC function names with underscore

There is no need to keep optimized ECC functions in public namespace
(nettle_*), move them to internal namespace (_nettle_*).

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 arm/ecc-secp192r1-modp.asm     | 4 ++--
 arm/ecc-secp224r1-modp.asm     | 4 ++--
 arm/ecc-secp256r1-redc.asm     | 4 ++--
 arm/ecc-secp384r1-modp.asm     | 4 ++--
 arm/ecc-secp521r1-modp.asm     | 4 ++--
 ecc-curve25519.c               | 2 +-
 ecc-curve448.c                 | 2 +-
 ecc-secp192r1.c                | 2 +-
 ecc-secp224r1.c                | 2 +-
 ecc-secp256r1.c                | 2 +-
 ecc-secp384r1.c                | 2 +-
 ecc-secp521r1.c                | 2 +-
 x86_64/ecc-curve25519-modp.asm | 4 ++--
 x86_64/ecc-curve448-modp.asm   | 4 ++--
 x86_64/ecc-secp192r1-modp.asm  | 4 ++--
 x86_64/ecc-secp224r1-modp.asm  | 4 ++--
 x86_64/ecc-secp256r1-redc.asm  | 4 ++--
 x86_64/ecc-secp384r1-modp.asm  | 4 ++--
 x86_64/ecc-secp521r1-modp.asm  | 4 ++--
 19 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/arm/ecc-secp192r1-modp.asm b/arm/ecc-secp192r1-modp.asm
index dbaae2e3..4680336f 100644
--- a/arm/ecc-secp192r1-modp.asm
+++ b/arm/ecc-secp192r1-modp.asm
@@ -53,7 +53,7 @@ define(<C4>, <r12>)
 	.text
 	.align 2
 
-PROLOGUE(nettle_ecc_192_modp)
+PROLOGUE(_nettle_ecc_192_modp)
 	push	{r4,r5,r6,r7,r8,r10}
 	C Reduce two words at a time
 	add	HP, RP, #48
@@ -103,4 +103,4 @@ PROLOGUE(nettle_ecc_192_modp)
 
 	pop	{r4,r5,r6,r7,r8,r10}
 	bx	lr
-EPILOGUE(nettle_ecc_192_modp)
+EPILOGUE(_nettle_ecc_192_modp)
diff --git a/arm/ecc-secp224r1-modp.asm b/arm/ecc-secp224r1-modp.asm
index 2c86755a..400b7a81 100644
--- a/arm/ecc-secp224r1-modp.asm
+++ b/arm/ecc-secp224r1-modp.asm
@@ -52,7 +52,7 @@ define(<L2>, <lr>)
 	.text
 	.align 2
 
-PROLOGUE(nettle_ecc_224_modp)
+PROLOGUE(_nettle_ecc_224_modp)
 	push	{r4,r5,r6,r7,r8,r10,r11,lr}
 
 	add	L2, RP, #28
@@ -121,4 +121,4 @@ PROLOGUE(nettle_ecc_224_modp)
 	stmdb	RP, {T0,T1,T2,T3,T4,T5,T6}
 
 	pop	{r4,r5,r6,r7,r8,r10,r11,pc}
-EPILOGUE(nettle_ecc_224_modp)
+EPILOGUE(_nettle_ecc_224_modp)
diff --git a/arm/ecc-secp256r1-redc.asm b/arm/ecc-secp256r1-redc.asm
index 9c20062a..7b117de4 100644
--- a/arm/ecc-secp256r1-redc.asm
+++ b/arm/ecc-secp256r1-redc.asm
@@ -52,7 +52,7 @@ define(<F3>, <lr>)
 	.text
 	.align 2
 
-PROLOGUE(nettle_ecc_256_redc)
+PROLOGUE(_nettle_ecc_256_redc)
 	push	{r4,r5,r6,r7,r8,r10,r11,lr}
 
 	ldm	RP!, {T0,T1,T2,T3,T4,T5,T6,T7}
@@ -170,4 +170,4 @@ PROLOGUE(nettle_ecc_256_redc)
 	stm	RP, {T0,T1,T2,T3,T4,T5,T6,T7}
 
 	pop	{r4,r5,r6,r7,r8,r10,r11,pc}
-EPILOGUE(nettle_ecc_256_redc)
+EPILOGUE(_nettle_ecc_256_redc)
diff --git a/arm/ecc-secp384r1-modp.asm b/arm/ecc-secp384r1-modp.asm
index dbedbdf8..dd9a325b 100644
--- a/arm/ecc-secp384r1-modp.asm
+++ b/arm/ecc-secp384r1-modp.asm
@@ -50,7 +50,7 @@ define(<H>, <lr>)
 	.text
 	.align 2
 
-PROLOGUE(nettle_ecc_384_modp)
+PROLOGUE(_nettle_ecc_384_modp)
 	push	{r4,r5,r6,r7,r8,r10,lr}
 
 	add	RP, RP, #80
@@ -267,4 +267,4 @@ PROLOGUE(nettle_ecc_384_modp)
 	adcs	T3, T3, H
 	stm	RP!, {T0,T1,T2,T3}	C 8-11
 	pop	{r4,r5,r6,r7,r8,r10,pc}
-EPILOGUE(nettle_ecc_384_modp)
+EPILOGUE(_nettle_ecc_384_modp)
diff --git a/arm/ecc-secp521r1-modp.asm b/arm/ecc-secp521r1-modp.asm
index 2b4f7919..f1196763 100644
--- a/arm/ecc-secp521r1-modp.asm
+++ b/arm/ecc-secp521r1-modp.asm
@@ -52,7 +52,7 @@ define(<N>, <lr>)
 
 	.align 2
 
-PROLOGUE(nettle_ecc_521_modp)
+PROLOGUE(_nettle_ecc_521_modp)
 	push	{r4,r5,r6,r7,r8,lr}
 
 	C Use that B^17 = 2^23 (mod p)
@@ -124,4 +124,4 @@ PROLOGUE(nettle_ecc_521_modp)
 	stm	RP, {T0,T1,T2,F0,F1,F2,F3,H}	C 9-16
 
 	pop	{r4,r5,r6,r7,r8,pc}
-EPILOGUE(nettle_ecc_521_modp)
+EPILOGUE(_nettle_ecc_521_modp)
diff --git a/ecc-curve25519.c b/ecc-curve25519.c
index 73d72765..65843a57 100644
--- a/ecc-curve25519.c
+++ b/ecc-curve25519.c
@@ -48,7 +48,7 @@
 
 #if HAVE_NATIVE_ecc_25519_modp
 
-#define ecc_25519_modp nettle_ecc_25519_modp
+#define ecc_25519_modp _nettle_ecc_25519_modp
 void
 ecc_25519_modp (const struct ecc_modulo *m, mp_limb_t *rp);
 #else
diff --git a/ecc-curve448.c b/ecc-curve448.c
index 7020e3e8..981dc53f 100644
--- a/ecc-curve448.c
+++ b/ecc-curve448.c
@@ -46,7 +46,7 @@
 #include "ecc-curve448.h"
 
 #if HAVE_NATIVE_ecc_curve448_modp
-#define ecc_448_modp nettle_ecc_curve448_modp
+#define ecc_448_modp _nettle_ecc_curve448_modp
 void
 ecc_448_modp (const struct ecc_modulo *m, mp_limb_t *rp);
 #elif GMP_NUMB_BITS == 64
diff --git a/ecc-secp192r1.c b/ecc-secp192r1.c
index 858a1b75..15f5f1fa 100644
--- a/ecc-secp192r1.c
+++ b/ecc-secp192r1.c
@@ -50,7 +50,7 @@
 
 #if HAVE_NATIVE_ecc_192_modp
 
-#define ecc_192_modp nettle_ecc_192_modp
+#define ecc_192_modp _nettle_ecc_192_modp
 void
 ecc_192_modp (const struct ecc_modulo *m, mp_limb_t *rp);
 
diff --git a/ecc-secp224r1.c b/ecc-secp224r1.c
index 4d82f54b..28b938fa 100644
--- a/ecc-secp224r1.c
+++ b/ecc-secp224r1.c
@@ -43,7 +43,7 @@
 #if HAVE_NATIVE_ecc_224_modp
 
 #define USE_REDC 0
-#define ecc_224_modp nettle_ecc_224_modp
+#define ecc_224_modp _nettle_ecc_224_modp
 void
 ecc_224_modp (const struct ecc_modulo *m, mp_limb_t *rp);
 
diff --git a/ecc-secp256r1.c b/ecc-secp256r1.c
index 835c91d3..160a0479 100644
--- a/ecc-secp256r1.c
+++ b/ecc-secp256r1.c
@@ -51,7 +51,7 @@
 #include "ecc-secp256r1.h"
 
 #if HAVE_NATIVE_ecc_256_redc
-# define ecc_256_redc nettle_ecc_256_redc
+# define ecc_256_redc _nettle_ecc_256_redc
 void
 ecc_256_redc (const struct ecc_modulo *p, mp_limb_t *rp);
 #else /* !HAVE_NATIVE_ecc_256_redc */
diff --git a/ecc-secp384r1.c b/ecc-secp384r1.c
index 248b1cf3..32f75fb6 100644
--- a/ecc-secp384r1.c
+++ b/ecc-secp384r1.c
@@ -47,7 +47,7 @@
 #include "ecc-secp384r1.h"
 
 #if HAVE_NATIVE_ecc_384_modp
-#define ecc_384_modp nettle_ecc_384_modp
+#define ecc_384_modp _nettle_ecc_384_modp
 void
 ecc_384_modp (const struct ecc_modulo *m, mp_limb_t *rp);
 #elif GMP_NUMB_BITS == 32
diff --git a/ecc-secp521r1.c b/ecc-secp521r1.c
index cc747303..d952d77e 100644
--- a/ecc-secp521r1.c
+++ b/ecc-secp521r1.c
@@ -45,7 +45,7 @@
 #include "ecc-secp521r1.h"
 
 #if HAVE_NATIVE_ecc_521_modp
-#define ecc_521_modp nettle_ecc_521_modp
+#define ecc_521_modp _nettle_ecc_521_modp
 void
 ecc_521_modp (const struct ecc_modulo *m, mp_limb_t *rp);
 
diff --git a/x86_64/ecc-curve25519-modp.asm b/x86_64/ecc-curve25519-modp.asm
index 58c14fe0..0374db12 100644
--- a/x86_64/ecc-curve25519-modp.asm
+++ b/x86_64/ecc-curve25519-modp.asm
@@ -41,7 +41,7 @@ define(<T0>, <%r10>)
 define(<T1>, <%r11>)
 define(<M>, <%rbx>)
 
-PROLOGUE(nettle_ecc_25519_modp)
+PROLOGUE(_nettle_ecc_25519_modp)
 	W64_ENTRY(2, 0)
 	push	%rbx
 
@@ -91,4 +91,4 @@ PROLOGUE(nettle_ecc_25519_modp)
 	pop	%rbx
 	W64_EXIT(2, 0)
 	ret
-EPILOGUE(nettle_ecc_25519_modp)
+EPILOGUE(_nettle_ecc_25519_modp)
diff --git a/x86_64/ecc-curve448-modp.asm b/x86_64/ecc-curve448-modp.asm
index 1ca05a19..ea2e7886 100644
--- a/x86_64/ecc-curve448-modp.asm
+++ b/x86_64/ecc-curve448-modp.asm
@@ -45,7 +45,7 @@ define(<T0>, <%r10>)
 define(<T1>, <%r11>)
 define(<T2>, <%r12>)
 
-PROLOGUE(nettle_ecc_curve448_modp)
+PROLOGUE(_nettle_ecc_curve448_modp)
 	W64_ENTRY(2, 0)
 
 	push	%rbx
@@ -141,4 +141,4 @@ PROLOGUE(nettle_ecc_curve448_modp)
 
 	W64_EXIT(2, 0)
 	ret
-EPILOGUE(nettle_ecc_curve448_modp)
+EPILOGUE(_nettle_ecc_curve448_modp)
diff --git a/x86_64/ecc-secp192r1-modp.asm b/x86_64/ecc-secp192r1-modp.asm
index 644ed60c..ad8dca71 100644
--- a/x86_64/ecc-secp192r1-modp.asm
+++ b/x86_64/ecc-secp192r1-modp.asm
@@ -44,7 +44,7 @@ define(<C2>, <%r11>)
 	C ecc_192_modp (const struct ecc_modulo *m, mp_limb_t *rp)
 	.text
 	ALIGN(16)
-PROLOGUE(nettle_ecc_192_modp)
+PROLOGUE(_nettle_ecc_192_modp)
 	W64_ENTRY(2, 0)
 	mov	16(RP), T2
 	mov	24(RP), T3
@@ -85,4 +85,4 @@ PROLOGUE(nettle_ecc_192_modp)
 
 	W64_EXIT(2, 0)
 	ret
-EPILOGUE(nettle_ecc_192_modp)
+EPILOGUE(_nettle_ecc_192_modp)
diff --git a/x86_64/ecc-secp224r1-modp.asm b/x86_64/ecc-secp224r1-modp.asm
index ca164ac7..e44b5418 100644
--- a/x86_64/ecc-secp224r1-modp.asm
+++ b/x86_64/ecc-secp224r1-modp.asm
@@ -45,7 +45,7 @@ define(<F1>, <%r10>)
 define(<F2>, <%r11>)
 
 	C ecc_224_modp (const struct ecc_modulo *m, mp_limb_t *rp)
-PROLOGUE(nettle_ecc_224_modp)
+PROLOGUE(_nettle_ecc_224_modp)
 	W64_ENTRY(2, 0)
 	mov	48(RP), H0
 	mov	56(RP), H1
@@ -128,4 +128,4 @@ PROLOGUE(nettle_ecc_224_modp)
 
 	W64_EXIT(2, 0)
 	ret
-EPILOGUE(nettle_ecc_224_modp)
+EPILOGUE(_nettle_ecc_224_modp)
diff --git a/x86_64/ecc-secp256r1-redc.asm b/x86_64/ecc-secp256r1-redc.asm
index ee689cd6..533a1766 100644
--- a/x86_64/ecc-secp256r1-redc.asm
+++ b/x86_64/ecc-secp256r1-redc.asm
@@ -58,7 +58,7 @@ define(<FOLD>, <
 	sbb	$1, F2
 	sbb	<$>0, F3
 >)
-PROLOGUE(nettle_ecc_256_redc)
+PROLOGUE(_nettle_ecc_256_redc)
 	W64_ENTRY(2, 0)
 	C save all registers that need to be saved
 	push	%rbx
@@ -126,4 +126,4 @@ PROLOGUE(nettle_ecc_256_redc)
 	pop	%rbx
 	W64_EXIT(2, 0)
 	ret
-EPILOGUE(nettle_ecc_256_redc)
+EPILOGUE(_nettle_ecc_256_redc)
diff --git a/x86_64/ecc-secp384r1-modp.asm b/x86_64/ecc-secp384r1-modp.asm
index 3c8ec3f4..13f469b1 100644
--- a/x86_64/ecc-secp384r1-modp.asm
+++ b/x86_64/ecc-secp384r1-modp.asm
@@ -51,7 +51,7 @@ define(<C0>, H5)	C Overlap
 define(<TMP>, RP)	C Overlap
 
 
-PROLOGUE(nettle_ecc_384_modp)
+PROLOGUE(_nettle_ecc_384_modp)
 	W64_ENTRY(2, 0)
 
 	push	%rbx
@@ -231,4 +231,4 @@ PROLOGUE(nettle_ecc_384_modp)
 
 	W64_EXIT(2, 0)
 	ret
-EPILOGUE(nettle_ecc_384_modp)
+EPILOGUE(_nettle_ecc_384_modp)
diff --git a/x86_64/ecc-secp521r1-modp.asm b/x86_64/ecc-secp521r1-modp.asm
index 43a8cb8c..6f4f7d90 100644
--- a/x86_64/ecc-secp521r1-modp.asm
+++ b/x86_64/ecc-secp521r1-modp.asm
@@ -48,7 +48,7 @@ define(<U9>, <%r11>)
 define(<T0>, <%r12>)
 define(<T1>, <%r13>)
 
-PROLOGUE(nettle_ecc_521_modp)
+PROLOGUE(_nettle_ecc_521_modp)
 	W64_ENTRY(2, 0)
 	push	%rbx
 	push	%rbp
@@ -155,4 +155,4 @@ PROLOGUE(nettle_ecc_521_modp)
 	pop	%rbx
 	W64_EXIT(2, 0)
 	ret
-EPILOGUE(nettle_ecc_521_modp)
+EPILOGUE(_nettle_ecc_521_modp)
-- 
GitLab