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

14
src/cryptonum/unsigned.rs Normal file
View File

@@ -0,0 +1,14 @@
use cryptonum::core::*;
use cryptonum::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);