示例#1
0
        public SIMDBase(HashLib.HashSize a_hash_size, int a_block_size)
            : base((int)a_hash_size, a_block_size)
        {
            m_state = new uint[BlockSize / 4];

            Initialize();
        }
示例#2
0
            /// <summary>
            ///
            /// </summary>
            /// <param name="a_rounds">4, 8</param>
            /// <param name="a_hash_size">128, 256</param>
            /// <returns></returns>
            public static IHash CreateSnefru(HashRounds a_rounds, HashLib.HashSize a_hash_size)
            {
                switch (a_rounds)
                {
                case HashRounds.Rounds4:

                    switch (a_hash_size)
                    {
                    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_hash_size)
                    {
                    case HashLib.HashSize.HashSize128: return(CreateSnefru_8_128());

                    case HashLib.HashSize.HashSize256: return(CreateSnefru_8_256());

                    default: throw new ArgumentException();
                    }

                default: throw new ArgumentException();
                }
            }
示例#3
0
            /// <summary>
            ///
            /// </summary>
            /// <param name="a_rounds">3, 4, 5</param>
            /// <param name="a_hash_size">128, 160, 192, 224, 256</param>
            /// <returns></returns>
            public static IHash CreateHaval(HashRounds a_rounds, HashLib.HashSize a_hash_size)
            {
                switch (a_rounds)
                {
                case HashRounds.Rounds3:

                    switch (a_hash_size)
                    {
                    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_hash_size)
                    {
                    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_hash_size)
                    {
                    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();
                }
            }
示例#4
0
                /// <summary>
                ///
                /// </summary>
                /// <param name="a_hash_size">224, 256, 384, 512</param>
                /// <returns></returns>
                public static IHash CreateKeccak(HashLib.HashSize a_hash_size)
                {
                    switch (a_hash_size)
                    {
                    case HashLib.HashSize.HashSize224: return(CreateKeccak224());

                    case HashLib.HashSize.HashSize256: return(CreateKeccak256());

                    case HashLib.HashSize.HashSize384: return(CreateKeccak384());

                    case HashLib.HashSize.HashSize512: return(CreateKeccak512());

                    default: throw new ArgumentException();
                    }
                }
示例#5
0
                /// <summary>
                ///
                /// </summary>
                /// <param name="a_hash_size">224, 256, 384, 512</param>
                /// <returns></returns>
                public static IHash CreateBlueMidnightWish(HashLib.HashSize a_hash_size)
                {
                    switch (a_hash_size)
                    {
                    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();
                    }
                }
示例#6
0
                /// <summary>
                ///
                /// </summary>
                /// <param name="aHashSize">224, 256, 384, 512</param>
                /// <returns></returns>
                public static IHash CreateSkein(HashLib.HashSize aHashSize)
                {
                    switch (aHashSize)
                    {
                    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();
                    }
                }
示例#7
0
                /// <summary>
                ///
                /// </summary>
                /// <param name="aHashSize">224, 256, 384, 512</param>
                /// <returns></returns>
                public static IHash CreateShAvite3(HashLib.HashSize aHashSize)
                {
                    switch (aHashSize)
                    {
                    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();
                    }
                }
                /// <summary>
                ///
                /// </summary>
                /// <param name="a_hashSize">224, 256, 384, 512</param>
                /// <returns></returns>
                public static IHash CreateShabal(HashLib.HashSize a_hashSize)
                {
                    switch (a_hashSize)
                    {
                    case HashLib.HashSize.HashSize224: return(CreateShabal224());

                    case HashLib.HashSize.HashSize256: return(CreateShabal256());

                    case HashLib.HashSize.HashSize384: return(CreateShabal384());

                    case HashLib.HashSize.HashSize512: return(CreateShabal512());

                    default: throw new ArgumentException();
                    }
                }
示例#9
0
 public SkeinBase(HashLib.HashSize a_hashSize)
     : base((int)a_hashSize, 64)
 {
     Initialize();
 }
示例#10
0
 public Shabal(HashLib.HashSize a_hashSize)
     : base((int)a_hashSize, 64)
 {
     Initialize();
 }
示例#11
0
 public CubeHash(HashLib.HashSize a_hash_size)
     : base((int)a_hash_size, 32)
 {
     Initialize();
 }
示例#12
0
 public SIMD512Base(HashLib.HashSize a_hash_size)
     : base(a_hash_size, 128)
 {
 }
示例#13
0
 public SIMD256Base(HashLib.HashSize a_hash_size)
     : base(a_hash_size, 64)
 {
 }