Struct pumpkin::Prime []

pub struct Prime(pub Int);

A cryptographically secure prime number.

Methods

impl Prime
[src]

fn new(bit_length: usize) -> Prime

Constructs a new Prime with a size of bit_length bits.

This will initialize an OsRng instance and call the Prime::from_rng() method.

Note: the bit_length MUST be at least 512-bits.

fn from_rng(bit_length: usize, rngesus: &mut OsRng) -> Prime

Constructs a new Prime with the size of bit_length bits, sourced from an already-created OsRng. Not that you can ONLY use an OsRng, as it uses the operating system's secure source of entropy.

Trait Implementations

impl Debug for Prime

fn fmt(&self, fmt: &mut Formatter) -> Result

impl Display for Prime

fn fmt(&self, fmt: &mut Formatter) -> Result

impl Binary for Prime

fn fmt(&self, fmt: &mut Formatter) -> Result

impl Octal for Prime

fn fmt(&self, fmt: &mut Formatter) -> Result

impl LowerHex for Prime

fn fmt(&self, fmt: &mut Formatter) -> Result

impl UpperHex for Prime

fn fmt(&self, fmt: &mut Formatter) -> Result

impl Add<Prime> for Prime

type Output = Prime

fn add(self, rhs: Self) -> Prime

impl Add<Int> for Prime

type Output = Prime

fn add(self, rhs: Int) -> Prime

impl Sub<Prime> for Prime

type Output = Prime

fn sub(self, rhs: Self) -> Prime

impl Sub<Int> for Prime

type Output = Prime

fn sub(self, rhs: Int) -> Prime

impl Mul<Prime> for Prime

type Output = Prime

fn mul(self, rhs: Self) -> Prime

impl Mul<Int> for Prime

type Output = Prime

fn mul(self, rhs: Int) -> Prime

impl Div<Prime> for Prime

type Output = Prime

fn div(self, rhs: Self) -> Prime

impl Div<Int> for Prime

type Output = Prime

fn div(self, rhs: Int) -> Prime

impl Rem<Prime> for Prime

type Output = Prime

fn rem(self, rhs: Self) -> Prime

impl Rem<Int> for Prime

type Output = Prime

fn rem(self, rhs: Int) -> Prime

impl BitAnd<Prime> for Prime

type Output = Prime

fn bitand(self, rhs: Self) -> Prime

impl BitAnd<Int> for Prime

type Output = Prime

fn bitand(self, rhs: Int) -> Prime

impl BitOr<Prime> for Prime

type Output = Prime

fn bitor(self, rhs: Self) -> Prime

impl BitOr<Int> for Prime

type Output = Prime

fn bitor(self, rhs: Int) -> Prime

impl BitXor<Prime> for Prime

type Output = Prime

fn bitxor(self, rhs: Self) -> Prime

impl BitXor<Int> for Prime

type Output = Prime

fn bitxor(self, rhs: Int) -> Prime