Start including both signed and unsigned numbers, and starting building in Signed traits.

The latter seems much harder (and wordier) than it should be.
This commit is contained in:
2018-03-11 15:36:31 -07:00
parent 8a8c85703a
commit 667e32694e
4 changed files with 523 additions and 14 deletions

View File

@@ -8,19 +8,11 @@ mod core;
mod builder;
//mod extended_math;
// mod primes;
mod signed;
mod traits;
mod unsigned;
use self::core::*;
use self::traits::*;
use std::cmp::Ordering;
use std::fmt::{Debug,Error,Formatter};
use std::ops::*;
construct_unsigned!(U512, BarretMu512, u512, 8);
construct_unsigned!(U1024, BarretMu1024, u1024, 16);
construct_unsigned!(U2048, BarretMu2048, u2048, 32);
construct_unsigned!(U3072, BarretMu3072, u3072, 48);
construct_unsigned!(U4096, BarretMu4096, u4096, 64);
construct_unsigned!(U7680, BarretMu7680, u7680, 120);
construct_unsigned!(U8192, BarretMu8192, u8192, 128);
construct_unsigned!(U15360, BarretMu15360, u15360, 240);
// pub use self::extended_math::{modexp,modinv,extended_euclidean,egcd};
// pub use self::primes::{probably_prime};
pub use self::signed::{Signed};
pub use self::unsigned::{U512,U1024,U2048,U3072,U4096,U7680,U8192,U15360};