示例#1
0
 /// <summary>
 /// Verifies a signature of <paramref name="Data"/> made by the ECDSA algorithm.
 /// </summary>
 /// <param name="Data">Payload to sign.</param>
 /// <param name="PublicKey">Public Key of the entity that generated the signature.</param>
 /// <param name="Signature">Signature</param>
 /// <returns>If the signature is valid.</returns>
 public override bool Verify(byte[] Data, byte[] PublicKey, byte[] Signature)
 {
     return(ECDSA.Verify(Data, PublicKey,
                         Bin => Hashes.ComputeHash(this.HashFunction, Bin),
                         this.orderBytes, this.msbOrderMask, this, Signature));
 }
示例#2
0
 /// <summary>
 /// Creates a signature of <paramref name="Data"/> using the ECDSA algorithm.
 /// </summary>
 /// <param name="Data">Payload to sign.</param>
 /// <returns>Signature.</returns>
 public override byte[] Sign(byte[] Data)
 {
     return(ECDSA.Sign(Data, this.PrivateKey,
                       Bin => Hashes.ComputeHash(this.HashFunction, Bin),
                       this.orderBytes, this.msbOrderMask, this));
 }