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

            switch (standard)
            {
            case GHashStandard.GHash3:      temp = new GHashParameters(3);  break;

            case GHashStandard.GHash5:      temp = new GHashParameters(5);  break;
            }

            return(temp);
        }
Beispiel #3
0
 /// <summary>Initializes a new instance of the GHash class.</summary>
 /// <remarks>This constructor implements the default parameters of GHash5.</remarks>
 public GHash() : this(GHashParameters.GetParameters(GHashStandard.GHash5))
 {
 }