Making bn no_std. Exposing miller_loop_batch and final_exponentiation. (#16)

This commit is contained in:
Maciej Zieliński
2020-01-21 14:44:14 +01:00
committed by Nikolay Volf
parent b1611b623e
commit 635c4cdd56
9 changed files with 55 additions and 35 deletions
+4 -4
View File
@@ -1,12 +1,12 @@
use alloc::vec::Vec;
use core::ops::{Add, Mul, Neg, Sub};
use rand::Rng;
use std::ops::{Add, Mul, Neg, Sub};
use super::FieldElement;
use fields::FieldElement;
use arith::{U256, U512};
#[cfg(feature = "rustc-serialize")]
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
use arith::{U256, U512};
macro_rules! field_impl {
($name:ident, $modulus:expr, $rsquared:expr, $rcubed:expr, $one:expr, $inv:expr) => {
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
+2 -3
View File
@@ -1,7 +1,6 @@
use fields::{const_fq, FieldElement, Fq, Fq2, Fq6};
use std::ops::{Add, Mul, Neg, Sub};
use core::ops::{Add, Mul, Neg, Sub};
use rand::Rng;
use fields::{const_fq, FieldElement, Fq, Fq2, Fq6};
use arith::U256;
fn frobenius_coeffs_c1(power: usize) -> Fq2 {
+2 -3
View File
@@ -1,7 +1,6 @@
use fields::{const_fq, FieldElement, Fq};
use std::ops::{Add, Mul, Neg, Sub};
use core::ops::{Add, Mul, Neg, Sub};
use rand::Rng;
use fields::{const_fq, FieldElement, Fq};
use arith::{U256, U512};
#[cfg(feature = "rustc-serialize")]
+1 -1
View File
@@ -1,5 +1,5 @@
use fields::{const_fq, FieldElement, Fq, Fq2};
use std::ops::{Add, Mul, Neg, Sub};
use core::ops::{Add, Mul, Neg, Sub};
use rand::Rng;
fn frobenius_coeffs_c1(n: usize) -> Fq2 {
+2 -2
View File
@@ -5,8 +5,8 @@ mod fq12;
use arith::U256;
use rand::Rng;
use std::ops::{Add, Mul, Neg, Sub};
use std::fmt::Debug;
use core::ops::{Add, Mul, Neg, Sub};
use alloc::fmt::Debug;
pub use self::fp::{const_fq, Fq, Fr};
pub use self::fq2::{Fq2, fq2_nonresidue};