-
Notifications
You must be signed in to change notification settings - Fork 331
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge ed25519 authentication into master.
- Loading branch information
Showing
48 changed files
with
4,081 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
INSTALL SONAME 'auth_ed25519'; | ||
CREATE USER 'ed25519user'@'%' IDENTIFIED VIA ed25519 USING PASSWORD('Ed255!9'); | ||
GRANT ALL PRIVILEGES ON *.* TO 'ed25519user'@'%'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/MySqlConnector.Authentication.Ed25519/Chaos.NaCl/Internal/Ed25519Ref10/FieldElement.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System; | ||
|
||
namespace Chaos.NaCl.Internal.Ed25519Ref10 | ||
{ | ||
internal struct FieldElement | ||
{ | ||
internal int x0; | ||
internal int x1; | ||
internal int x2; | ||
internal int x3; | ||
internal int x4; | ||
internal int x5; | ||
internal int x6; | ||
internal int x7; | ||
internal int x8; | ||
internal int x9; | ||
|
||
//public static readonly FieldElement Zero = new FieldElement(); | ||
//public static readonly FieldElement One = new FieldElement() { x0 = 1 }; | ||
|
||
internal FieldElement(params int[] elements) | ||
{ | ||
InternalAssert.Assert(elements.Length == 10, "elements.Length != 10"); | ||
x0 = elements[0]; | ||
x1 = elements[1]; | ||
x2 = elements[2]; | ||
x3 = elements[3]; | ||
x4 = elements[4]; | ||
x5 = elements[5]; | ||
x6 = elements[6]; | ||
x7 = elements[7]; | ||
x8 = elements[8]; | ||
x9 = elements[9]; | ||
} | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
src/MySqlConnector.Authentication.Ed25519/Chaos.NaCl/Internal/Ed25519Ref10/GroupElement.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
using System; | ||
|
||
namespace Chaos.NaCl.Internal.Ed25519Ref10 | ||
{ | ||
/* | ||
ge means group element. | ||
Here the group is the set of pairs (x,y) of field elements (see fe.h) | ||
satisfying -x^2 + y^2 = 1 + d x^2y^2 | ||
where d = -121665/121666. | ||
Representations: | ||
ge_p2 (projective): (X:Y:Z) satisfying x=X/Z, y=Y/Z | ||
ge_p3 (extended): (X:Y:Z:T) satisfying x=X/Z, y=Y/Z, XY=ZT | ||
ge_p1p1 (completed): ((X:Z),(Y:T)) satisfying x=X/Z, y=Y/T | ||
ge_precomp (Duif): (y+x,y-x,2dxy) | ||
*/ | ||
|
||
internal struct GroupElementP2 | ||
{ | ||
public FieldElement X; | ||
public FieldElement Y; | ||
public FieldElement Z; | ||
} ; | ||
|
||
internal struct GroupElementP3 | ||
{ | ||
public FieldElement X; | ||
public FieldElement Y; | ||
public FieldElement Z; | ||
public FieldElement T; | ||
} ; | ||
|
||
internal struct GroupElementP1P1 | ||
{ | ||
public FieldElement X; | ||
public FieldElement Y; | ||
public FieldElement Z; | ||
public FieldElement T; | ||
} ; | ||
|
||
internal struct GroupElementPreComp | ||
{ | ||
public FieldElement yplusx; | ||
public FieldElement yminusx; | ||
public FieldElement xy2d; | ||
|
||
public GroupElementPreComp(FieldElement yplusx, FieldElement yminusx, FieldElement xy2d) | ||
{ | ||
this.yplusx = yplusx; | ||
this.yminusx = yminusx; | ||
this.xy2d = xy2d; | ||
} | ||
} ; | ||
} |
Oops, something went wrong.