public Signature Sign(byte[] messageHash) { Guard.Assert(messageHash.Length == 32, "messageHash length shoud be 32 bytes"); return(Signature.Parse(Secp256k1Helper.SignRecoverable(messageHash, Key))); }
public PrivateKey CreateEcdhKey(PublicKey key) { return(new PrivateKey(Secp256k1Helper.CreateEcdhKey(Key, key))); }
public static bool CheckPrivateKey(H256 key) { return(Secp256k1Helper.SecretKeyVerify(key)); }
public static byte[] PublicKeySerialize(byte[] key, bool compress) { return(Secp256k1Helper.PublicKeySerialize(key, compress)); }
public static byte[] PublicKeyParse(byte[] bytes) { return(Secp256k1Helper.PublicKeyParse(bytes)); }
public bool Verify(byte[] signature, byte[] messageHash) { Guard.Assert(messageHash.Length == 32, "messageHash.length should be 32"); return(Secp256k1Helper.Verify(signature, messageHash, Value)); }
public PublicKey GetPublicKey(byte[] messageHash) { Guard.Assert(messageHash.Length == 32, "messageHash.length should be 32"); return(PublicKey.TryParse(Secp256k1Helper.Recover(Value, messageHash), out PublicKey key) ? key : null); }