Skip to content

Commit

Permalink
fix: naming
Browse files Browse the repository at this point in the history
  • Loading branch information
0xWOLAND committed Aug 19, 2024
1 parent aef4712 commit e5f63c2
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions src/scalar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -540,8 +540,8 @@ impl Scalar {
{
unconstrained! {
let mut buf = [0u8; 33];
self._invert().map(|sqrt| {
buf[0..32].copy_from_slice(&sqrt.to_bytes());
self._invert().map(|inv| {
buf[0..32].copy_from_slice(&inv.to_bytes());
buf[32] = 1;
});
hint_slice(&buf);
Expand Down Expand Up @@ -733,22 +733,12 @@ impl Scalar {
Scalar([d0 & mask, d1 & mask, d2 & mask, d3 & mask])
}

/// Divide `self` by n.
#[inline]
pub fn divn(&self, mut n: u32) -> Scalar {
if n >= 256 {
return Scalar::from(0);
}

// cfg_if! {
// if #[cfg(target_os = "zkvm")]
// {
// let mut lhs = Scalar::from(n as u64).invert().unwrap();
// lhs.mul_inp(&self);
// lhs
// }
// else
// {
let mut out = self.clone();

while n >= 64 {
Expand All @@ -771,8 +761,6 @@ impl Scalar {

out
}
// }
// }
}

impl From<Scalar> for [u8; 32] {
Expand Down

0 comments on commit e5f63c2

Please sign in to comment.