Add some lightweight documentation.

This commit is contained in:
2018-10-27 15:01:38 -07:00
parent 0bec74b18c
commit 1cb77de521
13 changed files with 79 additions and 7 deletions

View File

@@ -1,8 +1,15 @@
/// A trait definition for large numbers.
pub trait CryptoNum {
/// Generate a new value of the given type.
fn zero() -> Self;
/// Test if the number is zero.
fn is_zero(&self) -> bool;
/// Test if the number is even.
fn is_even(&self) -> bool;
/// Test if the number is odd.
fn is_odd(&self) -> bool;
/// Mask off the high parts of the number. In particular, it
/// zeros the bits above (len * 64).
fn mask(&mut self, len: usize);
}