public SchemeEccOnePassUnified(
            IDsaEcc dsa,
            IEccCurveFactory curveFactory,
            IKdfOneStepFactory kdfFactory,
            IKeyConfirmationFactory keyConfirmationFactory,
            INoKeyConfirmationFactory noKeyConfirmationFactory,
            IOtherInfoFactory otherInfoFactory,
            IEntropyProvider entropyProvider,
            SchemeParametersBase <KasDsaAlgoAttributesEcc> schemeParameters,
            KdfParameters kdfParameters,
            MacParameters macParameters,
            IDiffieHellman <EccDomainParameters, EccKeyPair> diffieHellman
            )
            : base(
                dsa,
                curveFactory,
                kdfFactory,
                keyConfirmationFactory,
                noKeyConfirmationFactory,
                otherInfoFactory,
                entropyProvider,
                schemeParameters,
                kdfParameters,
                macParameters
                )
        {
            _diffieHellman = diffieHellman;

            if (SchemeParameters.KasAlgoAttributes.Scheme != EccScheme.OnePassUnified)
            {
                throw new ArgumentException(nameof(SchemeParameters.KasAlgoAttributes.Scheme));
            }
        }
Пример #2
0
        public SchemeEccFullMqv(
            IDsaEcc dsa,
            IEccCurveFactory curveFactory,
            IKdfOneStepFactory kdfFactory,
            IKeyConfirmationFactory keyConfirmationFactory,
            INoKeyConfirmationFactory noKeyConfirmationFactory,
            IOtherInfoFactory otherInfoFactory,
            IEntropyProvider entropyProvider,
            SchemeParametersBase <KasDsaAlgoAttributesEcc> schemeParameters,
            KdfParameters kdfParameters,
            MacParameters macParameters,
            IMqv <EccDomainParameters, EccKeyPair> mqv
            ) :
            base(
                dsa,
                curveFactory,
                kdfFactory,
                keyConfirmationFactory,
                noKeyConfirmationFactory,
                otherInfoFactory,
                entropyProvider,
                schemeParameters,
                kdfParameters,
                macParameters
                )
        {
            _mqv = mqv;

            if (SchemeParameters.KasAlgoAttributes.Scheme != EccScheme.FullMqv)
            {
                throw new ArgumentException(nameof(SchemeParameters.KasAlgoAttributes.Scheme));
            }
        }
 public SchemeEccStaticUnified(
     IDsaEcc dsa,
     IEccCurveFactory eccCurveFactory,
     IKdfOneStepFactory kdfFactory,
     IKeyConfirmationFactory keyConfirmationFactory,
     INoKeyConfirmationFactory noKeyConfirmationFactory,
     IOtherInfoFactory otherInfoFactory,
     IEntropyProvider entropyProvider,
     SchemeParametersBase <KasDsaAlgoAttributesEcc> schemeParameters,
     KdfParameters kdfParameters,
     MacParameters macParameters,
     IDiffieHellman <EccDomainParameters, EccKeyPair> diffieHellman
     )
     : base(
         dsa,
         eccCurveFactory,
         kdfFactory,
         keyConfirmationFactory,
         noKeyConfirmationFactory,
         otherInfoFactory,
         entropyProvider,
         schemeParameters,
         kdfParameters,
         macParameters
         )
 {
     _diffieHellman = diffieHellman;
 }
Пример #4
0
 protected SchemeBaseEcc(
     IDsaEcc dsa,
     IEccCurveFactory eccCurveFactory,
     IKdfOneStepFactory kdfFactory,
     IKeyConfirmationFactory keyConfirmationFactory,
     INoKeyConfirmationFactory noKeyConfirmationFactory,
     IOtherInfoFactory otherInfoFactory,
     IEntropyProvider entropyProvider,
     SchemeParametersBase <KasDsaAlgoAttributesEcc> schemeParameters,
     KdfParameters kdfParameters,
     MacParameters macParameters
     )
     : base(
         kdfFactory,
         keyConfirmationFactory,
         noKeyConfirmationFactory,
         otherInfoFactory,
         entropyProvider,
         schemeParameters,
         kdfParameters,
         macParameters
         )
 {
     Dsa             = dsa;
     EccCurveFactory = eccCurveFactory;
 }
Пример #5
0
        public SchemeEccOnePassDh(
            IDsaEcc dsa,
            IEccCurveFactory curveFactory,
            IKdfOneStepFactory kdfFactory,
            IKeyConfirmationFactory keyConfirmationFactory,
            INoKeyConfirmationFactory noKeyConfirmationFactory,
            IOtherInfoFactory otherInfoFactory,
            IEntropyProvider entropyProvider,
            SchemeParametersBase <KasDsaAlgoAttributesEcc> schemeParameters,
            KdfParameters kdfParameters,
            MacParameters macParameters,
            IDiffieHellman <EccDomainParameters, EccKeyPair> diffieHellman
            ) :
            base(
                dsa,
                curveFactory,
                kdfFactory,
                keyConfirmationFactory,
                noKeyConfirmationFactory,
                otherInfoFactory,
                entropyProvider,
                schemeParameters,
                kdfParameters,
                macParameters
                )
        {
            _diffieHellman = diffieHellman;

            if (SchemeParameters.KasAlgoAttributes.Scheme != EccScheme.OnePassDh)
            {
                throw new ArgumentException(nameof(SchemeParameters.KasAlgoAttributes.Scheme));
            }

            if (SchemeParameters.KeyConfirmationDirection == KeyConfirmationDirection.Bilateral ||
                (SchemeParameters.KeyAgreementRole == KeyAgreementRole.InitiatorPartyU &&
                 SchemeParameters.KeyConfirmationRole == KeyConfirmationRole.Provider) ||
                (SchemeParameters.KeyAgreementRole == KeyAgreementRole.ResponderPartyV &&
                 SchemeParameters.KeyConfirmationRole == KeyConfirmationRole.Recipient))
            {
                throw new ArgumentException("Only unilateral Key confirmation possible party V to U");
            }
        }
Пример #6
0
 public SchemeBuilderEcc(
     IDsaEccFactory dsaEccFactory,
     IEccCurveFactory eccCurveFactory,
     IKdfOneStepFactory kdfFactory,
     IKeyConfirmationFactory keyConfirmationFactory,
     INoKeyConfirmationFactory noKeyConfirmationFactory,
     IOtherInfoFactory otherInfoFactory,
     IEntropyProvider entropyProvider,
     IDiffieHellman <EccDomainParameters, EccKeyPair> diffieHellmanEcc,
     IMqv <EccDomainParameters, EccKeyPair> mqv)
     : base(
         kdfFactory,
         keyConfirmationFactory,
         noKeyConfirmationFactory,
         otherInfoFactory,
         entropyProvider,
         diffieHellmanEcc,
         mqv
         )
 {
     _dsaEccFactory   = dsaEccFactory;
     _eccCurveFactory = eccCurveFactory;
 }