public static int CryptoStreamXor(Byte *c, Byte *m, UInt64 mlen, Byte *n, Byte *k) { Byte[] subkey = new Byte[32]; fixed(Byte *subkeyp = subkey, sigmap = sigma) { Core.HSalsa20.CryptoCore(subkeyp, n, k, sigmap); return(Salsa20.CryptoStreamXor(c, m, (int)mlen, n + 16, subkeyp)); } }
public static int CryptoStream(Byte *c, int clen, Byte *n, Byte *k) { Byte[] subkey = new Byte[32]; fixed(Byte *subkeyp = subkey, sigmap = sigma) { Core.HSalsa20.CryptoCore(subkeyp, n, k, sigmap); return(Salsa20.CryptoStream(c, clen, n + 16, subkeyp)); } }