36 lines
881 B
C#
36 lines
881 B
C#
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
|
#pragma warning disable
|
|
using System;
|
|
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
|
|
|
|
namespace BestHTTP.SecureProtocol.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;
|
|
}
|
|
}
|
|
}
|
|
#pragma warning restore
|
|
#endif
|