Esempio n. 1
0
 public Signature Sign(byte[] messageHash)
 {
     Guard.Assert(messageHash.Length == 32, "messageHash length shoud be 32 bytes");
     return(Signature.Parse(Secp256k1Helper.SignRecoverable(messageHash, Key)));
 }
Esempio n. 2
0
 public PrivateKey CreateEcdhKey(PublicKey key)
 {
     return(new PrivateKey(Secp256k1Helper.CreateEcdhKey(Key, key)));
 }
Esempio n. 3
0
 public static bool CheckPrivateKey(H256 key)
 {
     return(Secp256k1Helper.SecretKeyVerify(key));
 }
Esempio n. 4
0
 public static byte[] PublicKeySerialize(byte[] key, bool compress)
 {
     return(Secp256k1Helper.PublicKeySerialize(key, compress));
 }
Esempio n. 5
0
 public static byte[] PublicKeyParse(byte[] bytes)
 {
     return(Secp256k1Helper.PublicKeyParse(bytes));
 }
Esempio n. 6
0
 public bool Verify(byte[] signature, byte[] messageHash)
 {
     Guard.Assert(messageHash.Length == 32, "messageHash.length should be 32");
     return(Secp256k1Helper.Verify(signature, messageHash, Value));
 }
Esempio n. 7
0
 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);
 }