edwards25519
library
Properties
order
↔ List <int >
order is the order of Curve25519 in little-endian form.
getter/setter pair
zero
↔ FieldElement
getter/setter pair
Functions
equal (int b , int c )
→ int
equal returns 1 if b == c and 0 otherwise, assuming that b and c are
non-negative.
FeAdd (FieldElement dst , FieldElement a , FieldElement b )
→ void
FeCMove (FieldElement f , FieldElement g , int b )
→ void
Replace (f,g) with (g,g) if b == 1;
replace (f,g) with (f,g) if b == 0.
FeCombine (FieldElement h , int h0 , int h1 , int h2 , int h3 , int h4 , int h5 , int h6 , int h7 , int h8 , int h9 )
→ void
FeCopy (FieldElement dst , FieldElement src )
→ void
FeFromBytes (FieldElement dst , Uint8List src )
→ void
FeInvert (FieldElement out , FieldElement z )
→ void
FeIsNegative (FieldElement f )
→ int
FeIsNonZero (FieldElement f )
→ int
FeMul (FieldElement h , dynamic f , dynamic g )
→ void
FeMul calculates h = f * g
Can overlap h with f or g.
FeNeg (FieldElement h , FieldElement f )
→ void
FeNeg sets h = -f
FeOne (FieldElement fe )
→ void
fePow22523 (FieldElement out , FieldElement z )
→ void
feSquare (dynamic f )
→ List <int ? >
FeSquare (FieldElement h , FieldElement f )
→ void
FeSquare calculates h = f*f. Can overlap h with f.
FeSquare2 (FieldElement h , FieldElement f )
→ void
FeSquare2 sets h = 2 * f * f
FeSub (FieldElement dst , FieldElement a , FieldElement b )
→ void
FeToBytes (Uint8List s , FieldElement h )
→ void
FeToBytes marshals h to s.
Preconditions:
|h| bounded by 1.12^25,1.1 2^24,1.12^25,1.1 2^24,etc.
FeZero (FieldElement fe )
→ void
fieldElementCopy (FieldElement src , int srcPos , FieldElement dest , int destPos , int length )
→ void
fieldElementFullCopy (FieldElement src , FieldElement dest )
→ void
geAdd (CompletedGroupElement r , ExtendedGroupElement p , CachedGroupElement q )
→ void
GeDoubleScalarMultVartime (ProjectiveGroupElement r , Uint8List a , ExtendedGroupElement A , Uint8List b )
→ void
GeDoubleScalarMultVartime sets r = aA + b B
where a = a0
+256a1
+...+256^31 a31
.
and b = b0
+256 b1
+...+256^31 b31
.
B is the Ed25519 base point (x,4/5) with x positive.
geMixedAdd (CompletedGroupElement r , ExtendedGroupElement p , PreComputedGroupElement q )
→ void
geMixedSub (CompletedGroupElement r , ExtendedGroupElement p , PreComputedGroupElement q )
→ void
GeScalarMultBase (ExtendedGroupElement h , Uint8List a )
→ void
GeScalarMultBase computes h = aB, where
a = a0
+256 a1
+...+256^31 a31
B is the Ed25519 base point (x,4/5) with x positive.
GeScalarMultVartime (ProjectiveGroupElement r , Uint8List a , ExtendedGroupElement A )
→ void
geSub (CompletedGroupElement r , ExtendedGroupElement p , CachedGroupElement q )
→ void
InvertModL (Uint8List z )
→ Uint8List
///////////////////SPACEMESH SPECIFIC////////////////////////
load3 (Uint8List input )
→ int
load4 (Uint8List input )
→ int
multModL (dynamic out , dynamic z , Uint8List w )
→ void
negative (int b )
→ int
negative returns 1 if b < 0 and 0 otherwise.
PreComputedGroupElementCMove (PreComputedGroupElement t , PreComputedGroupElement u , int b )
→ void
ScMinimal (Uint8List scalar )
→ bool
ScMinimal returns true if the given scalar is less than the order of the
curve.
ScMul (Uint8List s , Uint8List a , Uint8List b )
→ void
ScMulAdd (Uint8List s , Uint8List a , Uint8List b , Uint8List c )
→ void
The scalars are GF(2^252 + 27742317777372353535851937790883648493).
Input:
a0
+256a1
+...+256^31 a31
= a
b0
+256b1
+...+256^31 b31
= b
c0
+256c1
+...+256^31 c31
= c
ScReduce (Uint8List out , Uint8List s )
→ void
Input:
s0
+256s1
+...+256^63 s63
= s
selectPoint (PreComputedGroupElement t , int pos , int b )
→ void
slide (Int8List r , Uint8List a )
→ void
squareModL (dynamic out , Uint8List z )
→ void
Uint64 (Uint8List b )
→ int