Org.BouncyCastle.Crypto.Generators.DsaParametersGenerator.IsValidDsaStrength C# (CSharp) Method

IsValidDsaStrength() private static method

private static IsValidDsaStrength ( int strength ) : bool
strength int
return bool
		private static bool IsValidDsaStrength(
			int strength)
		{
			return strength >= 512 && strength <= 1024 && strength % 64 == 0;
		}
	}

Usage Example

		public virtual void Init(int size, int certainty, SecureRandom random)
		{
			if (!DsaParametersGenerator.IsValidDsaStrength(size))
			{
				throw new ArgumentException("size must be from 512 - 1024 and a multiple of 64", "size");
			}
			this.use186_3 = false;
			this.L = size;
			this.N = DsaParametersGenerator.GetDefaultN(size);
			this.certainty = certainty;
			this.random = random;
		}