Exemple #1
0
        internal static void writePaddedBigInteger(DNSOutput @out, Org.BouncyCastle.Math.BigInteger val, int len)
        {
            byte[] b = trimByteArray(val.ToByteArray());

            if (b.Length > len)
            {
                throw new IllegalArgumentException();
            }

            if (b.Length < len)
            {
                byte[] pad = new byte[len - b.Length];
                @out.writeByteArray(pad);
            }

            @out.writeByteArray(b);
        }
Exemple #2
0
 internal static void writeBigInteger(DNSOutput @out, Org.BouncyCastle.Math.BigInteger val)
 {
     byte[] b = trimByteArray(val.ToByteArray());
     @out.writeByteArray(b);
 }