Skip to content

Commit

Permalink
BUmping version and clippy.
Browse files Browse the repository at this point in the history
  • Loading branch information
armfazh committed Jun 4, 2020
1 parent 7ec8c13 commit 8a44952
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/rustico.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Linting
run: cargo clippy
- name: Building
run: cargo build
run: cargo build --release --all-features
- name: Testing
run: cargo test
3 changes: 1 addition & 2 deletions src/primefield/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ impl Fp {
/// The `modulus` should be a prime number.
pub fn new(modulus: BigUint) -> Self {
// TODO: verify whether p is prime.
let p = modulus.to_bigint().unwrap();
Fp(Arc::new(Params {
p: p.clone(),
p: modulus.to_bigint().unwrap(),
sqrt_precmp: AtomicRefCell::new(None),
}))
}
Expand Down
4 changes: 2 additions & 2 deletions src/quadraticfield/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ impl_from_factory!(Fp2, <u8 u16 u32 u64 i8 i16 i32 i64>);
impl FromFactory<&str> for Fp2 {
type Output = <Fp2 as Field>::Elt;
fn from(&self, s: &str) -> Self::Output {
let vs: Vec<&str> = s.splitn(2, ",").collect();
let vs: Vec<&str> = s.splitn(2, ',').collect();
let n0: FpElt = self.0.base.from(vs[0]);
let n1: FpElt = self.0.base.from(vs[1]);
Fp2Elt {
Expand Down Expand Up @@ -242,7 +242,7 @@ impl<'a, 'b> BitXor<&'b BigUint> for &'a Fp2Elt {
let v = exp.to_u32_digits();
let mut out = Fp2Elt::one();
for vi in v.iter().rev() {
for j in 31..0 {
for j in (0..31).rev() {
out = &out * &out;
let bit = (*vi >> j) & 1;
if bit == 1 {
Expand Down

0 comments on commit 8a44952

Please sign in to comment.