public DrbgResult(DrbgStatus drbgStatus) { DrbgStatus = drbgStatus; if (drbgStatus != DrbgStatus.Success) { Bits = new BitString(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); }
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); }
public DrbgResult(BitString bits) { Bits = bits; DrbgStatus = DrbgStatus.Success; }