Skip to content

Commit c4cebd1

Browse files
committed
primefield: remove shr support
It was noted as buggy in #1319. Turns out it was completely unused, aside from fulfilling a bound in the `elliptic-curve` crate, which has since been removed. Closes #1319
1 parent e8b3a04 commit c4cebd1

File tree

2 files changed

+1
-67
lines changed

2 files changed

+1
-67
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

primefield/src/lib.rs

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -197,22 +197,6 @@ macro_rules! field_element_type {
197197

198198
res
199199
}
200-
201-
/// Right shifts the [`
202-
#[doc = stringify!($fe)]
203-
/// `].
204-
pub const fn shr(&self, shift: u32) -> Self {
205-
Self(self.0.wrapping_shr(shift))
206-
}
207-
208-
/// Right shifts the [`
209-
#[doc = stringify!($fe)]
210-
/// `].
211-
///
212-
/// Note: not constant-time with respect to the `shift` parameter.
213-
pub const fn shr_vartime(&self, shift: u32) -> Self {
214-
Self(self.0.wrapping_shr_vartime(shift))
215-
}
216200
}
217201

218202
impl $crate::ff::Field for $fe {
@@ -323,56 +307,6 @@ macro_rules! field_element_type {
323307
}
324308
}
325309

326-
impl ::core::ops::Shr<u32> for $fe {
327-
type Output = Self;
328-
329-
#[inline]
330-
fn shr(self, rhs: u32) -> Self {
331-
Self::shr(&self, rhs)
332-
}
333-
}
334-
335-
impl ::core::ops::Shr<u32> for &$fe {
336-
type Output = Self;
337-
338-
#[inline]
339-
fn shr(self, rhs: u32) -> Self {
340-
Self::shr(self, rhs)
341-
}
342-
}
343-
344-
impl ::core::ops::ShrAssign<u32> for $fe {
345-
#[inline]
346-
fn shr_assign(&mut self, rhs: u32) {
347-
*self = Self::shr(self, rhs)
348-
}
349-
}
350-
351-
impl ::core::ops::Shr<usize> for $fe {
352-
type Output = Self;
353-
354-
#[inline]
355-
fn shr(self, rhs: usize) -> Self {
356-
Self::shr(&self, rhs as u32)
357-
}
358-
}
359-
360-
impl ::core::ops::Shr<usize> for &$fe {
361-
type Output = Self;
362-
363-
#[inline]
364-
fn shr(self, rhs: usize) -> Self {
365-
Self::shr(self, rhs as u32)
366-
}
367-
}
368-
369-
impl ::core::ops::ShrAssign<usize> for $fe {
370-
#[inline]
371-
fn shr_assign(&mut self, rhs: usize) {
372-
*self = Self::shr(self, rhs as u32)
373-
}
374-
}
375-
376310
impl ::core::fmt::Debug for $fe {
377311
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
378312
write!(f, "{}(0x{:X})", stringify!($fe), &self.0)

0 commit comments

Comments
 (0)