예제 #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)));
 }
예제 #2
0
 public PrivateKey CreateEcdhKey(PublicKey key)
 {
     return(new PrivateKey(Secp256k1Helper.CreateEcdhKey(Key, key)));
 }
예제 #3
0
 public static bool CheckPrivateKey(H256 key)
 {
     return(Secp256k1Helper.SecretKeyVerify(key));
 }
예제 #4
0
 public static byte[] PublicKeySerialize(byte[] key, bool compress)
 {
     return(Secp256k1Helper.PublicKeySerialize(key, compress));
 }
예제 #5
0
 public static byte[] PublicKeyParse(byte[] bytes)
 {
     return(Secp256k1Helper.PublicKeyParse(bytes));
 }
예제 #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));
 }
예제 #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);
 }