Skip to content

Commit

Permalink
Replace ShamatarLib with Nethermind.Crypto.Pairings package
Browse files Browse the repository at this point in the history
  • Loading branch information
rubo committed Apr 25, 2023
1 parent 8385c71 commit ece72d9
Show file tree
Hide file tree
Showing 41 changed files with 98 additions and 285 deletions.
3 changes: 2 additions & 1 deletion src/Nethermind/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
<PackageVersion Include="Microsoft.Extensions.ObjectPool" Version="7.0.3" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageVersion Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.17.0" />
<PackageVersion Include="Nethermind.Crypto.Pairings" Version="1.0.0-preview.1" />
<PackageVersion Include="Nethermind.Crypto.SecP256k1" Version="1.0.0" />
<PackageVersion Include="Nethermind.DotNetty.Buffers" Version="1.0.0" />
<PackageVersion Include="Nethermind.DotNetty.Handlers" Version="1.0.0" />
Expand Down Expand Up @@ -78,4 +79,4 @@
<PackageVersion Include="Websocket.Client" Version="4.5.2" />
<PackageVersion Include="YamlDotNet" Version="13.0.1" />
</ItemGroup>
</Project>
</Project>
18 changes: 0 additions & 18 deletions src/Nethermind/Nethermind.Crypto/Nethermind.Crypto.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,6 @@
<PackageReference Include="System.Security.Cryptography.ProtectedData" />
</ItemGroup>

<ItemGroup>
<Content Include="runtimes\linux-arm64\native\libshamatar.so">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="runtimes\linux-x64\native\libshamatar.so">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="runtimes\osx-x64\native\libshamatar.dylib">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="runtimes\osx-arm64\native\libshamatar.dylib">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="runtimes\win-x64\native\shamatar.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

<ItemGroup>
<Content Include="kzg_trusted_setup.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand Down
168 changes: 0 additions & 168 deletions src/Nethermind/Nethermind.Crypto/ShamatarLib.cs

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using FluentAssertions;
using Nethermind.Core.Extensions;
using Nethermind.Evm.Precompiles;
using Nethermind.Evm.Precompiles.Bls.Shamatar;
using Nethermind.Evm.Precompiles.Bls;
using Nethermind.Specs.Forks;
using NUnit.Framework;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using FluentAssertions;
using Nethermind.Core.Extensions;
using Nethermind.Evm.Precompiles;
using Nethermind.Evm.Precompiles.Bls.Shamatar;
using Nethermind.Evm.Precompiles.Bls;
using Nethermind.Specs.Forks;
using NUnit.Framework;

Expand Down
2 changes: 1 addition & 1 deletion src/Nethermind/Nethermind.Evm.Test/BlsMapToG1Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using FluentAssertions;
using Nethermind.Core.Extensions;
using Nethermind.Evm.Precompiles;
using Nethermind.Evm.Precompiles.Bls.Shamatar;
using Nethermind.Evm.Precompiles.Bls;
using Nethermind.Specs.Forks;
using NUnit.Framework;

