public PasswordBasedEncryptionScheme(
            PasswordBasedKeyDerivationAlgorithm keyDerivationAlgorithm,
            AeadAlgorithm encryptionAlgorithm)
        {
            if (keyDerivationAlgorithm == null)
            {
                throw new ArgumentNullException(nameof(keyDerivationAlgorithm));
            }
            if (encryptionAlgorithm == null)
            {
                throw new ArgumentNullException(nameof(encryptionAlgorithm));
            }

            _keyDerivationAlgorithm = keyDerivationAlgorithm;
            _encryptionAlgorithm    = encryptionAlgorithm;
        }
Ejemplo n.º 2
0
        public PasswordBasedMacScheme(
            PasswordBasedKeyDerivationAlgorithm keyDerivationAlgorithm,
            MacAlgorithm macAlgorithm)
        {
            if (keyDerivationAlgorithm == null)
            {
                throw new ArgumentNullException(nameof(keyDerivationAlgorithm));
            }
            if (macAlgorithm == null)
            {
                throw new ArgumentNullException(nameof(macAlgorithm));
            }

            _keyDerivationAlgorithm = keyDerivationAlgorithm;
            _macAlgorithm           = macAlgorithm;
        }