コード例 #1
0
 public DsaEccFactory(IShaFactory shaFactory, IHmacFactory hmacFactory, IEccNonceProviderFactory nonceProviderFactory, IEntropyProviderFactory entropyProviderFactory)
 {
     _shaFactory             = shaFactory;
     _hmacFactory            = hmacFactory;
     _nonceProviderFactory   = nonceProviderFactory;
     _entropyProviderFactory = entropyProviderFactory;
 }
コード例 #2
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);
        }
コード例 #3
0
ファイル: KdfShaTests.cs プロジェクト: usnistgov/ACVP-Server
        public void Setup()
        {
            _shaFactory = new NativeShaFactory();
            IHmacFactory hmacFactory = new HmacFactory(_shaFactory);
            IKmacFactory kmacFactory = new KmacFactory(new CSHAKEWrapper());
            ICmacFactory cmacFactory = new CmacFactory(new BlockCipherEngineFactory(), new ModeBlockCipherFactory());

            _kdfVisitor = new KdfVisitor(
                new KdfOneStepFactory(_shaFactory, hmacFactory, kmacFactory),
                new KdfFactory(cmacFactory, hmacFactory),
                hmacFactory,
                cmacFactory,
                new IkeV1Factory(hmacFactory, _shaFactory),
                new IkeV2Factory(hmacFactory),
                new TlsKdfFactory(hmacFactory),
                new HkdfFactory(hmacFactory));
        }
コード例 #4
0
 public EdDomainParameters(IEdwardsCurve e, IShaFactory shaFactory)
 {
     CurveE      = e;
     _shaFactory = shaFactory;
 }
コード例 #5
0
 public KdfOneStepFactory(IShaFactory shaFactory, IHmacFactory hmacFactory, IKmacFactory kmacFactory)
 {
     _shaFactory  = shaFactory;
     _hmacFactory = hmacFactory;
     _kmacFactory = kmacFactory;
 }
コード例 #6
0
ファイル: KtsFactory.cs プロジェクト: usnistgov/ACVP-Server
 public KtsFactory(IShaFactory shaFactory, IRsa rsa, IEntropyProviderFactory entropyFactory)
 {
     _shaFactory     = shaFactory;
     _rsa            = rsa;
     _entropyFactory = entropyFactory;
 }
コード例 #7
0
ファイル: DrbgFactory.cs プロジェクト: usnistgov/ACVP-Server
 public DrbgFactory(IShaFactory shaFactory, IHmacFactory hmacFactory)
 {
     _shaFactory  = shaFactory;
     _hmacFactory = hmacFactory;
 }
コード例 #8
0
ファイル: HmacTests.cs プロジェクト: usnistgov/ACVP-Server
 public void Setup()
 {
     _shaFactory = new NativeShaFactory();
 }
コード例 #9
0
 public IkeV1Factory(IHmacFactory hmacFactory, IShaFactory shaFactory)
 {
     _hmacFactory = hmacFactory;
     _shaFactory  = shaFactory;
 }
コード例 #10
0
ファイル: MaskFactory.cs プロジェクト: usnistgov/ACVP-Server
 public MaskFactory(IShaFactory shaFactory)
 {
     _shaFactory = shaFactory;
 }
コード例 #11
0
 public AnsiX942Factory(IShaFactory shaFactory)
 {
     _shaFactory = shaFactory;
 }
コード例 #12
0
 public TlsKdfFactoryV13(IHkdfFactory hkdfFactory, IShaFactory shaFacory)
 {
     _hkdfFactory = hkdfFactory;
     _shaFactory  = shaFacory;
 }
コード例 #13
0
 public DsaFfcFactory(IShaFactory shaFactory)
 {
     _shaFactory = shaFactory;
 }
コード例 #14
0
 public EdDomainParameters(IEdwardsCurve e, IShaFactory shaFactory, SecretGenerationMode secretMode)
 {
     CurveE           = e;
     SecretGeneration = secretMode;
     _shaFactory      = shaFactory;
 }
コード例 #15
0
 public SnmpFactory(IShaFactory shaFactory)
 {
     _shaFactory = shaFactory;
 }
コード例 #16
0
 public HmacFactory(IShaFactory iShaFactory)
 {
     _iShaFactory = iShaFactory;
 }
コード例 #17
0
ファイル: SshFactory.cs プロジェクト: usnistgov/ACVP-Server
 public SshFactory(IShaFactory shaFactory)
 {
     _shaFactory = shaFactory;
 }