Effort free video editing!
# SPDX-License-Identifier: Apache-2.0 OR MIT
# Copyright (c) Status Research & Development GmbH
## This module implements ED25519.
## This is pure nim implementation of ED25519 ref10.
type
Fe* = array[10, int32]
GeP2* = object
x*, y*, z*: Fe
GeP3* = object
x*, y*, z*, t*: Fe
GeP1P1* = object
x*, y*, z*, t*: Fe
GePrecomp* = object
yplusx*, yminusx*, xy2d*: Fe
GeCached* = object
yplusx*, yminusx*, z*, t2d*: Fe
const
CurveOrder* = [
0xED'u8, 0xD3'u8, 0xF5'u8, 0x5C'u8, 0x1A'u8, 0x63'u8, 0x12'u8, 0x58'u8, 0xD6'u8,
0x9C'u8, 0xF7'u8, 0xA2'u8, 0xDE'u8, 0xF9'u8, 0xDE'u8, 0x14'u8, 0x00'u8, 0x00'u8,
0x00'u8, 0x00'u8, 0x00'u8, 0x00'u8, 0x00'u8, 0x00'u8, 0x00'u8, 0x00'u8, 0x00'u8,
0x00'u8, 0x00'u8, 0x00'u8, 0x00'u8, 0x10'u8,
]
ZeroFe* = [
0x00'u8, 0x00'u8, 0x00'u8, 0x00'u8, 0x00'u8, 0x00'u8, 0x00'u8, 0x00'u8, 0x00'u8,
0x00'u8, 0x00'u8, 0x00'u8, 0x00'u8, 0x00'u8, 0x00'u8, 0x00'u8, 0x00'u8, 0x00'u8,
0x00'u8, 0x00'u8, 0x00'u8, 0x00'u8, 0x00'u8, 0x00'u8, 0x00'u8, 0x00'u8, 0x00'u8,
0x00'u8, 0x00'u8, 0x00'u8, 0x00'u8, 0x00'u8,
]
BiPrecomp* = [
GePrecomp(
yplusx: [
25967493'i32, -14356035, 29566456, 3660896, -12694345, 4014787, 27544626,
-11754271, -6079156, 2047605,
],
yminusx: [
-12545711'i32, 934262, -2722910, 3049990, -727428, 9406986, 12720692, 5043384,
19500929, -15469378,
],
xy2d: [
-8738181'i32, 4489570, 9688441, -14785194, 10184609, -12363380, 29287919,
11864899, -24514362, -4438546,
],
),
GePrecomp(
yplusx: [
15636291'i32, -9688557, 24204773, -7912398, 616977, -16685262, 27787600,
-14772189, 28944400, -1550024,
],
yminusx: [
16568933'i32, 4717097, -11556148, -1102322, 15682896, -11807043, 16354577,
-11775962, 7689662, 11199574,
],
xy2d: [
30464156'i32, -5976125, -11779434, -15670865, 23220365, 15915852, 7512774,
10017326, -17749093, -9920357,
],
),
GePrecomp(
yplusx: [
10861363'i32, 11473154, 27284546, 1981175, -30064349, 12577861, 32867885,
14515107, -15438304, 10819380,
],
yminusx: [
4708026'i32, 6336745, 20377586, 9066809, -11272109, 6594696, -25653668,
12483688, -12668491, 5581306,
],
xy2d: [
19563160'i32, 16186464, -29386857, 4097519, 10237984, -4348115, 28542350,
13850243, -23678021, -15815942,
],
),
GePrecomp(
yplusx: [
5153746'i32, 9909285, 1723747, -2777874, 30523605, 5516873, 19480852, 5230134,
-23952439, -15175766,
],
yminusx: [
-30269007'i32, -3463509, 7665486, 10083793, 28475525, 1649722, 20654025,
16520125, 30598449, 7715701,
],
xy2d: [
28881845'i32, 14381568, 9657904, 3680757, -20181635, 7843316, -31400660,
1370708, 29794553, -1409300,
],
),
GePrecomp(
yplusx: [
-22518993'i32, -6692182, 14201702, -8745502, -23510406, 8844726, 18474211,
-1361450, -13062696, 13821877,
],
yminusx: [
-6455177'i32, -7839871, 3374702, -4740862, -27098617, -10571707, 31655028,
-7212327, 18853322, -14220951,
],
xy2d: [
4566830'i32, -12963868, -28974889, -12240689, -7602672, -2830569, -8514358,
-10431137, 2207753, -3209784,
],
),
GePrecomp(
yplusx: [
-25154831'i32, -4185821, 29681144, 7868801, -6854661, -9423865, -12437364,
-663000, -31111463, -16132436,
],
yminusx: [
25576264'i32, -2703214, 7349804, -11814844, 16472782, 9300885, 3844789,
15725684, 171356, 6466918,
],
xy2d: [
23103977'i32, 13316479, 9739013, -16149481, 817875, -15038942, 8965339,
-14088058, -30714912, 16193877,
],
),
GePrecomp(
yplusx: [
-33521811'i32, 3180713, -2394130, 14003687, -16903474, -16270840, 17238398,
4729455, -18074513, 9256800,
],
yminusx: [
-25182317'i32, -4174131, 32336398, 5036987, -21236817, 11360617, 22616405,
9761698, -19827198, 630305,
],
xy2d: [
-13720693'i32, 2639453, -24237460, -7406481, 9494427, -5774029, -6554551,
-15960994, -2449256, -14291300,
],
),
GePrecomp(
yplusx: [
-3151181'i32, -5046075, 9282714, 6866145, -31907062, -863023, -18940575,
15033784, 25105118, -7894876,
],
yminusx: [
-24326370'i32, 15950226, -31801215, -14592823, -11662737, -5090925, 1573892,
-2625887, 2198790, -15804619,
],
xy2d: [
-3099351'i32, 10324967, -2241613, 7453183, -5446979, -2735503, -13812022,
-16236442, -32461234, -12290683,
],
),
]
DConst* = [
-10913610'i32, 13857413, -15372611, 6949391, 114729, -8787816, -6275908, -3247719,
-18696448, -12055116,
]
D2Const* = [
-21827239'i32, -5839606, -30745221, 13898782, 229458, 15978800, -12551817, -6495438,
29715968, 9444199,
]
SqrTm1* = [
-32595792'i32, -7943725, 9377950, 3500415, 12389472, -272473, -25146209, -2005654,
326686, 11406482,
]