Expand Down
2 changes: 1 addition & 1 deletion src/Nethermind/Nethermind.Evm.Test/BlsMapToG2Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using FluentAssertions;
using Nethermind.Core.Extensions;
using Nethermind.Evm.Precompiles;
using Nethermind.Evm.Precompiles.Bls.Shamatar;
using Nethermind.Evm.Precompiles.Bls;
using Nethermind.Specs.Forks;
using NUnit.Framework;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using FluentAssertions;
using Nethermind.Core.Extensions;
using Nethermind.Evm.Precompiles;
using Nethermind.Evm.Precompiles.Bls.Shamatar;
using Nethermind.Evm.Precompiles.Bls;
using Nethermind.Specs.Forks;
using NUnit.Framework;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using FluentAssertions;
using Nethermind.Core.Extensions;
using Nethermind.Evm.Precompiles;
using Nethermind.Evm.Precompiles.Bls.Shamatar;
using Nethermind.Evm.Precompiles.Bls;
using Nethermind.Specs.Forks;
using NUnit.Framework;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using FluentAssertions;
using Nethermind.Core.Extensions;
using Nethermind.Evm.Precompiles;
using Nethermind.Evm.Precompiles.Bls.Shamatar;
using Nethermind.Evm.Precompiles.Bls;
using Nethermind.Specs.Forks;
using NUnit.Framework;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using FluentAssertions;
using Nethermind.Core.Extensions;
using Nethermind.Evm.Precompiles;
using Nethermind.Evm.Precompiles.Bls.Shamatar;
using Nethermind.Evm.Precompiles.Bls;
using NUnit.Framework;
using static Nethermind.Specs.Forks.MuirGlacier;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using FluentAssertions;
using Nethermind.Core.Extensions;
using Nethermind.Evm.Precompiles;
using Nethermind.Evm.Precompiles.Bls.Shamatar;
using Nethermind.Evm.Precompiles.Bls;
using Nethermind.Specs.Forks;
using NUnit.Framework;

Expand Down
6 changes: 3 additions & 3 deletions src/Nethermind/Nethermind.Evm.Test/BnAddPrecompileTests.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited
// SPDX-License-Identifier: LGPL-3.0-only

using System;
using Nethermind.Core.Extensions;
using Nethermind.Evm.Precompiles;
using Nethermind.Evm.Precompiles.Snarks;
using Nethermind.Specs.Forks;
using NUnit.Framework;

Expand Down Expand Up @@ -31,8 +31,8 @@ public void Test()

for (int i = 0; i < inputs.Length; i++)
{
IPrecompile shamatar = Precompiles.Snarks.Shamatar.Bn256AddPrecompile.Instance;
(ReadOnlyMemory<byte>, bool) resultShamatar = shamatar.Run(inputs[i], MuirGlacier.Instance);
IPrecompile precompile = Bn254AddPrecompile.Instance;
_ = precompile.Run(inputs[i], MuirGlacier.Instance);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/Nethermind/Nethermind.Evm.Test/BnMulPrecompileTests.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited
// SPDX-License-Identifier: LGPL-3.0-only

using System;
using Nethermind.Core.Extensions;
using Nethermind.Evm.Precompiles;
using Nethermind.Evm.Precompiles.Snarks;
using Nethermind.Specs.Forks;
using NUnit.Framework;

Expand Down Expand Up @@ -31,8 +31,8 @@ public void Test()

for (int i = 0; i < inputs.Length; i++)
{
IPrecompile shamatar = Precompiles.Snarks.Shamatar.Bn256MulPrecompile.Instance;
(ReadOnlyMemory<byte>, bool) resultShamatar = shamatar.Run(inputs[i], MuirGlacier.Instance);
IPrecompile precompile = Bn254MulPrecompile.Instance;
_ = precompile.Run(inputs[i], MuirGlacier.Instance);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/Nethermind/Nethermind.Evm.Test/BnPairPrecompileTests.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited
// SPDX-License-Identifier: LGPL-3.0-only

using System;
using Nethermind.Core.Extensions;
using Nethermind.Evm.Precompiles;
using Nethermind.Evm.Precompiles.Snarks;
using Nethermind.Specs.Forks;
using NUnit.Framework;

Expand Down Expand Up @@ -62,8 +62,8 @@ public void Test()
for (int i = 0; i < inputs.Length; i++)
{
byte[] cloned = inputs[i].Clone() as byte[];
IPrecompile shamatar = Precompiles.Snarks.Shamatar.Bn256PairingPrecompile.Instance;
(ReadOnlyMemory<byte>, bool) resultShamatar = shamatar.Run(cloned, MuirGlacier.Instance);
IPrecompile precompile = Bn254PairingPrecompile.Instance;
_ = precompile.Run(cloned, MuirGlacier.Instance);
}
}
}
Expand Down
Loading

0 comments on commit ece72d9

Please sign in to comment.