1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-21 13:58:08 +00:00
trezor-firmware/crypto/ed25519-donna/ed25519-donna.h

53 lines
1.2 KiB
C
Raw Normal View History

2016-04-22 15:47:48 +00:00
/*
Public domain by Andrew M. <liquidsun@gmail.com>
Modified from the amd64-51-30k implementation by
Daniel J. Bernstein
Niels Duif
Tanja Lange
Peter Schwabe
Bo-Yin Yang
*/
2018-07-31 12:20:18 +00:00
#ifndef ED25519_DONNA_H
#define ED25519_DONNA_H
2016-04-22 15:47:48 +00:00
#include "ed25519-donna-portable.h"
2017-03-28 16:32:58 +00:00
#include "curve25519-donna-32bit.h"
2016-04-22 15:47:48 +00:00
#include "curve25519-donna-helpers.h"
2017-03-28 16:32:58 +00:00
#include "modm-donna-32bit.h"
2016-04-22 15:47:48 +00:00
typedef unsigned char hash_512bits[64];
/*
* Arithmetic on the twisted Edwards curve -x^2 + y^2 = 1 + dx^2y^2
* with d = -(121665/121666) = 37095705934669439343138083508754565189542113879843219016388785533085940283555
* Base point: (15112221349535400772501151409588531511454012693041857206046113283949847762202,46316835694926478169428394003475163141307993866256225615783033603165251855960);
*/
typedef struct ge25519_t {
bignum25519 x, y, z, t;
} ge25519;
typedef struct ge25519_p1p1_t {
bignum25519 x, y, z, t;
} ge25519_p1p1;
typedef struct ge25519_niels_t {
bignum25519 ysubx, xaddy, t2d;
} ge25519_niels;
typedef struct ge25519_pniels_t {
bignum25519 ysubx, xaddy, z, t2d;
} ge25519_pniels;
#include "ed25519-donna-basepoint-table.h"
2017-03-28 16:32:58 +00:00
#include "ed25519-donna-32bit-tables.h"
2016-04-22 15:47:48 +00:00
2017-03-28 16:32:58 +00:00
#include "ed25519-donna-impl-base.h"
2018-07-31 12:20:18 +00:00
#endif