コード例 #1
0
 public KeyConfirmationFactory(IKeyConfirmationMacDataCreator macDataCreator)
 {
     _macDataCreator = macDataCreator;
     _cmacFactory    = new CmacFactory(new BlockCipherEngineFactory(), new ModeBlockCipherFactory());
     _hmacFactory    = new HmacFactory(new NativeShaFactory());
     _kmacFactory    = new KmacFactory(new CSHAKEWrapper());
 }
コード例 #2
0
 public DsaEccFactory(IShaFactory shaFactory, IHmacFactory hmacFactory, IEccNonceProviderFactory nonceProviderFactory, IEntropyProviderFactory entropyProviderFactory)
 {
     _shaFactory             = shaFactory;
     _hmacFactory            = hmacFactory;
     _nonceProviderFactory   = nonceProviderFactory;
     _entropyProviderFactory = entropyProviderFactory;
 }
コード例 #3
0
        public KdfHmac(IHmacFactory hmacFactory, IShaFactory shaFactory, KdaOneStepAuxFunction auxFunction, bool useCounter)
        {
            UseCounter = useCounter;

            HashFunction hashFunction = null;

            switch (auxFunction)
            {
            case KdaOneStepAuxFunction.HMAC_SHA1:
                hashFunction = new HashFunction(ModeValues.SHA1, DigestSizes.d160);
                break;

            case KdaOneStepAuxFunction.HMAC_SHA2_D224:
                hashFunction = new HashFunction(ModeValues.SHA2, DigestSizes.d224);
                break;

            case KdaOneStepAuxFunction.HMAC_SHA2_D256:
                hashFunction = new HashFunction(ModeValues.SHA2, DigestSizes.d256);
                break;

            case KdaOneStepAuxFunction.HMAC_SHA2_D384:
                hashFunction = new HashFunction(ModeValues.SHA2, DigestSizes.d384);
                break;

            case KdaOneStepAuxFunction.HMAC_SHA2_D512:
                hashFunction = new HashFunction(ModeValues.SHA2, DigestSizes.d512);
                break;

            case KdaOneStepAuxFunction.HMAC_SHA2_D512_T224:
                hashFunction = new HashFunction(ModeValues.SHA2, DigestSizes.d512t224);
                break;

            case KdaOneStepAuxFunction.HMAC_SHA2_D512_T256:
                hashFunction = new HashFunction(ModeValues.SHA2, DigestSizes.d512t256);
                break;

            case KdaOneStepAuxFunction.HMAC_SHA3_D224:
                hashFunction = new HashFunction(ModeValues.SHA3, DigestSizes.d224);
                break;

            case KdaOneStepAuxFunction.HMAC_SHA3_D256:
                hashFunction = new HashFunction(ModeValues.SHA3, DigestSizes.d256);
                break;

            case KdaOneStepAuxFunction.HMAC_SHA3_D384:
                hashFunction = new HashFunction(ModeValues.SHA3, DigestSizes.d384);
                break;

            case KdaOneStepAuxFunction.HMAC_SHA3_D512:
                hashFunction = new HashFunction(ModeValues.SHA3, DigestSizes.d512);
                break;

            default:
                throw new ArgumentException(nameof(auxFunction));
            }

            _hmac = hmacFactory.GetHmacInstance(hashFunction);
            _sha  = shaFactory.GetShaInstance(hashFunction);
        }
コード例 #4
0
 public KdfMultiExpansionVisitor(
     IKdfFactory kdfTwoStepFactory,
     IHkdfFactory hkdfFactory,
     ICmacFactory cmacFactory,
     IHmacFactory hmacFactory
     )
 {
     _kdfTwoStepFactory = kdfTwoStepFactory;
     _hkdfFactory       = hkdfFactory;
     _cmacFactory       = cmacFactory;
     _hmacFactory       = hmacFactory;
 }
コード例 #5
0
 public KdfVisitor(IKdfOneStepFactory kdfOneStepFactory,
                   IKdfFactory kdfTwoStepFactory,
                   IHmacFactory hmacFactory,
                   ICmacFactory cmacFactory,
                   IIkeV1Factory ikeV1Factory,
                   IIkeV2Factory ikeV2Factory,
                   ITlsKdfFactory tlsFactory,
                   IHkdfFactory hkdfFactory)
 {
     _kdfOneStepFactory = kdfOneStepFactory;
     _kdfTwoStepFactory = kdfTwoStepFactory;
     _hmacFactory       = hmacFactory;
     _cmacFactory       = cmacFactory;
     _ikeV1Factory      = ikeV1Factory;
     _ikeV2Factory      = ikeV2Factory;
     _tlsFactory        = tlsFactory;
     _hkdfFactory       = hkdfFactory;
 }
コード例 #6
0
ファイル: HkdfFactory.cs プロジェクト: usnistgov/ACVP-Server
 public HkdfFactory(IHmacFactory hmacFactory)
 {
     _hmacFactory = hmacFactory;
 }
コード例 #7
0
 public KdfOneStepFactory(IShaFactory shaFactory, IHmacFactory hmacFactory, IKmacFactory kmacFactory)
 {
     _shaFactory  = shaFactory;
     _hmacFactory = hmacFactory;
     _kmacFactory = kmacFactory;
 }
コード例 #8
0
 public IkeV2Factory(IHmacFactory hmacFactory)
 {
     _hmacFactory = hmacFactory;
 }
コード例 #9
0
ファイル: DrbgFactory.cs プロジェクト: usnistgov/ACVP-Server
 public DrbgFactory(IShaFactory shaFactory, IHmacFactory hmacFactory)
 {
     _shaFactory  = shaFactory;
     _hmacFactory = hmacFactory;
 }
コード例 #10
0
 public TlsKdfFactory(IHmacFactory hmacFactory)
 {
     _hmacFactory = hmacFactory;
 }
コード例 #11
0
ファイル: PbKdfFactory.cs プロジェクト: usnistgov/ACVP-Server
 public PbKdfFactory(IHmacFactory hmacFactory)
 {
     _hmacFactory = hmacFactory;
 }
コード例 #12
0
 public NoKeyConfirmationFactory(INoKeyConfirmationMacDataCreator macDataCreator)
 {
     _macDataCreator = macDataCreator;
     _cmacFactory    = new CmacFactory(new BlockCipherEngineFactory(), new ModeBlockCipherFactory());
     _hmacFactory    = new HmacFactory(new NativeShaFactory());
 }
コード例 #13
0
 public IkeV1Factory(IHmacFactory hmacFactory, IShaFactory shaFactory)
 {
     _hmacFactory = hmacFactory;
     _shaFactory  = shaFactory;
 }
コード例 #14
0
ファイル: TpmFactory.cs プロジェクト: usnistgov/ACVP-Server
 public TpmFactory(IHmacFactory hmacFactory)
 {
     _hmacFactory = hmacFactory;
 }
コード例 #15
0
ファイル: KdfFactory.cs プロジェクト: usnistgov/ACVP-Server
 public KdfFactory(ICmacFactory cmacFactory, IHmacFactory hmacFactory)
 {
     _cmacFactory = cmacFactory;
     _hmacFactory = hmacFactory;
 }