Mercurial > hg > ucis.core
diff NaCl/crypto_hash/sha512.cs @ 71:7e9d1cfcc562
NaCl: added ed25519 public key message signing implementation
author | Ivo Smits <Ivo@UCIS.nl> |
---|---|
date | Fri, 01 Nov 2013 00:07:36 +0100 |
parents | c873e3dd73fe |
children | b7d981ccd434 |
line wrap: on
line diff
--- a/NaCl/crypto_hash/sha512.cs Wed Oct 30 15:32:58 2013 +0100 +++ b/NaCl/crypto_hash/sha512.cs Fri Nov 01 00:07:36 2013 +0100 @@ -15,6 +15,11 @@ 0x5b,0xe0,0xcd,0x19,0x13,0x7e,0x21,0x79 };*/ + public static unsafe void crypto_hash(Byte[] outv, Byte[] inv, int inlen) { + if (outv.Length < 64) throw new ArgumentException("outv.Length < 64"); + if (inv.Length < inlen) throw new ArgumentException("inv.Length < inlen"); + fixed (Byte* outp = outv, inp = inv) crypto_hash(outp, inp, (UInt64)inlen); + } public static unsafe void crypto_hash(Byte* outp, Byte* inp, UInt64 inlen) { // Byte[] h = new Byte[64]; Byte[] padded = new Byte[256];