Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Commit

Permalink
Remove reflection
Browse files Browse the repository at this point in the history
  • Loading branch information
shargon committed Jan 9, 2024
1 parent f2255b2 commit 9dc76fe
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions src/Neo.Cryptography.BLS12_381/MillerLoopUtility.cs
Original file line number Diff line number Diff line change
@@ -1,28 +1,9 @@
using System.Reflection;
using static Neo.Cryptography.BLS12_381.Constants;

namespace Neo.Cryptography.BLS12_381;

static class MillerLoopUtility
{
public static T SquareOutput<T, D>(in T f) where D : IMillerLoopDriver<T>
{
MethodInfo methodInfo = typeof(D).GetMethod("SquareOutput", BindingFlags.Static | BindingFlags.Public);
return (T)methodInfo?.Invoke(null, new object[] { f! })!;
}

public static T Conjugate<T, D>(in T f) where D : IMillerLoopDriver<T>
{
MethodInfo methodInfo = typeof(D).GetMethod("Conjugate", BindingFlags.Static | BindingFlags.Public);
return (T)methodInfo?.Invoke(null, new object[] { f! })!;
}

public static T One<T, D>() where D : IMillerLoopDriver<T>
{
var methodInfo = typeof(D).GetMethod("get_One", BindingFlags.Static | BindingFlags.Public);
return (T)methodInfo?.Invoke(null, null)!;
}

public static T MillerLoop<T, D>(D driver) where D : IMillerLoopDriver<T>
{
var f = driver.One;
Expand Down

0 comments on commit 9dc76fe

Please sign in to comment.