public void testSignVerify() { byte[] msg = new byte[100]; byte[] sig_out = new byte[64]; byte[] privkey = new byte[32]; byte[] pubkey = new byte[32]; byte[] random = new byte[64]; privkey[0] = 123; for (int count = 0; count < 1000; count++) { privkey = curve25519.generatePrivateKey(privkey); pubkey = curve25519.generatePublicKey(privkey); sig_out = curve25519.calculateSignature(random, privkey, msg); Assert.IsTrue(curve25519.verifySignature(pubkey, msg, sig_out)); Array.Copy(sig_out, 0, privkey, 0, 32); } }
public bool verifySignature(byte[] publicKey, byte[] message, byte[] signature) { return(native.verifySignature(publicKey, message, signature)); }