public unsafe void Permutation(byte *msg, long len) { var k = new Keccak_20200918(); // byte* cur = msg; var blockLen = cryptoprime.keccak.S_len2 << 3; var buffer = new byte[2048]; // var table = tables[TableName]; fixed(byte *buff = buffer) fixed(ulong *t = tweak) { for (int i = 0; i <= permutationCount; i++) { DoKeccakForAllBlocks(msg, len, k, blockLen); DoKeccakForAllBlocks(msg + 100, len - 100, k, blockLen); } /* * DoThreefishForAllBlocks(msg, len, t, state, 128); * DoPermutation(msg, table, buff); * DoThreefishForAllBlocks(msg + 64, len - 128, t, state, 128); * DoPermutation(msg, table, buff); * DoThreefishForAllBlocks(msg, len, t, state, 128);*/ } }
public unsafe void Permutation(byte *msg, long len) { var k = new Keccak_20200918(); byte *cur = msg; var table = tables["base8"]; fixed(ulong *t = tweak) fixed(ushort *T = table) { DoThreefishForAllBlocks(msg, len, t, k, 128, T, table.Length); } }