From 971ee94d8f4efa285244dcb04c28032b9ec522af Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Tue, 18 Mar 2014 15:13:56 +0900 Subject: [PATCH] affine.h --- src/affine.h | 8 ++++++++ src/call-ec_p256k1.c | 1 + src/call-ec_p256r1.c | 1 + src/ec_p256k1.c | 1 + src/ec_p256r1.c | 1 + src/jpc-ac_p256k1.h | 9 --------- src/jpc-ac_p256r1.h | 9 --------- src/jpc_p256k1.c | 1 + src/jpc_p256r1.c | 1 + 9 files changed, 14 insertions(+), 18 deletions(-) create mode 100644 src/affine.h diff --git a/src/affine.h b/src/affine.h new file mode 100644 index 0000000..2f6e875 --- /dev/null +++ b/src/affine.h @@ -0,0 +1,8 @@ +/** + * @brief Affine coordinates + */ +typedef struct +{ + bn256 x[1]; + bn256 y[1]; +} ac; diff --git a/src/call-ec_p256k1.c b/src/call-ec_p256k1.c index 1a83ce5..a4908df 100644 --- a/src/call-ec_p256k1.c +++ b/src/call-ec_p256k1.c @@ -26,6 +26,7 @@ #include #include #include "bn.h" +#include "affine.h" #include "jpc-ac_p256k1.h" #include "ec_p256k1.h" diff --git a/src/call-ec_p256r1.c b/src/call-ec_p256r1.c index 6b9a6c2..e9fa040 100644 --- a/src/call-ec_p256r1.c +++ b/src/call-ec_p256r1.c @@ -26,6 +26,7 @@ #include #include #include "bn.h" +#include "affine.h" #include "jpc-ac_p256r1.h" #include "ec_p256r1.h" diff --git a/src/ec_p256k1.c b/src/ec_p256k1.c index dba5670..fe82a49 100644 --- a/src/ec_p256k1.c +++ b/src/ec_p256k1.c @@ -25,6 +25,7 @@ #include #include "bn.h" #include "modp256k1.h" +#include "affine.h" #include "jpc-ac_p256k1.h" #include "mod.h" #include "ec_p256k1.h" diff --git a/src/ec_p256r1.c b/src/ec_p256r1.c index 46e37a2..07bd66c 100644 --- a/src/ec_p256r1.c +++ b/src/ec_p256r1.c @@ -25,6 +25,7 @@ #include #include "bn.h" #include "modp256r1.h" +#include "affine.h" #include "jpc-ac_p256r1.h" #include "mod.h" #include "ec_p256r1.h" diff --git a/src/jpc-ac_p256k1.h b/src/jpc-ac_p256k1.h index a614350..d8624bd 100644 --- a/src/jpc-ac_p256k1.h +++ b/src/jpc-ac_p256k1.h @@ -8,15 +8,6 @@ typedef struct bn256 z[1]; } jpc; -/** - * @brief Affin coordinates - */ -typedef struct -{ - bn256 x[1]; - bn256 y[1]; -} ac; - void jpc_double_p256k1 (jpc *X, const jpc *A); void jpc_add_ac_p256k1 (jpc *X, const jpc *A, const ac *B); void jpc_add_ac_signed_p256k1 (jpc *X, const jpc *A, const ac *B, int minus); diff --git a/src/jpc-ac_p256r1.h b/src/jpc-ac_p256r1.h index 5a4116f..e235089 100644 --- a/src/jpc-ac_p256r1.h +++ b/src/jpc-ac_p256r1.h @@ -8,15 +8,6 @@ typedef struct bn256 z[1]; } jpc; -/** - * @brief Affin coordinates - */ -typedef struct -{ - bn256 x[1]; - bn256 y[1]; -} ac; - void jpc_double_p256r1 (jpc *X, const jpc *A); void jpc_add_ac_p256r1 (jpc *X, const jpc *A, const ac *B); void jpc_add_ac_signed_p256r1 (jpc *X, const jpc *A, const ac *B, int minus); diff --git a/src/jpc_p256k1.c b/src/jpc_p256k1.c index ed72c47..dd6b30d 100644 --- a/src/jpc_p256k1.c +++ b/src/jpc_p256k1.c @@ -25,6 +25,7 @@ #include #include "bn.h" #include "modp256k1.h" +#include "affine.h" #include "jpc-ac_p256k1.h" #define FIELD p256k1 diff --git a/src/jpc_p256r1.c b/src/jpc_p256r1.c index 656fe27..63b52d7 100644 --- a/src/jpc_p256r1.c +++ b/src/jpc_p256r1.c @@ -25,6 +25,7 @@ #include #include "bn.h" #include "modp256r1.h" +#include "affine.h" #include "jpc-ac_p256r1.h" #define FIELD p256r1