Example #1
0
 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));
     }
 }
Example #2
0
 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));
     }
 }