Exemplo n.º 1
0
 public NoKeyConfirmationHmac(
     INoKeyConfirmationMacDataCreator macDataCreator,
     INoKeyConfirmationParameters noKeyConfirmationParameters,
     IHmac algo)
     : base(macDataCreator, noKeyConfirmationParameters)
 {
     Algo = algo;
 }
        public NoKeyConfirmationAesCcm(INoKeyConfirmationMacDataCreator macDataCreator,
                                       INoKeyConfirmationParameters noKeyConfirmationParameters,
                                       IAeadModeBlockCipher algo)
            : base(macDataCreator, noKeyConfirmationParameters)
        {
            _algo = algo;

            if (BitString.IsZeroLengthOrNull(noKeyConfirmationParameters.CcmNonce))
            {
                throw new ArgumentException(nameof(noKeyConfirmationParameters.CcmNonce));
            }
        }
Exemplo n.º 3
0
        protected NoKeyConfirmationBase(
            INoKeyConfirmationMacDataCreator macDataCreator,
            INoKeyConfirmationParameters noKeyConfirmationParameters)
        {
            _macDataCreator             = macDataCreator;
            NoKeyConfirmationParameters = noKeyConfirmationParameters;

            if (BitString.IsZeroLengthOrNull(NoKeyConfirmationParameters.DerivedKeyingMaterial))
            {
                throw new ArgumentException(nameof(NoKeyConfirmationParameters.DerivedKeyingMaterial));
            }
            if (BitString.IsZeroLengthOrNull(NoKeyConfirmationParameters.Nonce))
            {
                throw new ArgumentException(nameof(NoKeyConfirmationParameters.Nonce));
            }
        }
Exemplo n.º 4
0
 public FakeNoKeyConfirmationMacDataCreator(INoKeyConfirmationMacDataCreator noKeyConfirmationMacDataCreator)
 {
     _noKeyConfirmationMacDataCreator = noKeyConfirmationMacDataCreator;
 }
Exemplo n.º 5
0
 public NoKeyConfirmationFactory(INoKeyConfirmationMacDataCreator macDataCreator)
 {
     _macDataCreator = macDataCreator;
     _cmacFactory    = new CmacFactory(new BlockCipherEngineFactory(), new ModeBlockCipherFactory());
     _hmacFactory    = new HmacFactory(new NativeShaFactory());
 }