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>)
.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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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
......
......@@ -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
......
......@@ -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);
......
......@@ -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);
......
......@@ -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 */
......
......@@ -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
......
......@@ -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);
......
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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)
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