summary refs log tree commit diff
path: root/crypto/src/security/WrapperUtilities.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/security/WrapperUtilities.cs')
-rw-r--r--crypto/src/security/WrapperUtilities.cs5
1 files changed, 2 insertions, 3 deletions
diff --git a/crypto/src/security/WrapperUtilities.cs b/crypto/src/security/WrapperUtilities.cs
index 48ffe3a96..74e13f121 100644
--- a/crypto/src/security/WrapperUtilities.cs
+++ b/crypto/src/security/WrapperUtilities.cs
@@ -27,7 +27,7 @@ namespace Org.BouncyCastle.Security
         static WrapperUtilities()
         {
             // Signal to obfuscation tools not to change enum constants
-            ((WrapAlgorithm)Enums.GetArbitraryValue(typeof(WrapAlgorithm))).ToString();
+            Enums.GetArbitraryValue<WrapAlgorithm>().ToString();
 
             Algorithms[NistObjectIdentifiers.IdAes128Wrap.Id] = "AESWRAP";
             Algorithms[NistObjectIdentifiers.IdAes192Wrap.Id] = "AESWRAP";
@@ -56,8 +56,7 @@ namespace Org.BouncyCastle.Security
 
             try
             {
-                WrapAlgorithm wrapAlgorithm = (WrapAlgorithm)Enums.GetEnumValue(
-                    typeof(WrapAlgorithm), mechanism);
+                WrapAlgorithm wrapAlgorithm = Enums.GetEnumValue<WrapAlgorithm>(mechanism);
 
                 switch (wrapAlgorithm)
                 {