Пример #1
0
 /// <summary>Initializes a new instance of the Tiger class.</summary>
 /// <param name="parameters">The parameters to utilize in the Tiger calculation.</param>
 /// <exception cref="ArgumentNullException">When the specified parameters are null.</exception>
 public Tiger(TigerParameters parameters) : base(64)
 {
     lock (syncLock) {
         if (parameters == null)
         {
             throw new ArgumentNullException("parameters", Hasher.Properties.Resources.paramCantBeNull);
         }
         this.parameters = parameters;
         HashSizeValue   = this.parameters.Length;
     }
 }
        /// <summary>Retrieves a standard set of Tiger parameters.</summary>
        /// <param name="standard">The name of the standard parameter set to retrieve.</param>
        /// <returns>The Tiger Parameters for the given standard.</returns>
        public static TigerParameters GetParameters(TigerStandard standard)
        {
            TigerParameters temp = null;

            switch (standard)
            {
            case TigerStandard.Tiger128BitVersion1: temp = new TigerParameters(128, TigerAlgorithmType.Tiger1); break;

            case TigerStandard.Tiger160BitVersion1: temp = new TigerParameters(160, TigerAlgorithmType.Tiger1); break;

            case TigerStandard.Tiger192BitVersion1: temp = new TigerParameters(192, TigerAlgorithmType.Tiger1); break;

            case TigerStandard.Tiger128BitVersion2: temp = new TigerParameters(128, TigerAlgorithmType.Tiger2); break;

            case TigerStandard.Tiger160BitVersion2: temp = new TigerParameters(160, TigerAlgorithmType.Tiger2); break;

            case TigerStandard.Tiger192BitVersion2: temp = new TigerParameters(192, TigerAlgorithmType.Tiger2); break;
            }

            return(temp);
        }
Пример #3
0
 /// <summary>Initializes a new instance of the Tiger class.</summary>
 /// <remarks>This constructor implements the default parameters of Tiger192BitVersion1.</remarks>
 public Tiger() : this(TigerParameters.GetParameters(TigerStandard.Tiger192BitVersion1))
 {
 }