Example #1
0
		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;
		}
Example #2
0
 public BigInteger(Org.BouncyCastle.Math.BigInteger value)
     : base(value.ToByteArray())
 {
 }
Example #3
0
        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());

            }
        }