Module openssl::bn
[−]
[src]
BigNum implementation
Large numbers are important for a cryptographic library. OpenSSL implementation of BigNum uses dynamically assigned memory to store an array of bit chunks. This allows numbers of any size to be compared and mathematical functions performed.
OpenSSL wiki describes the BIGNUM
data structure.
Examples
use openssl::bn::BigNum; use openssl::error::ErrorStack; fn bignums() -> Result< (), ErrorStack > { let a = BigNum::new()?; // a = 0 let b = BigNum::from_dec_str("1234567890123456789012345")?; let c = &a * &b; assert_eq!(a,c); Ok(()) }
Structs
BigNum |
Dynamically sized large number impelementation |
BigNumContext |
Temporary storage for BigNums on the secure heap |
BigNumContextRef |
Reference to |
BigNumRef |
Reference to a |
MsbOption |
Options for the most significant bits of a randomly generated |
Constants
MSB_MAYBE_ZERO |
The most significant bit of the number may be 0. |
MSB_ONE |
The most significant bit of the number must be 1. |
TWO_MSB_ONE |
The most significant two bits of the number must be 1. |