internal DigestFactory(TParams parameters, IEngineProvider <IDigest> digestProvider, int digestSize) { this.approvedOnlyMode = CryptoServicesRegistrar.IsInApprovedOnlyMode(); this.parameters = parameters; this.digestProvider = digestProvider; this.digestSize = digestSize; }
static FipsDsa() { IEngineProvider <DsaSigner> provider = new DsaProvider(); // FSM_STATE:3.DSA.0,"POWER ON SELF-TEST", "DSA SIGN VERIFY KAT", "The module is performing ECDSA sign and verify KAT self-test" // FSM_TRANS:3.DSA.0,"POWER ON SELF-TEST", "DSA SIGN VERIFY KAT", "Invoke DSA Sign/Verify KAT self-test" provider.CreateEngine(EngineUsage.GENERAL); // FSM_TRANS:3.DSA.1,"DSA SIGN VERIFY KAT", "POWER ON SELF-TEST", "DSA Sign/Verify KAT self-test successful completion" ENGINE_PROVIDER = provider; }
public IMacFactory <TAuthParam> CreateMacFactory(TAuthParam parameters) { if (CryptoServicesRegistrar.IsInApprovedOnlyMode()) { throw new CryptoUnapprovedOperationError("Attempt to create unapproved MAC factory in approved only mode"); } IEngineProvider <IMac> macProvider = ProviderUtils.CreateMacProvider(name, parameters, engineProvider); return(new MacFactory <TAuthParam>(parameters, macProvider, (parameters.MacSizeInBits + 7) / 8)); }
internal GeneralBlockCipherProvider(string name, IEngineProvider <Internal.IBlockCipher> engineProvider) { CryptoStatus.IsReady(); if (CryptoServicesRegistrar.IsInApprovedOnlyMode()) { throw new CryptoUnapprovedOperationError("Attempt to create provider for unapproved algorithm in approved only mode"); } this.name = name; this.engineProvider = engineProvider; }
internal SignatureFactory(TParams parameters, IEngineProvider <ISigner> signerProvider) { this.parameters = parameters; this.signerProvider = signerProvider; }
private static void rsaKeyTransportTest(IEngineProvider <RsaBlindedEngine> provider) { SelfTestExecutor.Validate(WrapOaep.Algorithm, new RsaOaepKeyTransportTest(provider)); }
internal RsaOaepKeyTransportTest(IEngineProvider <RsaBlindedEngine> provider) : base(WrapOaep.Algorithm) { this.provider = provider; }
private static void rsaSignTest(IEngineProvider <RsaBlindedEngine> provider) { SelfTestExecutor.Validate(Pkcs1v15.Algorithm, new RsaSignTest(provider)); }
internal RsaSignTest(IEngineProvider <RsaBlindedEngine> provider) : base(Pkcs1v15.Algorithm) { this.provider = provider; }
internal CcmMacProvider(IEngineProvider <Internal.IBlockCipher> baseProvider, IAuthenticationParametersWithIV <IParameters <Algorithm>, Algorithm> parameters) { this.baseProvider = baseProvider; this.parameters = parameters; }
internal static IWrapper CreateWrapper(string name, AlgorithmMode algorithmMode, bool useInverse, bool forWrapping, IEngineProvider <Internal.IBlockCipher> baseCipherProvider) { Internal.IBlockCipher baseCipher = baseCipherProvider.CreateEngine(GetWrapUsage(useInverse, forWrapping)); IWrapper cipher; switch (algorithmMode) { case AlgorithmMode.WRAP: cipher = new SP80038FWrapEngine(baseCipher, useInverse); break; case AlgorithmMode.WRAPPAD: cipher = new SP80038FWrapWithPaddingEngine(baseCipher, useInverse); break; default: throw new ArgumentException("Unknown wrapper algorithm passed to " + name + ".Provider: " + algorithmMode); } cipher.Init(forWrapping, null); return(cipher); }
public Provider(String name, IEngineProvider <Internal.IBlockCipher> engine) { this.desEdeEngineProvider = engine; }
internal static IEngineProvider <IMac> CreateMacProvider(string name, IAuthenticationParametersWithIV <IParameters <Algorithm>, Algorithm> parameters, IEngineProvider <Org.BouncyCastle.Crypto.Internal.IBlockCipher> baseCipher) { switch (parameters.Algorithm.Mode) { case AlgorithmMode.CCM: return(new CcmMacProvider(baseCipher, parameters)); case AlgorithmMode.GMAC: return(new GMacProvider(baseCipher, parameters)); default: throw new ArgumentException("Unknown MAC algorithm passed to " + name + ".Provider: " + parameters.Algorithm.Mode); } }
public IMacFactory <AuthenticationParametersWithIV> CreateMacFactory(AuthenticationParametersWithIV algorithmDetails) { IEngineProvider <IMac> macProvider = ProviderUtils.CreateMacProvider("FipsAES", algorithmDetails, aesEngineProvider); return(new MacFactory <AuthenticationParametersWithIV>(algorithmDetails, macProvider, (algorithmDetails.MacSizeInBits + 7) / 8)); }
public Provider(IEngineProvider <Internal.IStreamCipher> engineProvider) { this.engineProvider = engineProvider; }
internal Service(Poly1305.Key key) { engineProvider = new EngineProvider(key); }
internal static IBufferedCipher CreateBufferedCipher(string name, AlgorithmMode algorithmMode, IParametersWithIV <IParameters <Algorithm>, Algorithm> parameters, bool forEncryption, IEngineProvider <Internal.IBlockCipher> cipherProvider) { Internal.IBlockCipher baseCipher = cipherProvider.CreateEngine(GetUsage(forEncryption, algorithmMode)); Internal.IBlockCipher cipher; switch (algorithmMode) { case AlgorithmMode.CBC: cipher = new CbcBlockCipher(baseCipher); break; case AlgorithmMode.CS1: return(new NistCtsBlockCipher(NistCtsBlockCipher.CS1, baseCipher)); case AlgorithmMode.CS2: return(new NistCtsBlockCipher(NistCtsBlockCipher.CS2, baseCipher)); case AlgorithmMode.CS3: return(new NistCtsBlockCipher(NistCtsBlockCipher.CS3, baseCipher)); case AlgorithmMode.CFB8: cipher = new CfbBlockCipher(baseCipher, 8); break; case AlgorithmMode.CFB64: cipher = new CfbBlockCipher(baseCipher, 64); break; case AlgorithmMode.CFB128: cipher = new CfbBlockCipher(baseCipher, 128); break; case AlgorithmMode.OpenPGPCFB: cipher = new OpenPgpCfbBlockCipher(baseCipher); break; case AlgorithmMode.OFB64: cipher = new OfbBlockCipher(baseCipher, 64); break; case AlgorithmMode.OFB128: cipher = new OfbBlockCipher(baseCipher, 128); break; case AlgorithmMode.CTR: cipher = new SicBlockCipher(baseCipher); break; default: throw new ArgumentException("Unknown algorithm mode passed to " + name + ".Provider: " + algorithmMode); } return(new BufferedBlockCipher(cipher)); }
internal static IAeadBlockCipher CreateAeadCipher(string name, AlgorithmMode algorithmMode, IParametersWithIV <IParameters <Algorithm>, Algorithm> parameters, bool forEncryption, IEngineProvider <Internal.IBlockCipher> cipherProvider) { Internal.IBlockCipher baseCipher = cipherProvider.CreateEngine(GetUsage(forEncryption, algorithmMode)); switch (algorithmMode) { case AlgorithmMode.CCM: return(new CcmBlockCipher(baseCipher)); case AlgorithmMode.GCM: return(new GcmBlockCipher(baseCipher)); default: throw new ArgumentException("Unknown algorithm mode passed to " + name + ".Provider: " + algorithmMode); } }
public Provider(String name, IEngineProvider <Internal.IBlockCipher> engineProvider) : base(name, engineProvider) { }
public ScreenshotJobTaskBinder(IEngineProvider engineProvider) { _engineProvider = engineProvider; }
internal Service(IEngineProvider <Internal.IBlockCipher> engineProvider) : base(new Provider("SEED", engineProvider), new ProviderForIV("SEED", engineProvider)) { }
internal CMacProvider(IEngineProvider <Internal.IBlockCipher> baseProvider, IAuthenticationParameters <IParameters <Algorithm>, Algorithm> parameters) { this.baseProvider = baseProvider; this.macSizeInBits = parameters.MacSizeInBits; }
public IMacFactory <AuthenticationParameters> CreateMacFactory(AuthenticationParameters algorithmDetails) { IEngineProvider <IMac> macProvider = ProviderUtils.CreateMacProvider("FipsTripleDes", algorithmDetails, desEdeEngineProvider); return(new MacFactory <AuthenticationParameters>(algorithmDetails, macProvider, (algorithmDetails.MacSizeInBits + 7) / 8)); }
internal MacFactory(TParams parameters, IEngineProvider <IMac> macProvider, int macLength) { this.parameters = parameters; this.macProvider = macProvider; this.macLength = macLength; }
internal XofFactory(TParams parameters, IEngineProvider <IXof> xofProvider) { this.approvedOnlyMode = CryptoServicesRegistrar.IsInApprovedOnlyMode(); this.parameters = parameters; this.xofProvider = xofProvider; }
public HomeController(ITireProvider tireProvider, IChassisProvider chassisProvider, IEngineProvider engineProvider) { this.tireProvider = tireProvider; this.chassisProvider = chassisProvider; this.engineProvider = engineProvider; }