diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-07-17 18:55:46 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-07-17 18:55:46 +0700 |
commit | 67108e3c641758ebe98484cf52454471d9948e0d (patch) | |
tree | a9437e154bf3b71ed41591f94fbe65fa04891bed /crypto/src/security | |
parent | Remove unused digest (diff) | |
download | BouncyCastle.NET-ed25519-67108e3c641758ebe98484cf52454471d9948e0d.tar.xz |
Utility method for selecting AES engine
Diffstat (limited to 'crypto/src/security')
-rw-r--r-- | crypto/src/security/CipherUtilities.cs | 6 | ||||
-rw-r--r-- | crypto/src/security/MacUtilities.cs | 2 | ||||
-rw-r--r-- | crypto/src/security/WrapperUtilities.cs | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/crypto/src/security/CipherUtilities.cs b/crypto/src/security/CipherUtilities.cs index a6849c102..8ed5d8d41 100644 --- a/crypto/src/security/CipherUtilities.cs +++ b/crypto/src/security/CipherUtilities.cs @@ -339,7 +339,7 @@ namespace Org.BouncyCastle.Security "PBEWITHMD5AND256BITAES-CBC-OPENSSL")) { return new PaddedBufferedBlockCipher( - new CbcBlockCipher(new AesEngine())); + new CbcBlockCipher(AesUtilities.CreateEngine())); } } } @@ -368,7 +368,7 @@ namespace Org.BouncyCastle.Security switch (cipherAlgorithm) { case CipherAlgorithm.AES: - blockCipher = new AesEngine(); + blockCipher = AesUtilities.CreateEngine(); break; case CipherAlgorithm.ARC4: streamCipher = new RC4Engine(); @@ -759,7 +759,7 @@ namespace Org.BouncyCastle.Security { switch (cipherAlgorithm) { - case CipherAlgorithm.AES: return new AesEngine(); + case CipherAlgorithm.AES: return AesUtilities.CreateEngine(); case CipherAlgorithm.ARIA: return new AriaEngine(); case CipherAlgorithm.BLOWFISH: return new BlowfishEngine(); case CipherAlgorithm.CAMELLIA: return new CamelliaEngine(); diff --git a/crypto/src/security/MacUtilities.cs b/crypto/src/security/MacUtilities.cs index f9f586d29..9490616be 100644 --- a/crypto/src/security/MacUtilities.cs +++ b/crypto/src/security/MacUtilities.cs @@ -115,7 +115,7 @@ namespace Org.BouncyCastle.Security if (mechanism == "AESCMAC") { - return new CMac(new AesEngine()); + return new CMac(AesUtilities.CreateEngine()); } if (mechanism == "DESMAC") { diff --git a/crypto/src/security/WrapperUtilities.cs b/crypto/src/security/WrapperUtilities.cs index 983ff824c..48ffe3a96 100644 --- a/crypto/src/security/WrapperUtilities.cs +++ b/crypto/src/security/WrapperUtilities.cs @@ -67,7 +67,7 @@ namespace Org.BouncyCastle.Security case WrapAlgorithm.RC2WRAP: return new RC2WrapEngine(); case WrapAlgorithm.SEEDWRAP: return new SeedWrapEngine(); case WrapAlgorithm.DESEDERFC3211WRAP: return new Rfc3211WrapEngine(new DesEdeEngine()); - case WrapAlgorithm.AESRFC3211WRAP: return new Rfc3211WrapEngine(new AesEngine()); + case WrapAlgorithm.AESRFC3211WRAP: return new Rfc3211WrapEngine(AesUtilities.CreateEngine()); case WrapAlgorithm.CAMELLIARFC3211WRAP: return new Rfc3211WrapEngine(new CamelliaEngine()); } } |