static void Main(string[] args) { string str = "Test"; int[] input = { 1, 3, 2, 3, 4, 5, 1, 2, 3, 4, 99, 109, 33, 4, 2, 32, 32, -1, -33, -1078, -3459, 0xcf, 0x9c, 0xff, 0x777ffdc, -0x934dc, 3, 40560, 20, 930, 1809, 2, 3, 4, 5, 66, 54, 190, 304, 22, 34, 56, 1, 2, 1, 0, -9, -99, -190, -123 & 0x9c, ~010010, -2, -193456, int.MaxValue, int.MinValue }; IHashLib hashLib = new HashLib(); long[] result = hashLib.hash2(input), result2 = hashLib.hash_salt2(input), result3 = hashLib.hash2(str), result4 = hashLib.hash_salt2(str); Console.WriteLine("The first of the output array:{0},{1},{2},{3}", result[0], result2[0], result3[0], result4[0]); Console.ReadKey(); }
public CubeHash(HashLib.HashSize a_hash_size) : base((int)a_hash_size, 32) { Initialize(); }
/// <summary> /// /// </summary> /// <param name="a_hash_size">224, 256, 384, 512</param> /// <returns></returns> public static IHash CreateGroestl(HashLib.HashSize a_hash_size) { switch (a_hash_size) { case HashLib.HashSize.HashSize224: return CreateGroestl224(); case HashLib.HashSize.HashSize256: return CreateGroestl256(); case HashLib.HashSize.HashSize384: return CreateGroestl384(); case HashLib.HashSize.HashSize512: return CreateGroestl512(); default: throw new ArgumentException(); } }
public LuffaBase(HashLib.HashSize a_hash_size) : base((int)a_hash_size, 32) { }
public Skein256Base(HashLib.HashSize a_hash_size) : base(a_hash_size, 32) { }
public SIMDBase(HashLib.HashSize a_hashSize, int a_blockSize) : base((int)a_hashSize, a_blockSize) { m_state = new uint[BlockSize / 4]; Initialize(); }
public Luffa256Base(HashLib.HashSize a_hash_size) : base(a_hash_size) { m_result_blocks = 3; m_iv_length = 24; Initialize(); }
/// <summary> /// /// </summary> /// <param name="a_rounds">3, 4, 5</param> /// <param name="a_hashSize">128, 160, 192, 224, 256</param> /// <returns></returns> public static IHash CreateHaval(HashRounds a_rounds, HashLib.HashSize a_hashSize) { switch (a_rounds) { case HashRounds.Rounds3: switch (a_hashSize) { case HashLib.HashSize.HashSize128: return CreateHaval_3_128(); case HashLib.HashSize.HashSize160: return CreateHaval_3_160(); case HashLib.HashSize.HashSize192: return CreateHaval_3_192(); case HashLib.HashSize.HashSize224: return CreateHaval_3_224(); case HashLib.HashSize.HashSize256: return CreateHaval_3_256(); default: throw new ArgumentException(); } case HashRounds.Rounds4: switch (a_hashSize) { case HashLib.HashSize.HashSize128: return CreateHaval_4_128(); case HashLib.HashSize.HashSize160: return CreateHaval_4_160(); case HashLib.HashSize.HashSize192: return CreateHaval_4_192(); case HashLib.HashSize.HashSize224: return CreateHaval_4_224(); case HashLib.HashSize.HashSize256: return CreateHaval_4_256(); default: throw new ArgumentException(); } case HashRounds.Rounds5: switch (a_hashSize) { case HashLib.HashSize.HashSize128: return CreateHaval_5_128(); case HashLib.HashSize.HashSize160: return CreateHaval_5_160(); case HashLib.HashSize.HashSize192: return CreateHaval_5_192(); case HashLib.HashSize.HashSize224: return CreateHaval_5_224(); case HashLib.HashSize.HashSize256: return CreateHaval_5_256(); default: throw new ArgumentException(); } default: throw new ArgumentException(); } }
/// <summary> /// /// </summary> /// <param name="a_hashSize">224, 256, 384, 512</param> /// <returns></returns> public static IHash CreateSkein(HashLib.HashSize a_hashSize) { switch (a_hashSize) { case HashLib.HashSize.HashSize224: return CreateSkein224(); case HashLib.HashSize.HashSize256: return CreateSkein256(); case HashLib.HashSize.HashSize384: return CreateSkein384(); case HashLib.HashSize.HashSize512: return CreateSkein512(); default: throw new ArgumentException(); } }
/// <summary> /// /// </summary> /// <param name="a_hashSize">224, 256, 384, 512</param> /// <returns></returns> public static IHash CreateBlueMidnightWish(HashLib.HashSize a_hashSize) { switch (a_hashSize) { case HashLib.HashSize.HashSize224: return CreateBlueMidnightWish224(); case HashLib.HashSize.HashSize256: return CreateBlueMidnightWish256(); case HashLib.HashSize.HashSize384: return CreateBlueMidnightWish384(); case HashLib.HashSize.HashSize512: return CreateBlueMidnightWish512(); default: throw new ArgumentException(); } }
/// <summary> /// /// </summary> /// <param name="a_rounds">4, 8</param> /// <param name="a_hashSize">128, 256</param> /// <returns></returns> public static IHash CreateSnefru(HashRounds a_rounds, HashLib.HashSize a_hashSize) { switch (a_rounds) { case HashRounds.Rounds4: switch (a_hashSize) { case HashLib.HashSize.HashSize128: return CreateSnefru_4_128(); case HashLib.HashSize.HashSize256: return CreateSnefru_4_256(); default: throw new ArgumentException(); } case HashRounds.Rounds8: switch (a_hashSize) { case HashLib.HashSize.HashSize128: return CreateSnefru_8_128(); case HashLib.HashSize.HashSize256: return CreateSnefru_8_256(); default: throw new ArgumentException(); } default: throw new ArgumentException(); } }
public Keccak(HashLib.HashSize a_hashSize) : base((int)a_hashSize, 200 - ((int)a_hashSize * 2)) { Initialize(); }
public SkeinBase(HashLib.HashSize a_hashSize) : base((int)a_hashSize, 64) { Initialize(); }
public Shabal(HashLib.HashSize a_hash_size) : base((int)a_hash_size, 64) { Initialize(); }
public SkeinBase(HashLib.HashSize a_hash_size, int a_block_size) : base((int)a_hash_size, a_block_size) { Initialize(); }
public SIMD256Base(HashLib.HashSize a_hash_size) : base(a_hash_size, 64) { }
public SIMD512Base(HashLib.HashSize a_hash_size) : base(a_hash_size, 128) { }
public SHAvite3_256Base(HashLib.HashSize a_hashSize) : base(a_hashSize, 64) { Initialize(); }
public SHAvite3Base(HashLib.HashSize a_hashSize, int a_blockSize) : base((int)a_hashSize, a_blockSize) { m_state = new uint[BlockSize / 4]; }
public SHAvite3_512Base(HashLib.HashSize a_hashSize) : base(a_hashSize, 128) { Initialize(); }
public Skein512Base(HashLib.HashSize a_hash_size) : base(a_hash_size, 64) { }
/// <summary> /// /// </summary> /// <param name="a_hash_size">224, 256, 384, 512</param> /// <returns></returns> public static IHash CreateSHAvite3(HashLib.HashSize a_hash_size) { switch (a_hash_size) { case HashLib.HashSize.HashSize224: return CreateSHAvite3_224(); case HashLib.HashSize.HashSize256: return CreateSHAvite3_256(); case HashLib.HashSize.HashSize384: return CreateSHAvite3_384(); case HashLib.HashSize.HashSize512: return CreateSHAvite3_512(); default: throw new ArgumentException(); } }