You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
708 B
32 lines
708 B
2 months ago
|
using System;
|
||
|
|
||
|
using Org.BouncyCastle.Security;
|
||
|
|
||
|
namespace Org.BouncyCastle.Crypto.Parameters
|
||
|
{
|
||
|
public class ElGamalKeyGenerationParameters
|
||
|
: KeyGenerationParameters
|
||
|
{
|
||
|
private readonly ElGamalParameters parameters;
|
||
|
|
||
|
public ElGamalKeyGenerationParameters(
|
||
|
SecureRandom random,
|
||
|
ElGamalParameters parameters)
|
||
|
: base(random, GetStrength(parameters))
|
||
|
{
|
||
|
this.parameters = parameters;
|
||
|
}
|
||
|
|
||
|
public ElGamalParameters Parameters
|
||
|
{
|
||
|
get { return parameters; }
|
||
|
}
|
||
|
|
||
|
internal static int GetStrength(
|
||
|
ElGamalParameters parameters)
|
||
|
{
|
||
|
return parameters.L != 0 ? parameters.L : parameters.P.BitLength;
|
||
|
}
|
||
|
}
|
||
|
}
|