//! Multi Precision Integers.
use std::fmt;
use std::cmp::Ordering;
use quickcheck::{Arbitrary, Gen};
use rand::Rng;
use crate::types::{
Curve,
HashAlgorithm,
PublicKeyAlgorithm,
SymmetricAlgorithm,
};
use crate::crypto::hash::{self, Hash};
use crate::crypto::mem::{secure_cmp, Protected};
use crate::serialize::Serialize;
use crate::Error;
use crate::Result;
/// Holds a single MPI.
#[derive(Clone)]
pub struct MPI {
/// Integer value as big-endian.
value: Box<[u8]>,
}
impl From<Vec<u8>> for MPI {
fn from(v: Vec<u8>) -> Self {
Self::new(&v)
}
}
impl MPI {
/// Creates a new MPI.