예제 #1
0
 public bool SigVerify(SecpSchnorrSignature signature, ReadOnlySpan <byte> msg32)
 {
     if (msg32.Length != 32)
     {
         return(false);
     }
     if (signature is null)
     {
         return(false);
     }
     ref readonly Scalar s = ref signature.s;
 public static bool TryCreate(ReadOnlySpan <byte> in64, out SecpSchnorrSignature?signature)
 {
     signature = null;
     if (in64.Length != 64)
     {
         return(false);
     }
     if (FE.TryCreate(in64.Slice(0, 32), out var fe) &&
         new Scalar(in64.Slice(32, 32), out int overflow) is Scalar scalar && overflow == 0)
     {
         signature = new SecpSchnorrSignature(fe, scalar);
         return(true);
     }
     return(false);
 }