From 8ea73507c5974ca7a7a7e68c29b1620f5a45a3f5 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Fri, 26 Apr 2019 23:09:05 +0100 Subject: [PATCH] Add bignum support --- Cargo.toml | 1 + src/bignum.rs | 5 +++++ src/lib.rs | 3 +++ 3 files changed, 9 insertions(+) create mode 100644 src/bignum.rs diff --git a/Cargo.toml b/Cargo.toml index e80b73c..b68eff0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,3 +14,4 @@ wee_alloc = "0.4.4" default = [ "std" ] std = [] debug = [] +bignum = [] diff --git a/src/bignum.rs b/src/bignum.rs new file mode 100644 index 0000000..46a7885 --- /dev/null +++ b/src/bignum.rs @@ -0,0 +1,5 @@ +/// The bignum system library. +extern "C" { + pub fn bignum_mul256(a: *const u32, b: *const u32, ret: *mut u32); + pub fn bignum_umulmod256(a: *const u32, b: *const u32, modulo: *const u32, ret: *mut u32); +} diff --git a/src/lib.rs b/src/lib.rs index 3420c77..d1773fc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -29,6 +29,9 @@ pub mod types; #[cfg(feature = "debug")] pub mod debug; +#[cfg(feature = "bignum")] +pub mod bignum; + #[cfg(not(feature = "std"))] pub mod convert;