本文整理汇总了C#中IRandom.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# IRandom.GetType方法的具体用法?C# IRandom.GetType怎么用?C# IRandom.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IRandom
的用法示例。
在下文中一共展示了IRandom.GetType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MPKCKeyGenerator
/// <summary>
/// Use an initialized prng to generate the key; use this constructor with an Rng that requires pre-initialization, i.e. PBPrng
/// </summary>
///
/// <param name="CipherParams">The RLWEParameters instance containing the cipher settings</param>
/// <param name="RngEngine">An initialized Prng instance</param>
/// <param name="Parallel">Use parallel processing when generating a key; set to false if using a passphrase type generator (default is true)</param>
public MPKCKeyGenerator(MPKCParameters CipherParams, IRandom RngEngine, bool Parallel = true)
{
_mpkcParams = (MPKCParameters)CipherParams;
// set source of randomness
_rndEngine = RngEngine;
_M = _mpkcParams.M;
_N = _mpkcParams.N;
_T = _mpkcParams.T;
_fieldPoly = _mpkcParams.FieldPolynomial;
_frcLinear = ParallelUtils.ForceLinear;
// passphrase gens must be linear processed
if (RngEngine.GetType().Equals(typeof(PBPRng)))
ParallelUtils.ForceLinear = true;
else
ParallelUtils.ForceLinear = !Parallel;
}
示例2: NTRUKeyGenerator
/// <summary>
/// Use an initialized prng to generate the key; use this constructor with an Rng that requires pre-initialization, i.e. PBPrng
/// </summary>
///
/// <param name="CipherParams">The NTRUParameters instance containing the cipher settings</param>
/// <param name="RngEngine">An initialized Prng instance</param>
/// <param name="Parallel">Use parallel processing when generating a key; set to false if using a passphrase type generator (default is true)</param>
public NTRUKeyGenerator(NTRUParameters CipherParams, IRandom RngEngine, bool Parallel = true)
{
_frcLinear = ParallelUtils.ForceLinear;
// passphrase gens must be linear processed
if (RngEngine.GetType().Equals(typeof(PBPRng)))
ParallelUtils.ForceLinear = true;
else
ParallelUtils.ForceLinear = !Parallel;
_ntruParams = CipherParams;
// set source of randomness
_rndEngine = RngEngine;
}
示例3: RLWEKeyGenerator
/// <summary>
/// Use an initialized prng to generate the key; use this constructor with an Rng that requires pre-initialization, i.e. PBPrng
/// </summary>
///
/// <param name="CipherParams">The RLWEParameters instance containing the cipher settings</param>
/// <param name="RngEngine">An initialized Prng instance</param>
/// <param name="Parallel">Use parallel processing when generating a key; set to false if using a passphrase type generator (default is true)</param>
public RLWEKeyGenerator(RLWEParameters CipherParams, IRandom RngEngine, bool Parallel = true)
{
_rlweParams = CipherParams;
_rndEngine = RngEngine;
_frcLinear = ParallelUtils.ForceLinear;
// passphrase gens must be linear processed
if (RngEngine.GetType().Equals(typeof(PBPRng)))
ParallelUtils.ForceLinear = true;
else
ParallelUtils.ForceLinear = !Parallel;
}