MakeCanonical() public method

Enforce LowS on the signature
public MakeCanonical ( ) : ECDSASignature
return ECDSASignature
 public TransactionSignature(ECDSASignature signature, SigHash sigHash)
 {
     if(sigHash == SigHash.Undefined)
         throw new ArgumentException("sigHash should not be Undefined");
     _SigHash = sigHash;
     _Signature = signature.MakeCanonical();
 }
Example #2
0
        public ECDSASignature Sign(uint256 hash)
        {
            AssertPrivateKey();
            var signer = new DeterministicECDSA();

            signer.setPrivateKey(PrivateKey);
            ECDSASignature sig = ECDSASignature.FromDER(signer.signHash(hash.ToBytes()));

            return(sig.MakeCanonical());
        }
Example #3
0
        public ECDSASignature Sign(uint256 hash)
        {
            AssertPrivateKey();
            ECDsaSigner signer = new ECDsaSigner();

            signer.Init(true, PrivateKey);
            BigInteger[]   components = signer.GenerateSignature(hash.ToBytes());
            ECDSASignature signature  = new ECDSASignature(components[0], components[1]);

            signature = signature.MakeCanonical();
            return(signature);
        }
Example #4
0
 public ECDSASignature Sign(uint256 hash)
 {
     AssertPrivateKey();
     ECDsaSigner signer = new ECDsaSigner();
     signer.Init(true, PrivateKey);
     BigInteger[] components = signer.GenerateSignature(hash.ToBytes());
     ECDSASignature signature = new ECDSASignature(components[0], components[1]);
     signature = signature.MakeCanonical();
     return signature;
 }