Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
kamel78 authored Nov 8, 2018
1 parent cd8b32b commit adfdb56
Show file tree
Hide file tree
Showing 24 changed files with 8,331 additions and 0 deletions.
520 changes: 520 additions & 0 deletions Extension Fields/FP4Arithmetic.pas

Large diffs are not rendered by default.

411 changes: 411 additions & 0 deletions Extension Fields/FP8Arithmetic.pas

Large diffs are not rendered by default.

687 changes: 687 additions & 0 deletions Extension Fields/FP9Arithmetic.pas

Large diffs are not rendered by default.

676 changes: 676 additions & 0 deletions Extension Fields/Fp12Arithmetic.pas

Large diffs are not rendered by default.

401 changes: 401 additions & 0 deletions Extension Fields/Fp16Arithmetic.pas

Large diffs are not rendered by default.

588 changes: 588 additions & 0 deletions Extension Fields/Fp18Arithmetic.pas

Large diffs are not rendered by default.

808 changes: 808 additions & 0 deletions Extension Fields/Fp24Arithmetic.pas

Large diffs are not rendered by default.

568 changes: 568 additions & 0 deletions Extension Fields/Fp27Arithmetic.pas

Large diffs are not rendered by default.

738 changes: 738 additions & 0 deletions Extension Fields/Fp2Arithmetic.pas

Large diffs are not rendered by default.

827 changes: 827 additions & 0 deletions Extension Fields/Fp36Arithmetic.pas

Large diffs are not rendered by default.

848 changes: 848 additions & 0 deletions Extension Fields/Fp3Arithmetic.pas

Large diffs are not rendered by default.

727 changes: 727 additions & 0 deletions Extension Fields/Fp6Arithmetic.pas

Large diffs are not rendered by default.

Binary file added Icones/BLS12.bmp
Binary file not shown.
Binary file added Icones/BLS24.bmp
Binary file not shown.
Binary file added Icones/BN.bmp
Binary file not shown.
Binary file added Icones/KSS16.bmp
Binary file not shown.
Binary file added Icones/KSS18.bmp
Binary file not shown.
Binary file added Icones/KSS27.bmp
Binary file not shown.
Binary file added Icones/KSS36.bmp
Binary file not shown.
Binary file added Icones/MNT.bmp
Binary file not shown.
Binary file added Icones/ss.bmp
Binary file not shown.
97 changes: 97 additions & 0 deletions Tools/GeneralTypes.pas
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
unit GeneralTypes;

interface

uses Vcl.ComCtrls, LargeIntegers,Fp6Arithmetic,Fp2Arithmetic,Fp3Arithmetic,Fp4Arithmetic,Fp8Arithmetic,Fp9Arithmetic, System.SysUtils, System.classes;


type

CurvesFamily=(cfSuperSingular,cfBN,cfBLS12,cfBLS24,cfKSS18,cfKSS16,cfMNT,cfKSS36,cfBLS27);
CoordinatesSystem=(csAffine,csProjective,csJacobian);
LoopPoweringMode=(lpmBinary,lpmNaf,lpmAuto);
TTwistModel=(twDType,twMType);
FpPoweringMode=(pmNormal,pmBeuchat,pmKarbina); // Diffrent Algorithms for exponentiation over the Cyclotpmic Group
FpKSS16PoweringMode=(pmkssNormal);


PtrCurveParams=^CurveParams;
CurveParams=Record
{Definition of a Curve with respect the the Weistrass model Y^2=X^3+A*X+B (mod P)}
Family:CurvesFamily; // Fmaily of the curve (Supersingular, BN, MNT, KSS,.....)
SecurityLevel:String; /// Security Level of the pairing on the curve
A,B, // parametres of the curve y^2=x^3+Ax+B
P, // the prime Modulo
N, // Total number of the points #E(Fp)
R, // Order of the sub-group on the curve (number of the pointes)
H:LInt; // Cofactor of the curve H=P div R
FieldParam:PtrFieldParams;

{ parametres for BLS/BN curves }
u,usqr,ucub, // the paramater of generation for the BN curve
Tr, // Forbeinus Trace of the curve
Lp, // Size of the Miller's Loop
Rtw:LInt; /// Ordre of the Twist Curve
Htw:LInt; // Cofactor of the Twist Curve
Atw,Btw:Fp2Int; // Parametres of the Sextic Twist Curve
AtwFp4,BtwFp4:Fp4Int;
AtwFp3,BtwFp3:Fp3Int;
AtwFp6,BtwFp6:Fp6Int;
AtwFp9,BtwFp9:Fp9Int;
TowerParam:PtrTowerParams12;
TowerParam2:PtrTowerParams24;
TowerParam3:PtrTowerParams18;
FrobeniusMapConstX,FrobeniusMapConstY:array[0..2] of Fp2Int;// for BN/BLS12 Curves
FrobeniusMapConstX_Fp3,FrobeniusMapConstY_Fp3:Fp3Int;// for KSS18 Curves
FrobeniusMapConstX_Fp4,FrobeniusMapConstY_Fp4:Fp4Int;// for BLS24 Curves
FrobeniusMapConstX_Fp6,FrobeniusMapConstY_Fp6:Fp6Int;// for KSS36 Curves
FrobeniusMapConstX_Fp9,FrobeniusMapConstY_Fp9:Fp9Int;// for BLS27 Curves
CoordSys:CoordinatesSystem;
LoopBin,LoopNaf,
LoopRateBin,LoopRateNaf,
LoopEtaBin,LoopEtaNaf,
LoopTateNaf,LoopTateBin:PLIntArrayForm;
TwistMode:TTwistModel;
BasePointX,BasePointY:Lint;
TwistBasePointX,TwistBasePointy:Fp2Int;
TwistBasePointX_Fp3,TwistBasePointy_Fp3:Fp3Int;
BLS24TwistGeneratorX,BLS24TwistGeneratorY:Fp4Int;
KSS36TwistGeneratorX,KSS36TwistGeneratorY:Fp6Int;
BLS27TwistGeneratorX,BLS27TwistGeneratorY:Fp9Int;
TwsistGeneratorSeed:Word;
power:Lint;
end;
TCurve=class(Tcomponent)
public
CurveParams:PtrCurveParams;
procedure GenerateParamsTreeView(Tree:TTreeView);virtual;
constructor Create(AOwner : TComponent); override;
destructor destroy;
end;

implementation


{ TCurve }

{ TCurve }


constructor TCurve.Create(AOwner : TComponent);
begin
inherited Create(AOwner);
//initialize;
end;

destructor TCurve.destroy;
begin
inherited destroy;
end;

procedure TCurve.GenerateParamsTreeView(Tree: TTreeView);
begin

end;


end.
Loading

0 comments on commit adfdb56

Please sign in to comment.