예제 #1
0
 public CTRDRBGProvider(Org.BouncyCastle.Crypto.Internal.IBlockCipher blockCipher, int keySizeInBits, byte[] nonce, byte[] personalizationString, int securityStrength, byte[] primaryAdditionalInput)
 {
     CryptoStatus.IsReady();
     this.blockCipher            = blockCipher;
     this.keySizeInBits          = keySizeInBits;
     this.nonce                  = nonce;
     this.personalizationString  = personalizationString;
     this.securityStrength       = securityStrength;
     this.primaryAdditionalInput = primaryAdditionalInput;
 }
예제 #2
0
 public DRBGTestVector(Org.BouncyCastle.Crypto.Internal.IBlockCipher cipher, int keySizeInBits, IEntropySource eSource, bool predictionResistance, String nonce, int securityStrength, byte[][] expected)
 {
     _cipher          = cipher;
     _keySizeInBits   = keySizeInBits;
     _eSource         = eSource;
     _pr              = predictionResistance;
     _nonce           = nonce;
     _ss              = securityStrength;
     _ev              = expected;
     _personalisation = null;
 }
예제 #3
0
        internal static IBufferedCipher CreateBufferedCipher(string name, AlgorithmMode algorithmMode, IParameters <Algorithm> parameters, Org.BouncyCastle.Crypto.Internal.IBlockCipher baseCipher)
        {
            Org.BouncyCastle.Crypto.Internal.IBlockCipher cipher;

            switch (algorithmMode)
            {
            case AlgorithmMode.ECB:
                cipher = baseCipher;
                break;

            default:
                throw new ArgumentException("Unknown algorithm mode passed to " + name + ".Provider: " + algorithmMode);
            }

            return(new BufferedBlockCipher(cipher));
        }