summary refs log tree commit diff
path: root/crypto/src/bcpg/SignaturePacket.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2024-01-23 14:05:18 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2024-01-23 14:05:18 +0700
commit48919250c89e0c6c435b226f5ea1d9076a195439 (patch)
treef2c64cbe7f253f8ced04a08ee0a115f3a3d0ddc1 /crypto/src/bcpg/SignaturePacket.cs
parentUse System.HashCode in a few places (diff)
downloadBouncyCastle.NET-ed25519-48919250c89e0c6c435b226f5ea1d9076a195439.tar.xz
Refactor some one-byte writes
Diffstat (limited to 'crypto/src/bcpg/SignaturePacket.cs')
-rw-r--r--crypto/src/bcpg/SignaturePacket.cs6
1 files changed, 2 insertions, 4 deletions
diff --git a/crypto/src/bcpg/SignaturePacket.cs b/crypto/src/bcpg/SignaturePacket.cs
index 305039e1c..ff3e5d3f9 100644
--- a/crypto/src/bcpg/SignaturePacket.cs
+++ b/crypto/src/bcpg/SignaturePacket.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
 using System.IO;
 
 using Org.BouncyCastle.Bcpg.Sig;
+using Org.BouncyCastle.Crypto.Utilities;
 using Org.BouncyCastle.Utilities;
 using Org.BouncyCastle.Utilities.Date;
 using Org.BouncyCastle.Utilities.IO;
@@ -265,10 +266,7 @@ namespace Org.BouncyCastle.Bcpg
 
                 byte[] trailer = new byte[5];
 				trailer[0] = (byte)signatureType;
-                trailer[1] = (byte)(time >> 24);
-                trailer[2] = (byte)(time >> 16);
-                trailer[3] = (byte)(time >>  8);
-                trailer[4] = (byte)(time      );
+                Pack.UInt32_To_BE((uint)time, trailer, 1);
                 return trailer;
             }