You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@milagro.apache.org by km...@apache.org on 2019/12/13 16:34:05 UTC

[incubator-milagro-crypto-rust] 07/18: Fix bn256CX and other minor issues

This is an automated email from the ASF dual-hosted git repository.

kmccusker pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/incubator-milagro-crypto-rust.git

commit fcc4c3a08c89de23ec83c6009b934f5bb6c87931
Author: Kirk Baird <ba...@outlook.com>
AuthorDate: Thu Aug 8 15:05:29 2019 +1000

    Fix bn256CX and other minor issues
    
    Signed-off-by: Kirk Baird <ba...@outlook.com>
---
 Cargo.toml | 12 ++++++------
 src/ff.rs  | 14 +++++++-------
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/Cargo.toml b/Cargo.toml
index b3a8fa8..6596861 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -15,19 +15,19 @@ path = "src/lib.rs"
 
 [features]
 default = ["bn254"]
-bn254 = []
-bn254cx = []
-ansii = []
+anssi = []
 bls24 = []
 bls48 = []
 bls381 = []
 bls383 = []
 bls461 = []
+bn254 = []
+bn254CX = []
 brainpool = []
 c25519 = []
 c41417 = []
 ed25519 = []
-fp256Bn = []
+fp256BN = []
 fp512BN = []
 goldilocks = []
 hifive = []
@@ -40,7 +40,7 @@ nums384e = []
 nums384w = []
 nums512e = []
 nums512w = []
-secp256k1 = []
 rsa2048 = []
 rsa3072 = []
-rsa4096 = []
\ No newline at end of file
+rsa4096 = []
+secp256k1 = []
diff --git a/src/ff.rs b/src/ff.rs
index 54e7a32..90e7fdf 100644
--- a/src/ff.rs
+++ b/src/ff.rs
@@ -26,12 +26,12 @@ use rand::RAND;
 use super::super::arch::DChunk;
 
 /* Finite field support - for RSA, DH etc. */
-/* RSA/DH modulus length as multiple of BigBITS */
+/* RSA/DH modulus length as multiple of BIGBITS */
 
 pub use super::rom::FFLEN;
 //use std::str::SplitWhitespace;
 
-pub const FF_BITS: usize = (big::BigBITS * FFLEN); /* Finite Field Size in bits - must be 256.2^n */
+pub const FF_BITS: usize = (big::BIGBITS * FFLEN); /* Finite Field Size in bits - must be 256.2^n */
 pub const HFLEN: usize = (FFLEN / 2); /* Useful for half-size RSA private key operations */
 
 pub const P_MBITS: usize = (big::MODBYTES as usize) * 8;
@@ -142,7 +142,7 @@ impl FF {
         return true;
     }
 
-    /* shift right by BigBITS-bit words */
+    /* shift right by BIGBITS-bit words */
     pub fn shrw(&mut self, n: usize) {
         let mut t = Big::new();
         for i in 0..n {
@@ -152,7 +152,7 @@ impl FF {
         }
     }
 
-    /* shift left by BigBITS-bit words */
+    /* shift left by BIGBITS-bit words */
     pub fn shlw(&mut self, n: usize) {
         let mut t = Big::new();
         for i in 0..n {
@@ -548,7 +548,7 @@ impl FF {
         x.copy(&self);
         x.norm();
         m.dsucopy(&b);
-        let mut k = big::BigBITS * n;
+        let mut k = big::BIGBITS * n;
 
         while FF::comp(&x, &m) >= 0 {
             x.sub(&m);
@@ -793,7 +793,7 @@ impl FF {
 
         let mut i = 8 * (big::MODBYTES as usize) * n - 1;
         loop {
-            let b = (e.v[i / (big::BigBITS as usize)]).bit(i % (big::BigBITS as usize)) as isize;
+            let b = (e.v[i / (big::BIGBITS as usize)]).bit(i % (big::BIGBITS as usize)) as isize;
             self.copy(&r0);
             self.modmul(&r1, p, &nd);
 
@@ -892,7 +892,7 @@ impl FF {
         let mut i = 8 * (big::MODBYTES as usize) * n - 1;
         loop {
             self.modsqr(p, &nd);
-            let b = (e.v[i / (big::BigBITS as usize)]).bit(i % (big::BigBITS as usize)) as isize;
+            let b = (e.v[i / (big::BIGBITS as usize)]).bit(i % (big::BIGBITS as usize)) as isize;
             if b == 1 {
                 self.modmul(&w, p, &nd)
             }