当前位置: 首页>>代码示例>>C#>>正文


C# IRandom.GetType方法代码示例

本文整理汇总了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;
        }
开发者ID:modulexcite,项目名称:CEX,代码行数:24,代码来源:MPKCKeyGenerator.cs

示例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;
        }
开发者ID:modulexcite,项目名称:CEX,代码行数:20,代码来源:NTRUKeyGenerator.cs

示例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;
        }
开发者ID:modulexcite,项目名称:CEX,代码行数:19,代码来源:RLWEKeyGenerator.cs


注:本文中的IRandom.GetType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。