summary refs log tree commit diff
path: root/crypto/src/cms
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2024-06-12 18:09:06 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2024-06-12 18:09:06 +0700
commitdaec40507f75c8bbe80f54e25338d31a2b411e39 (patch)
treef336873fdf0be8476dc45de28a30dda37976bd43 /crypto/src/cms
parentDilithium SampleInBall change and KATs updated (diff)
downloadBouncyCastle.NET-ed25519-daec40507f75c8bbe80f54e25338d31a2b411e39.tar.xz
DerInteger constants for small values
Diffstat (limited to 'crypto/src/cms')
-rw-r--r--crypto/src/cms/CMSCompressedDataStreamGenerator.cs2
-rw-r--r--crypto/src/cms/CMSSignedDataStreamGenerator.cs10
2 files changed, 6 insertions, 6 deletions
diff --git a/crypto/src/cms/CMSCompressedDataStreamGenerator.cs b/crypto/src/cms/CMSCompressedDataStreamGenerator.cs
index f992a8269..0e320aa9f 100644
--- a/crypto/src/cms/CMSCompressedDataStreamGenerator.cs
+++ b/crypto/src/cms/CMSCompressedDataStreamGenerator.cs
@@ -75,7 +75,7 @@ namespace Org.BouncyCastle.Cms
 				sGen.GetRawOutputStream(), 0, true);
 
 			// CMSVersion
-			cGen.AddObject(new DerInteger(0));
+			cGen.AddObject(DerInteger.Zero);
 
 			// CompressionAlgorithmIdentifier
 			cGen.AddObject(new AlgorithmIdentifier(CmsObjectIdentifiers.ZlibCompress));
diff --git a/crypto/src/cms/CMSSignedDataStreamGenerator.cs b/crypto/src/cms/CMSSignedDataStreamGenerator.cs
index 81f6f5068..800093207 100644
--- a/crypto/src/cms/CMSSignedDataStreamGenerator.cs
+++ b/crypto/src/cms/CMSSignedDataStreamGenerator.cs
@@ -653,7 +653,7 @@ namespace Org.BouncyCastle.Cms
 
 			if (otherCert)
 			{
-				return new DerInteger(5);
+				return DerInteger.Five;
 			}
 
 			if (_crls != null)
@@ -670,20 +670,20 @@ namespace Org.BouncyCastle.Cms
 
 			if (otherCrl)
 			{
-				return new DerInteger(5);
+				return DerInteger.Five;
 			}
 
 			if (attrCertV2Found)
 			{
-				return new DerInteger(4);
+				return DerInteger.Four;
 			}
 
             if (attrCertV1Found || !CmsObjectIdentifiers.Data.Equals(contentOid) || CheckForVersion3(_signers))
             {
-                return new DerInteger(3);
+                return DerInteger.Three;
             }
 
-            return new DerInteger(1);
+            return DerInteger.One;
         }
 
 		private bool CheckForVersion3(IList<SignerInformation> signerInfos)