Пример #1
0
        public DrbgResult(DrbgStatus drbgStatus)
        {
            DrbgStatus = drbgStatus;

            if (drbgStatus != DrbgStatus.Success)
            {
                Bits = new BitString(0);
            }
        }
Пример #2
0
        public void ShouldReturnStatusOfInstantiateAlgorithm(DrbgStatus statusToReturn)
        {
            _entropy
            .Setup(s => s.GetEntropy(_parameters.EntropyInputLen))
            .Returns(new BitString(_parameters.EntropyInputLen));

            _subject.Object.DrbgStatus = statusToReturn;
            var result = _subject.Object.Instantiate(_parameters.SecurityStrength, new BitString(_parameters.PersoStringLen));

            Assert.AreEqual(statusToReturn, result);
        }
Пример #3
0
        public void ShouldReturnStatusOfReseedAlgorithm(DrbgStatus statusToReturn)
        {
            _entropy
            .Setup(s => s.GetEntropy(_parameters.EntropyInputLen))
            .Returns(new BitString(_parameters.EntropyInputLen));

            _subject.Object.DrbgStatus = statusToReturn;
            var result = _subject.Object.Reseed(new BitString(_parameters.AdditionalInputLen));

            Assert.AreEqual(statusToReturn, result);
        }
Пример #4
0
 public DrbgResult(BitString bits)
 {
     Bits       = bits;
     DrbgStatus = DrbgStatus.Success;
 }