public static byte[] ToByteArray(Org.BouncyCastle.Math.BigInteger bigint, int expectedLength) { byte[] data = bigint.ToByteArray (); if (data.Length == expectedLength + 1) { return data.Skip (1).Take (expectedLength).ToArray (); } return data; }
public BigInteger(Org.BouncyCastle.Math.BigInteger value) : base(value.ToByteArray()) { }
public static void EncodeMpiBytes(Org.BouncyCastle.Math.BigInteger big_int_data, ref byte[] out_byte_array) { try { EncodeMpiBytesBE(big_int_data.ToByteArray(), ref out_byte_array); } catch (Exception ex) { throw new InvalidDataException("EncodeMpiBytes:" + ex.ToString()); } }