forked from ANSSI-FR/libecc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathec_edwards.h
40 lines (35 loc) · 1.12 KB
/
ec_edwards.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
* Copyright (C) 2017 - This file is part of libecc project
*
* Authors:
* Ryad BENADJILA <ryadbenadjila@gmail.com>
* Arnaud EBALARD <arnaud.ebalard@ssi.gouv.fr>
* Jean-Pierre FLORI <jean-pierre.flori@ssi.gouv.fr>
*
* Contributors:
* Nicolas VIVET <nicolas.vivet@ssi.gouv.fr>
* Karim KHALFALLAH <karim.khalfallah@ssi.gouv.fr>
*
* This software is licensed under a dual BSD and GPL v2 license.
* See LICENSE file at the root folder of the project.
*/
#ifndef __EC_EDWARDS_H__
#define __EC_EDWARDS_H__
#include "../nn/nn.h"
#include "../fp/fp.h"
#include "../fp/fp_add.h"
#include "../fp/fp_mul.h"
#include "../fp/fp_mul_redc1.h"
typedef struct {
fp a;
fp d;
nn order;
word_t magic;
} ec_edwards_crv;
typedef ec_edwards_crv *ec_edwards_crv_t;
typedef const ec_edwards_crv *ec_edwards_crv_src_t;
int ec_edwards_crv_is_initialized(ec_edwards_crv_src_t crv);
void ec_edwards_crv_check_initialized(ec_edwards_crv_src_t crv);
void ec_edwards_crv_init(ec_edwards_crv_t crv, fp_src_t a, fp_src_t b, nn_src_t order);
void ec_edwards_crv_uninit(ec_edwards_crv_t crv);
#endif /* __EC_EDWARDS_H__ */