Commit 34fbd991 authored by Dmitry Baryshkov's avatar Dmitry Baryshkov Committed by Niels Möller

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 Baryshkov's avatarDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
parent abfaf8be
...@@ -53,7 +53,7 @@ define(<C4>, <r12>) ...@@ -53,7 +53,7 @@ define(<C4>, <r12>)
.text .text
.align 2 .align 2
PROLOGUE(nettle_ecc_192_modp) PROLOGUE(_nettle_ecc_192_modp)
push {r4,r5,r6,r7,r8,r10} push {r4,r5,r6,r7,r8,r10}
C Reduce two words at a time C Reduce two words at a time
add HP, RP, #48 add HP, RP, #48
...@@ -103,4 +103,4 @@ PROLOGUE(nettle_ecc_192_modp) ...@@ -103,4 +103,4 @@ PROLOGUE(nettle_ecc_192_modp)
pop {r4,r5,r6,r7,r8,r10} pop {r4,r5,r6,r7,r8,r10}
bx lr bx lr
EPILOGUE(nettle_ecc_192_modp) EPILOGUE(_nettle_ecc_192_modp)
...@@ -52,7 +52,7 @@ define(<L2>, <lr>) ...@@ -52,7 +52,7 @@ define(<L2>, <lr>)
.text .text
.align 2 .align 2
PROLOGUE(nettle_ecc_224_modp) PROLOGUE(_nettle_ecc_224_modp)
push {r4,r5,r6,r7,r8,r10,r11,lr} push {r4,r5,r6,r7,r8,r10,r11,lr}
add L2, RP, #28 add L2, RP, #28
...@@ -121,4 +121,4 @@ PROLOGUE(nettle_ecc_224_modp) ...@@ -121,4 +121,4 @@ PROLOGUE(nettle_ecc_224_modp)
stmdb RP, {T0,T1,T2,T3,T4,T5,T6} stmdb RP, {T0,T1,T2,T3,T4,T5,T6}
pop {r4,r5,r6,r7,r8,r10,r11,pc} pop {r4,r5,r6,r7,r8,r10,r11,pc}
EPILOGUE(nettle_ecc_224_modp) EPILOGUE(_nettle_ecc_224_modp)
...@@ -52,7 +52,7 @@ define(<F3>, <lr>) ...@@ -52,7 +52,7 @@ define(<F3>, <lr>)
.text .text
.align 2 .align 2
PROLOGUE(nettle_ecc_256_redc) PROLOGUE(_nettle_ecc_256_redc)
push {r4,r5,r6,r7,r8,r10,r11,lr} push {r4,r5,r6,r7,r8,r10,r11,lr}
ldm RP!, {T0,T1,T2,T3,T4,T5,T6,T7} ldm RP!, {T0,T1,T2,T3,T4,T5,T6,T7}
...@@ -170,4 +170,4 @@ PROLOGUE(nettle_ecc_256_redc) ...@@ -170,4 +170,4 @@ PROLOGUE(nettle_ecc_256_redc)
stm RP, {T0,T1,T2,T3,T4,T5,T6,T7} stm RP, {T0,T1,T2,T3,T4,T5,T6,T7}
pop {r4,r5,r6,r7,r8,r10,r11,pc} pop {r4,r5,r6,r7,r8,r10,r11,pc}
EPILOGUE(nettle_ecc_256_redc) EPILOGUE(_nettle_ecc_256_redc)
...@@ -50,7 +50,7 @@ define(<H>, <lr>) ...@@ -50,7 +50,7 @@ define(<H>, <lr>)
.text .text
.align 2 .align 2
PROLOGUE(nettle_ecc_384_modp) PROLOGUE(_nettle_ecc_384_modp)
push {r4,r5,r6,r7,r8,r10,lr} push {r4,r5,r6,r7,r8,r10,lr}
add RP, RP, #80 add RP, RP, #80
...@@ -267,4 +267,4 @@ PROLOGUE(nettle_ecc_384_modp) ...@@ -267,4 +267,4 @@ PROLOGUE(nettle_ecc_384_modp)
adcs T3, T3, H adcs T3, T3, H
stm RP!, {T0,T1,T2,T3} C 8-11 stm RP!, {T0,T1,T2,T3} C 8-11
pop {r4,r5,r6,r7,r8,r10,pc} pop {r4,r5,r6,r7,r8,r10,pc}
EPILOGUE(nettle_ecc_384_modp) EPILOGUE(_nettle_ecc_384_modp)
...@@ -52,7 +52,7 @@ define(<N>, <lr>) ...@@ -52,7 +52,7 @@ define(<N>, <lr>)
.align 2 .align 2
PROLOGUE(nettle_ecc_521_modp) PROLOGUE(_nettle_ecc_521_modp)
push {r4,r5,r6,r7,r8,lr} push {r4,r5,r6,r7,r8,lr}
C Use that B^17 = 2^23 (mod p) C Use that B^17 = 2^23 (mod p)
...@@ -124,4 +124,4 @@ PROLOGUE(nettle_ecc_521_modp) ...@@ -124,4 +124,4 @@ PROLOGUE(nettle_ecc_521_modp)
stm RP, {T0,T1,T2,F0,F1,F2,F3,H} C 9-16 stm RP, {T0,T1,T2,F0,F1,F2,F3,H} C 9-16
pop {r4,r5,r6,r7,r8,pc} pop {r4,r5,r6,r7,r8,pc}
EPILOGUE(nettle_ecc_521_modp) EPILOGUE(_nettle_ecc_521_modp)
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
#if HAVE_NATIVE_ecc_25519_modp #if HAVE_NATIVE_ecc_25519_modp
#define ecc_25519_modp nettle_ecc_25519_modp #define ecc_25519_modp _nettle_ecc_25519_modp
void void
ecc_25519_modp (const struct ecc_modulo *m, mp_limb_t *rp); ecc_25519_modp (const struct ecc_modulo *m, mp_limb_t *rp);
#else #else
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
#include "ecc-curve448.h" #include "ecc-curve448.h"
#if HAVE_NATIVE_ecc_curve448_modp #if HAVE_NATIVE_ecc_curve448_modp
#define ecc_448_modp nettle_ecc_curve448_modp #define ecc_448_modp _nettle_ecc_curve448_modp
void void
ecc_448_modp (const struct ecc_modulo *m, mp_limb_t *rp); ecc_448_modp (const struct ecc_modulo *m, mp_limb_t *rp);
#elif GMP_NUMB_BITS == 64 #elif GMP_NUMB_BITS == 64
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
#if HAVE_NATIVE_ecc_192_modp #if HAVE_NATIVE_ecc_192_modp
#define ecc_192_modp nettle_ecc_192_modp #define ecc_192_modp _nettle_ecc_192_modp
void void
ecc_192_modp (const struct ecc_modulo *m, mp_limb_t *rp); ecc_192_modp (const struct ecc_modulo *m, mp_limb_t *rp);
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
#if HAVE_NATIVE_ecc_224_modp #if HAVE_NATIVE_ecc_224_modp
#define USE_REDC 0 #define USE_REDC 0
#define ecc_224_modp nettle_ecc_224_modp #define ecc_224_modp _nettle_ecc_224_modp
void void
ecc_224_modp (const struct ecc_modulo *m, mp_limb_t *rp); ecc_224_modp (const struct ecc_modulo *m, mp_limb_t *rp);
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
#include "ecc-secp256r1.h" #include "ecc-secp256r1.h"
#if HAVE_NATIVE_ecc_256_redc #if HAVE_NATIVE_ecc_256_redc
# define ecc_256_redc nettle_ecc_256_redc # define ecc_256_redc _nettle_ecc_256_redc
void void
ecc_256_redc (const struct ecc_modulo *p, mp_limb_t *rp); ecc_256_redc (const struct ecc_modulo *p, mp_limb_t *rp);
#else /* !HAVE_NATIVE_ecc_256_redc */ #else /* !HAVE_NATIVE_ecc_256_redc */
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
#include "ecc-secp384r1.h" #include "ecc-secp384r1.h"
#if HAVE_NATIVE_ecc_384_modp #if HAVE_NATIVE_ecc_384_modp
#define ecc_384_modp nettle_ecc_384_modp #define ecc_384_modp _nettle_ecc_384_modp
void void
ecc_384_modp (const struct ecc_modulo *m, mp_limb_t *rp); ecc_384_modp (const struct ecc_modulo *m, mp_limb_t *rp);
#elif GMP_NUMB_BITS == 32 #elif GMP_NUMB_BITS == 32
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
#include "ecc-secp521r1.h" #include "ecc-secp521r1.h"
#if HAVE_NATIVE_ecc_521_modp #if HAVE_NATIVE_ecc_521_modp
#define ecc_521_modp nettle_ecc_521_modp #define ecc_521_modp _nettle_ecc_521_modp
void void
ecc_521_modp (const struct ecc_modulo *m, mp_limb_t *rp); ecc_521_modp (const struct ecc_modulo *m, mp_limb_t *rp);
......
...@@ -41,7 +41,7 @@ define(<T0>, <%r10>) ...@@ -41,7 +41,7 @@ define(<T0>, <%r10>)
define(<T1>, <%r11>) define(<T1>, <%r11>)
define(<M>, <%rbx>) define(<M>, <%rbx>)
PROLOGUE(nettle_ecc_25519_modp) PROLOGUE(_nettle_ecc_25519_modp)
W64_ENTRY(2, 0) W64_ENTRY(2, 0)
push %rbx push %rbx
...@@ -91,4 +91,4 @@ PROLOGUE(nettle_ecc_25519_modp) ...@@ -91,4 +91,4 @@ PROLOGUE(nettle_ecc_25519_modp)
pop %rbx pop %rbx
W64_EXIT(2, 0) W64_EXIT(2, 0)
ret ret
EPILOGUE(nettle_ecc_25519_modp) EPILOGUE(_nettle_ecc_25519_modp)
...@@ -45,7 +45,7 @@ define(<T0>, <%r10>) ...@@ -45,7 +45,7 @@ define(<T0>, <%r10>)
define(<T1>, <%r11>) define(<T1>, <%r11>)
define(<T2>, <%r12>) define(<T2>, <%r12>)
PROLOGUE(nettle_ecc_curve448_modp) PROLOGUE(_nettle_ecc_curve448_modp)
W64_ENTRY(2, 0) W64_ENTRY(2, 0)
push %rbx push %rbx
...@@ -141,4 +141,4 @@ PROLOGUE(nettle_ecc_curve448_modp) ...@@ -141,4 +141,4 @@ PROLOGUE(nettle_ecc_curve448_modp)
W64_EXIT(2, 0) W64_EXIT(2, 0)
ret ret
EPILOGUE(nettle_ecc_curve448_modp) EPILOGUE(_nettle_ecc_curve448_modp)
...@@ -44,7 +44,7 @@ define(<C2>, <%r11>) ...@@ -44,7 +44,7 @@ define(<C2>, <%r11>)
C ecc_192_modp (const struct ecc_modulo *m, mp_limb_t *rp) C ecc_192_modp (const struct ecc_modulo *m, mp_limb_t *rp)
.text .text
ALIGN(16) ALIGN(16)
PROLOGUE(nettle_ecc_192_modp) PROLOGUE(_nettle_ecc_192_modp)
W64_ENTRY(2, 0) W64_ENTRY(2, 0)
mov 16(RP), T2 mov 16(RP), T2
mov 24(RP), T3 mov 24(RP), T3
...@@ -85,4 +85,4 @@ PROLOGUE(nettle_ecc_192_modp) ...@@ -85,4 +85,4 @@ PROLOGUE(nettle_ecc_192_modp)
W64_EXIT(2, 0) W64_EXIT(2, 0)
ret ret
EPILOGUE(nettle_ecc_192_modp) EPILOGUE(_nettle_ecc_192_modp)
...@@ -45,7 +45,7 @@ define(<F1>, <%r10>) ...@@ -45,7 +45,7 @@ define(<F1>, <%r10>)
define(<F2>, <%r11>) define(<F2>, <%r11>)
C ecc_224_modp (const struct ecc_modulo *m, mp_limb_t *rp) 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) W64_ENTRY(2, 0)
mov 48(RP), H0 mov 48(RP), H0
mov 56(RP), H1 mov 56(RP), H1
...@@ -128,4 +128,4 @@ PROLOGUE(nettle_ecc_224_modp) ...@@ -128,4 +128,4 @@ PROLOGUE(nettle_ecc_224_modp)
W64_EXIT(2, 0) W64_EXIT(2, 0)
ret ret
EPILOGUE(nettle_ecc_224_modp) EPILOGUE(_nettle_ecc_224_modp)
...@@ -58,7 +58,7 @@ define(<FOLD>, < ...@@ -58,7 +58,7 @@ define(<FOLD>, <
sbb $1, F2 sbb $1, F2
sbb <$>0, F3 sbb <$>0, F3
>) >)
PROLOGUE(nettle_ecc_256_redc) PROLOGUE(_nettle_ecc_256_redc)
W64_ENTRY(2, 0) W64_ENTRY(2, 0)
C save all registers that need to be saved C save all registers that need to be saved
push %rbx push %rbx
...@@ -126,4 +126,4 @@ PROLOGUE(nettle_ecc_256_redc) ...@@ -126,4 +126,4 @@ PROLOGUE(nettle_ecc_256_redc)
pop %rbx pop %rbx
W64_EXIT(2, 0) W64_EXIT(2, 0)
ret ret
EPILOGUE(nettle_ecc_256_redc) EPILOGUE(_nettle_ecc_256_redc)
...@@ -51,7 +51,7 @@ define(<C0>, H5) C Overlap ...@@ -51,7 +51,7 @@ define(<C0>, H5) C Overlap
define(<TMP>, RP) C Overlap define(<TMP>, RP) C Overlap
PROLOGUE(nettle_ecc_384_modp) PROLOGUE(_nettle_ecc_384_modp)
W64_ENTRY(2, 0) W64_ENTRY(2, 0)
push %rbx push %rbx
...@@ -231,4 +231,4 @@ PROLOGUE(nettle_ecc_384_modp) ...@@ -231,4 +231,4 @@ PROLOGUE(nettle_ecc_384_modp)
W64_EXIT(2, 0) W64_EXIT(2, 0)
ret ret
EPILOGUE(nettle_ecc_384_modp) EPILOGUE(_nettle_ecc_384_modp)
...@@ -48,7 +48,7 @@ define(<U9>, <%r11>) ...@@ -48,7 +48,7 @@ define(<U9>, <%r11>)
define(<T0>, <%r12>) define(<T0>, <%r12>)
define(<T1>, <%r13>) define(<T1>, <%r13>)
PROLOGUE(nettle_ecc_521_modp) PROLOGUE(_nettle_ecc_521_modp)
W64_ENTRY(2, 0) W64_ENTRY(2, 0)
push %rbx push %rbx
push %rbp push %rbp
...@@ -155,4 +155,4 @@ PROLOGUE(nettle_ecc_521_modp) ...@@ -155,4 +155,4 @@ PROLOGUE(nettle_ecc_521_modp)
pop %rbx pop %rbx
W64_EXIT(2, 0) W64_EXIT(2, 0)
ret ret
EPILOGUE(nettle_ecc_521_modp) EPILOGUE(_nettle_ecc_521_modp)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment