affine.h
This commit is contained in:
8
src/affine.h
Normal file
8
src/affine.h
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
/**
|
||||||
|
* @brief Affine coordinates
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
bn256 x[1];
|
||||||
|
bn256 y[1];
|
||||||
|
} ac;
|
||||||
@@ -26,6 +26,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "bn.h"
|
#include "bn.h"
|
||||||
|
#include "affine.h"
|
||||||
#include "jpc-ac_p256k1.h"
|
#include "jpc-ac_p256k1.h"
|
||||||
#include "ec_p256k1.h"
|
#include "ec_p256k1.h"
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "bn.h"
|
#include "bn.h"
|
||||||
|
#include "affine.h"
|
||||||
#include "jpc-ac_p256r1.h"
|
#include "jpc-ac_p256r1.h"
|
||||||
#include "ec_p256r1.h"
|
#include "ec_p256r1.h"
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "bn.h"
|
#include "bn.h"
|
||||||
#include "modp256k1.h"
|
#include "modp256k1.h"
|
||||||
|
#include "affine.h"
|
||||||
#include "jpc-ac_p256k1.h"
|
#include "jpc-ac_p256k1.h"
|
||||||
#include "mod.h"
|
#include "mod.h"
|
||||||
#include "ec_p256k1.h"
|
#include "ec_p256k1.h"
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "bn.h"
|
#include "bn.h"
|
||||||
#include "modp256r1.h"
|
#include "modp256r1.h"
|
||||||
|
#include "affine.h"
|
||||||
#include "jpc-ac_p256r1.h"
|
#include "jpc-ac_p256r1.h"
|
||||||
#include "mod.h"
|
#include "mod.h"
|
||||||
#include "ec_p256r1.h"
|
#include "ec_p256r1.h"
|
||||||
|
|||||||
@@ -8,15 +8,6 @@ typedef struct
|
|||||||
bn256 z[1];
|
bn256 z[1];
|
||||||
} jpc;
|
} jpc;
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Affin coordinates
|
|
||||||
*/
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
bn256 x[1];
|
|
||||||
bn256 y[1];
|
|
||||||
} ac;
|
|
||||||
|
|
||||||
void jpc_double_p256k1 (jpc *X, const jpc *A);
|
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_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);
|
void jpc_add_ac_signed_p256k1 (jpc *X, const jpc *A, const ac *B, int minus);
|
||||||
|
|||||||
@@ -8,15 +8,6 @@ typedef struct
|
|||||||
bn256 z[1];
|
bn256 z[1];
|
||||||
} jpc;
|
} jpc;
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Affin coordinates
|
|
||||||
*/
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
bn256 x[1];
|
|
||||||
bn256 y[1];
|
|
||||||
} ac;
|
|
||||||
|
|
||||||
void jpc_double_p256r1 (jpc *X, const jpc *A);
|
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_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);
|
void jpc_add_ac_signed_p256r1 (jpc *X, const jpc *A, const ac *B, int minus);
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "bn.h"
|
#include "bn.h"
|
||||||
#include "modp256k1.h"
|
#include "modp256k1.h"
|
||||||
|
#include "affine.h"
|
||||||
#include "jpc-ac_p256k1.h"
|
#include "jpc-ac_p256k1.h"
|
||||||
|
|
||||||
#define FIELD p256k1
|
#define FIELD p256k1
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "bn.h"
|
#include "bn.h"
|
||||||
#include "modp256r1.h"
|
#include "modp256r1.h"
|
||||||
|
#include "affine.h"
|
||||||
#include "jpc-ac_p256r1.h"
|
#include "jpc-ac_p256r1.h"
|
||||||
|
|
||||||
#define FIELD p256r1
|
#define FIELD p256r1
|
||||||
|
|||||||
Reference in New Issue
Block a user