Skip to content

Commit

Permalink
Update CryptoLib.BLS12_381.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
erikzhang committed Feb 6, 2023
1 parent f506922 commit 29bc3b2
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/Neo/SmartContract/Native/CryptoLib.BLS12_381.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ namespace Neo.SmartContract.Native;

partial class CryptoLib
{
private const int G1 = 48;
private const int G2 = 96;
private const int Gt = 576;

/// <summary>
/// Serialize a bls12381 point.
/// </summary>
Expand Down Expand Up @@ -39,9 +35,9 @@ public static InteropInterface Bls12381Deserialize(byte[] data)
{
return data.Length switch
{
G1 => new InteropInterface(G1Affine.FromCompressed(data)),
G2 => new InteropInterface(G2Affine.FromCompressed(data)),
Gt => new InteropInterface(Cryptography.BLS12_381.Gt.FromBytes(data)),
48 => new InteropInterface(G1Affine.FromCompressed(data)),
96 => new InteropInterface(G2Affine.FromCompressed(data)),
576 => new InteropInterface(Gt.FromBytes(data)),
_ => throw new ArgumentException($"Bls12381 operation fault, type:format, error:valid point length"),
};
}
Expand Down

0 comments on commit 29bc3b2

Please sign in to comment.