feat: biginteger implementation #495
reviewdog [clippy] report
reported by reviewdog 🐶
Findings (126)
lib/crypto/src/arithmetic/mod.rs|323 col 17| warning: 5 bindings with single-character names in scope
--> lib/crypto/src/arithmetic/mod.rs:323:17
|
323 | let mut i = 0;
| ^
...
330 | let mut j = 0;
| ^
...
334 | let k = i + j;
| ^
...
337 | let (n, c) = ct_mac_with_carry(
| ^ ^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#many_single_char_names
= note: -W clippy::many-single-char-names
implied by -W clippy::pedantic
= help: to override -W clippy::pedantic
add #[allow(clippy::many_single_char_names)]
lib/crypto/src/arithmetic/mod.rs|323 col 17| warning: 5 bindings with single-character names in scope
--> lib/crypto/src/arithmetic/mod.rs:323:17
|
323 | let mut i = 0;
| ^
...
330 | let mut j = 0;
| ^
...
334 | let k = i + j;
| ^
...
346 | let (n, c) = ct_mac_with_carry(
| ^ ^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#many_single_char_names
lib/crypto/src/field/fp.rs|22 col 5| warning: unused import: ops::Mul
--> lib/crypto/src/field/fp.rs:22:5
|
22 | ops::Mul,
| ^^^^^^^^
|
= note: #[warn(unused_imports)]
on by default
lib/crypto/src/field/fp.rs|26 col 18| warning: unused import: ConstZero
--> lib/crypto/src/field/fp.rs:26:18
|
26 | use num_traits::{ConstZero, One, Zero};
| ^^^^^^^^^
lib/crypto/src/arithmetic/mod.rs|68 col 1| warning: method const_add_with_carry
is never used
--> lib/crypto/src/arithmetic/mod.rs:223:25
|
68 | impl Uint {
| ---------------------------- method in this implementation
...
223 | pub(crate) const fn const_add_with_carry(
| ^^^^^^^^^^^^^^^^^^^^
|
= note: #[warn(dead_code)]
on by default
lib/crypto/src/arithmetic/mod.rs|69 col 27| warning: casting usize
to u32
may truncate the value on targets with 64-bit wide pointers
--> lib/crypto/src/arithmetic/mod.rs:69:27
|
69 | pub const BITS: u32 = (N as u32) * Limb::BITS;
| ^^^^^^^^^^
|
= help: if this is intentional allow the lint with #[allow(clippy::cast_possible_truncation)]
...
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation
= note: -W clippy::cast-possible-truncation
implied by -W clippy::pedantic
= help: to override -W clippy::pedantic
add #[allow(clippy::cast_possible_truncation)]
help: ... or use try_from
and handle the error accordingly
|
69 | pub const BITS: u32 = u32::try_from(N) * Limb::BITS;
| ~~~~~~~~~~~~~~~~
lib/crypto/src/arithmetic/mod.rs|73 col 5| warning: this method could have a #[must_use]
attribute
--> lib/crypto/src/arithmetic/mod.rs:73:5
|
73 | pub const fn new(value: [u64; N]) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: #[must_use] pub const fn new(value: [u64; N]) -> Self
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
= note: -W clippy::must-use-candidate
implied by -W clippy::pedantic
= help: to override -W clippy::pedantic
add #[allow(clippy::must_use_candidate)]
lib/crypto/src/arithmetic/mod.rs|77 col 5| warning: this method could have a #[must_use]
attribute
--> lib/crypto/src/arithmetic/mod.rs:77:5
|
77 | pub const fn as_limbs(&self) -> &[Limb; N] {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: #[must_use] pub const fn as_limbs(&self) -> &[Limb; N]
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
lib/crypto/src/arithmetic/mod.rs|83 col 5| warning: this method could have a #[must_use]
attribute
--> lib/crypto/src/arithmetic/mod.rs:83:5
|
83 | pub const fn zero() -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: #[must_use] pub const fn zero() -> Self
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
lib/crypto/src/arithmetic/mod.rs|87 col 5| warning: this method could have a #[must_use]
attribute
--> lib/crypto/src/arithmetic/mod.rs:87:5
|
87 | pub const fn one() -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: #[must_use] pub const fn one() -> Self
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
lib/crypto/src/arithmetic/mod.rs|94 col 5| warning: this method could have a #[must_use]
attribute
--> lib/crypto/src/arithmetic/mod.rs:94:5
|
94 | pub const fn from_u32(val: u32) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: #[must_use] pub const fn from_u32(val: u32) -> Self
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
lib/crypto/src/arithmetic/mod.rs|101 col 5| warning: this method could have a #[must_use]
attribute
--> lib/crypto/src/arithmetic/mod.rs:101:5
|
101 | pub const fn const_is_even(&self) -> bool {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: #[must_use] pub const fn const_is_even(&self) -> bool
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
lib/crypto/src/arithmetic/mod.rs|106 col 5| warning: this method could have a #[must_use]
attribute
--> lib/crypto/src/arithmetic/mod.rs:106:5
|
106 | pub const fn const_is_odd(&self) -> bool {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: #[must_use] pub const fn const_is_odd(&self) -> bool
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
lib/crypto/src/arithmetic/mod.rs|111 col 5| warning: this method could have a #[must_use]
attribute
--> lib/crypto/src/arithmetic/mod.rs:111:5
|
111 | pub const fn mod_4(&self) -> u8 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: #[must_use] pub const fn mod_4(&self) -> u8
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
lib/crypto/src/arithmetic/mod.rs|120 col 5| warning: this method could have a #[must_use]
attribute
--> lib/crypto/src/arithmetic/mod.rs:120:5
|
120 | pub const fn const_shr(&self) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: #[must_use] pub const fn const_shr(&self) -> Self
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
lib/crypto/src/arithmetic/mod.rs|120 col 5| warning: missing #[must_use]
attribute on a method returning Self
--> lib/crypto/src/arithmetic/mod.rs:120:5
|
120 | / pub const fn const_shr(&self) -> Self {
121 | | let mut result = *self;
122 | | let mut t = 0;
123 | | crate::const_for!((i in 0..N) {
... |
130 | | result
131 | | }
| |^
|
= help: consider adding the #[must_use]
attribute to the method or directly to the Self
type
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
= note: -W clippy::return-self-not-must-use
implied by -W clippy::pedantic
= help: to override -W clippy::pedantic
add #[allow(clippy::return_self_not_must_use)]
lib/crypto/src/arithmetic/mod.rs|149 col 5| warning: this method could have a #[must_use]
attribute
--> lib/crypto/src/arithmetic/mod.rs:149:5
|
149 | pub const fn two_adic_valuation(mut self) -> u32 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: #[must_use] pub const fn two_adic_valuation(mut self) -> u32
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
lib/crypto/src/arithmetic/mod.rs|165 col 5| warning: this method could have a #[must_use]
attribute
--> lib/crypto/src/arithmetic/mod.rs:165:5
|
165 | pub const fn two_adic_coefficient(mut self) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: #[must_use] pub const fn two_adic_coefficient(mut self) -> Self
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
lib/crypto/src/arithmetic/mod.rs|165 col 5| warning: missing #[must_use]
attribute on a method returning Self
--> lib/crypto/src/arithmetic/mod.rs:165:5
|
165 | / pub const fn two_adic_coefficient(mut self) -> Self {
166 | | assert!(self.const_is_odd());
167 | | // Since self
is odd, we can always subtract one
168 | | // without a borrow
... |
174 | | self
175 | | }
| |^
|
= help: consider adding the #[must_use]
attribute to the method or directly to the Self
type
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
lib/crypto/src/arithmetic/mod.rs|181 col 5| warning: this method could have a #[must_use]
attribute
--> lib/crypto/src/arithmetic/mod.rs:181:5
|
181 | pub const fn divide_by_2_round_down(mut self) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: #[must_use] pub const fn divide_by_2_round_down(mut self) -> Self
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
lib/crypto/src/arithmetic/mod.rs|181 col 5| warning: missing #[must_use]
attribute on a method returning Self
--> lib/crypto/src/arithmetic/mod.rs:181:5
|
181 | / pub const fn divide_by_2_round_down(mut self) -> Self {
182 | | if self.const_is_odd() {
183 | | self.limbs[0] -= 1;
184 | | }
185 | | self.const_shr()
186 | | }
| |^
|
= help: consider adding the #[must_use]
attribute to the method or directly to the Self
type
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
lib/crypto/src/arithmetic/mod.rs|190 col 5| warning: this method could have a #[must_use]
attribute
--> lib/crypto/src/arithmetic/mod.rs:190:5
|
190 | pub const fn const_num_bits(self) -> u32 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: #[must_use] pub const fn const_num_bits(self) -> u32
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
lib/crypto/src/arithmetic/mod.rs|191 col 9| warning: casting usize
to u32
may truncate the value on targets with 64-bit wide pointers
--> lib/crypto/src/arithmetic/mod.rs:191:9
|
191 | ((N - 1) * 64) as u32 + (64 - self.limbs[N - 1].leading_zeros())
| ^^^^^^^^^^^^^^^^^^^^^
|
= help: if this is intentional allow the lint with #[allow(clippy::cast_possible_truncation)]
...
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation
help: ... or use try_from
and handle the error accordingly
|
191 | u32::try_from((N - 1) * 64) + (64 - self.limbs[N - 1].leading_zeros())
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/crypto/src/arithmetic/mod.rs|259 col 5| warning: this method could have a #[must_use]
attribute
--> lib/crypto/src/arithmetic/mod.rs:259:5
|
259 | pub const fn montgomery_r(&self) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: #[must_use] pub const fn montgomery_r(&self) -> Self
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
lib/crypto/src/arithmetic/mod.rs|259 col 5| warning: missing #[must_use]
attribute on a method returning Self
--> lib/crypto/src/arithmetic/mod.rs:259:5
|
259 | / pub const fn montgomery_r(&self) -> Self {
260 | | let two_pow_n_times_64 = crate::const_helpers::RBuffer([0u64; N], 1);
261 | | const_modulo!(two_pow_n_times_64, self)
262 | | }
| |^
|
= help: consider adding the #[must_use]
attribute to the method or directly to the Self
type
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
lib/crypto/src/const_helpers.rs|87 col 21| warning: casting u32
to isize
may wrap around the value on targets with 32-bit wide pointers
--> lib/crypto/src/const_helpers.rs:87:21
|
87 | let mut i = ($a.num_bits() - 1) as isize;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
::: lib/crypto/src/arithmetic/mod.rs:261:9
|
261 | const_modulo!(two_pow_n_times_64, self)
| --------------------------------------- in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_wrap
= note: -W clippy::cast-possible-wrap
implied by -W clippy::pedantic
= help: to override -W clippy::pedantic
add #[allow(clippy::cast_possible_wrap)]
= note: this warning originates in the macro const_modulo
(in Nightly builds, run with -Z macro-backtrace for more info)
lib/crypto/src/const_helpers.rs|91 col 46| warning: casting isize
to usize
may lose the sign of the value
--> lib/crypto/src/const_helpers.rs:91:46
|
91 | remainder.limbs[0] |= $a.get_bit(i as usize) as u64;
| ^^^^^^^^^^
|
::: lib/crypto/src/arithmetic/mod.rs:261:9
|
261 | const_modulo!(two_pow_n_times_64, self)
| --------------------------------------- in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_sign_loss
= note: -W clippy::cast-sign-loss
implied by -W clippy::pedantic
= help: to override -W clippy::pedantic
add #[allow(clippy::cast_sign_loss)]
= note: this warning originates in the macro const_modulo
(in Nightly builds, run with -Z macro-backtrace for more info)
lib/crypto/src/arithmetic/mod.rs|266 col 5| warning: this method could have a #[must_use]
attribute
--> lib/crypto/src/arithmetic/mod.rs:266:5
|
266 | pub const fn montgomery_r2(&self) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: #[must_use] pub const fn montgomery_r2(&self) -> Self
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
lib/crypto/src/arithmetic/mod.rs|266 col 5| warning: missing #[must_use]
attribute on a method returning Self
--> lib/crypto/src/arithmetic/mod.rs:266:5
|
266 | / pub const fn montgomery_r2(&self) -> Self {
267 | | let two_pow_n_times_64_square =
268 | | crate::const_helpers::R2Buffer([0u64; N], [0u64; N], 1);
269 | | const_modulo!(two_pow_n_times_64_square, self)
270 | | }
| |^
|
= help: consider adding the #[must_use]
attribute to the method or directly to the Self
type
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
lib/crypto/src/const_helpers.rs|87 col 21| warning: casting u32
to isize
may wrap around the value on targets with 32-bit wide pointers
--> lib/crypto/src/const_helpers.rs:87:21
|
87 | let mut i = ($a.num_bits() - 1) as isize;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
::: lib/crypto/src/arithmetic/mod.rs:269:9
|
269 | const_modulo!(two_pow_n_times_64_square, self)
| ---------------------------------------------- in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_wrap
= note: this warning originates in the macro const_modulo
(in Nightly builds, run with -Z macro-backtrace for more info)
lib/crypto/src/const_helpers.rs|91 col 46| warning: casting isize
to usize
may lose the sign of the value
--> lib/crypto/src/const_helpers.rs:91:46
|
91 | remainder.limbs[0] |= $a.get_bit(i as usize) as u64;
| ^^^^^^^^^^
|
::: lib/crypto/src/arithmetic/mod.rs:269:9
|
269 | const_modulo!(two_pow_n_times_64_square, self)
| ---------------------------------------------- in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_sign_loss
= note: this warning originates in the macro const_modulo
(in Nightly builds, run with -Z macro-backtrace for more info)
lib/crypto/src/arithmetic/mod.rs|283 col 5| warning: you have declared #[inline(always)]
on add_with_carry
. This is usually a bad idea
--> lib/crypto/src/arithmetic/mod.rs:283:5
|
283 | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
= note: -W clippy::inline-always
implied by -W clippy::pedantic
= help: to override -W clippy::pedantic
add #[allow(clippy::inline_always)]
lib/crypto/src/arithmetic/mod.rs|294 col 5| warning: you have declared #[inline(always)]
on sub_with_borrow
. This is usually a bad idea
--> lib/crypto/src/arithmetic/mod.rs:294:5
|
294 | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
lib/crypto/src/arithmetic/mod.rs|319 col 5| warning: this method could have a #[must_use]
attribute
--> lib/crypto/src/arithmetic/mod.rs:319:5
|
319 | / pub const fn ct_mul_wide(
320 | | &self,
321 | | rhs: &Uint,
322 | | ) -> (Self, Uint) {
| |_________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
help: add the attribute
|
319 ~ #[must_use] pub const fn ct_mul_wide(
320 + &self,
321 + rhs: &Uint,
322 ~ ) -> (Self, Uint) {
|
lib/crypto/src/arithmetic/mod.rs|370 col 5| warning: you have declared #[inline(always)]
on ct_adc
. This is usually a bad idea
--> lib/crypto/src/arithmetic/mod.rs:370:5
|
370 | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
lib/crypto/src/arithmetic/mod.rs|373 col 5| warning: this method could have a #[must_use]
attribute
--> lib/crypto/src/arithmetic/mod.rs:373:5
|
373 | pub const fn ct_adc(&self, rhs: &Uint, mut carry: Limb) -> (Self, Limb) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: #[must_use] pub const fn ct_adc(&self, rhs: &Uint<N>, mut carry: Limb) -> (Self, Limb)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
lib/crypto/src/arithmetic/mod.rs|389 col 5| warning: this method could have a #[must_use]
attribute
--> lib/crypto/src/arithmetic/mod.rs:389:5
|
389 | pub const fn ct_from_le_slice(bytes: &[u8]) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: #[must_use] pub const fn ct_from_le_slice(bytes: &[u8]) -> Self
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
lib/crypto/src/arithmetic/mod.rs|414 col 1| warning: you have declared #[inline(always)]
on widening_mul
. This is usually a bad idea
--> lib/crypto/src/arithmetic/mod.rs:414:1
|
414 | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
lib/crypto/src/arithmetic/mod.rs|416 col 1| warning: this function could have a #[must_use]
attribute
--> lib/crypto/src/arithmetic/mod.rs:416:1
|
416 | pub const fn widening_mul(a: u64, b: u64) -> u128 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: #[must_use] pub const fn widening_mul(a: u64, b: u64) -> u128
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
lib/crypto/src/arithmetic/mod.rs|440 col 1| warning: you have declared #[inline(always)]
on mac
. This is usually a bad idea
--> lib/crypto/src/arithmetic/mod.rs:440:1
|
440 | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
lib/crypto/src/arithmetic/mod.rs|442 col 1| warning: this function could have a #[must_use]
attribute
--> lib/crypto/src/arithmetic/mod.rs:442:1
|
442 | pub const fn mac(a: u64, b: u64, c: u64) -> (u64, u64) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: #[must_use] pub const fn mac(a: u64, b: u64, c: u64) -> (u64, u64)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
lib/crypto/src/arithmetic/mod.rs|445 col 6| warning: casting u128
to u64
may truncate the value
--> lib/crypto/src/arithmetic/mod.rs:445:6
|
445 | (tmp as u64, carry)
| ^^^^^^^^^^
|
= help: if this is intentional allow the lint with #[allow(clippy::cast_possible_truncation)]
...
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation
help: ... or use try_from
and handle the error accordingly
|
445 | (u64::try_from(tmp), carry)
| ~~~~~~~~~~~~~~~~~~
lib/crypto/src/arithmetic/mod.rs|450 col 1| warning: you have declared #[inline(always)]
on carrying_mac
. This is usually a bad idea
--> lib/crypto/src/arithmetic/mod.rs:450:1
|
450 | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
lib/crypto/src/arithmetic/mod.rs|452 col 1| warning: this function could have a #[must_use]
attribute
--> lib/crypto/src/arithmetic/mod.rs:452:1
|
452 | pub const fn carrying_mac(a: u64, b: u64, c: u64, carry: u64) -> (u64, u64) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: #[must_use] pub const fn carrying_mac(a: u64, b: u64, c: u64, carry: u64) -> (u64, u64)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
lib/crypto/src/arithmetic/mod.rs|455 col 6| warning: casting u128
to u64
may truncate the value
--> lib/crypto/src/arithmetic/mod.rs:455:6
|
455 | (tmp as u64, carry)
| ^^^^^^^^^^
|
= help: if this is intentional allow the lint with #[allow(clippy::cast_possible_truncation)]
...
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation
help: ... or use try_from
and handle the error accordingly
|
455 | (u64::try_from(tmp), carry)
| ~~~~~~~~~~~~~~~~~~
lib/crypto/src/arithmetic/mod.rs|458 col 1| warning: this function could have a #[must_use]
attribute
--> lib/crypto/src/arithmetic/mod.rs:458:1
|
458 | / pub const fn ct_mac_with_carry(
459 | | a: Limb,
460 | | b: Limb,
461 | | c: Limb,
462 | | carry: Limb,
463 | | ) -> (Limb, Limb) {
| |____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
help: add the attribute
|
458 + #[must_use] pub const fn ct_mac_with_carry(
459 + a: Limb,
460 + b: Limb,
461 + c: Limb,
462 + carry: Limb,
463 ~ ) -> (Limb, Limb) {
|
lib/crypto/src/arithmetic/mod.rs|469 col 6| warning: casting u128
to u64
may truncate the value
--> lib/crypto/src/arithmetic/mod.rs:469:6
|
469 | (ret as Limb, (ret >> Limb::BITS) as Limb)
| ^^^^^^^^^^^
|
= help: if this is intentional allow the lint with #[allow(clippy::cast_possible_truncation)]
...
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation
help: ... or use try_from
and handle the error accordingly
|
469 | (Limb::try_from(ret), (ret >> Limb::BITS) as Limb)
| ~~~~~~~~~~~~~~~~~~~
lib/crypto/src/arithmetic/mod.rs|474 col 1| warning: you have declared #[inline(always)]
on mac_discard
. This is usually a bad idea
--> lib/crypto/src/arithmetic/mod.rs:474:1
|
474 | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
lib/crypto/src/arithmetic/mod.rs|477 col 15| warning: casts from u64
to u128
can be expressed infallibly using From
--> lib/crypto/src/arithmetic/mod.rs:477:15
|
477 | let tmp = (a as u128) + widening_mul(b, c);
| ^^^^^^^^^^^
|
= help: an as
cast can become silently lossy if the types change in the future
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless
= note: -W clippy::cast-lossless
implied by -W clippy::pedantic
= help: to override -W clippy::pedantic
add #[allow(clippy::cast_lossless)]
help: use u128::from
instead
|
477 | let tmp = u128::from(a) + widening_mul(b, c);
| ~~~~~~~~~~~~~
lib/crypto/src/arithmetic/mod.rs|483 col 1| warning: you have declared #[inline(always)]
on adc
. This is usually a bad idea
--> lib/crypto/src/arithmetic/mod.rs:483:1
|
483 | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
lib/crypto/src/arithmetic/mod.rs|486 col 1| warning: this function could have a #[must_use]
attribute
--> lib/crypto/src/arithmetic/mod.rs:486:1
|
486 | pub const fn adc(a: u64, b: u64, carry: u64) -> (u64, u64) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: #[must_use] pub const fn adc(a: u64, b: u64, carry: u64) -> (u64, u64)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
lib/crypto/src/arithmetic/mod.rs|489 col 6| warning: casting u128
to u64
may truncate the value
--> lib/crypto/src/arithmetic/mod.rs:489:6
|
489 | (tmp as u64, carry)
| ^^^^^^^^^^
|
= help: if this is intentional allow the lint with #[allow(clippy::cast_possible_truncation)]
...
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation
help: ... or use try_from
and handle the error accordingly
|
489 | (u64::try_from(tmp), carry)
| ~~~~~~~~~~~~~~~~~~
lib/crypto/src/arithmetic/mod.rs|493 col 1| warning: you have declared #[inline(always)]
on adc_for_add_with_carry
. This is usually a bad idea
--> lib/crypto/src/arithmetic/mod.rs:493:1
|
493 | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
lib/crypto/src/arithmetic/mod.rs|498 col 45| warning: casts from bool
to u64
can be expressed infallibly using From
--> lib/crypto/src/arithmetic/mod.rs:498:45
|
498 | let (sum, carry2) = sum.overflowing_add(carry as u64);
| ^^^^^^^^^^^^
|
= help: an as
cast can become silently lossy if the types change in the future
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless
help: use u64::from
instead
|
498 | let (sum, carry2) = sum.overflowing_add(u64::from(carry));
| ~~~~~~~~~~~~~~~~
lib/crypto/src/arithmetic/mod.rs|505 col 1| warning: this function could have a #[must_use]
attribute
--> lib/crypto/src/arithmetic/mod.rs:505:1
|
505 | pub const fn sbb(a: u64, b: u64, borrow: u64) -> (u64, u64) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: #[must_use] pub const fn sbb(a: u64, b: u64, borrow: u64) -> (u64, u64)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
lib/crypto/src/arithmetic/mod.rs|508 col 6| warning: casting u128
to u64
may truncate the value
--> lib/crypto/src/arithmetic/mod.rs:508:6
|
508 | (tmp as u64, borrow)
| ^^^^^^^^^^
|
= help: if this is intentional allow the lint with #[allow(clippy::cast_possible_truncation)]
...
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation
help: ... or use try_from
and handle the error accordingly
|
508 | (u64::try_from(tmp), borrow)
| ~~~~~~~~~~~~~~~~~~
lib/crypto/src/arithmetic/mod.rs|512 col 1| warning: you have declared #[inline(always)]
on sbb_for_sub_with_borrow
. This is usually a bad idea
--> lib/crypto/src/arithmetic/mod.rs:512:1
|
512 | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
lib/crypto/src/arithmetic/mod.rs|517 col 46| warning: casts from bool
to u64
can be expressed infallibly using From
--> lib/crypto/src/arithmetic/mod.rs:517:46
|
517 | let (sub, borrow2) = sub.overflowing_sub(borrow as u64);
| ^^^^^^^^^^^^^
|
= help: an as
cast can become silently lossy if the types change in the future
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless
help: use u64::from
instead
|
517 | let (sub, borrow2) = sub.overflowing_sub(u64::from(borrow));
| ~~~~~~~~~~~~~~~~~
lib/crypto/src/arithmetic/mod.rs|667 col 9| warning: consider adding a ;
to the last statement for consistent formatting
--> lib/crypto/src/arithmetic/mod.rs:667:9
|
667 | (0..N).for_each(|i| self.limbs[i] ^= rhs.borrow().limbs[i])
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a ;
here: (0..N).for_each(|i| self.limbs[i] ^= rhs.borrow().limbs[i]);
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
= note: -W clippy::semicolon-if-nothing-returned
implied by -W clippy::pedantic
= help: to override -W clippy::pedantic
add #[allow(clippy::semicolon_if_nothing_returned)]
lib/crypto/src/arithmetic/mod.rs|682 col 9| warning: consider adding a ;
to the last statement for consistent formatting
--> lib/crypto/src/arithmetic/mod.rs:682:9
|
682 | (0..N).for_each(|i| self.limbs[i] &= rhs.borrow().limbs[i])
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a ;
here: (0..N).for_each(|i| self.limbs[i] &= rhs.borrow().limbs[i]);
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
lib/crypto/src/arithmetic/mod.rs|697 col 9| warning: consider adding a ;
to the last statement for consistent formatting
--> lib/crypto/src/arithmetic/mod.rs:697:9
|
697 | (0..N).for_each(|i| self.limbs[i] |= rhs.borrow().limbs[i])
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a ;
here: (0..N).for_each(|i| self.limbs[i] |= rhs.borrow().limbs[i]);
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
lib/crypto/src/arithmetic/mod.rs|718 col 19| warning: casting usize
to u32
may truncate the value on targets with 64-bit wide pointers
--> lib/crypto/src/arithmetic/mod.rs:718:19
|
718 | if rhs >= (64 * N) as u32 {
| ^^^^^^^^^^^^^^^
|
= help: if this is intentional allow the lint with #[allow(clippy::cast_possible_truncation)]
...
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation
help: ... or use try_from
and handle the error accordingly
|
718 | if rhs >= u32::try_from(64 * N) {
| ~~~~~~~~~~~~~~~~~~~~~
lib/crypto/src/arithmetic/mod.rs|766 col 19| warning: casting usize
to u32
may truncate the value on targets with 64-bit wide pointers
--> lib/crypto/src/arithmetic/mod.rs:766:19
|
766 | if rhs >= (64 * N) as u32 {
| ^^^^^^^^^^^^^^^
|
= help: if this is intentional allow the lint with #[allow(clippy::cast_possible_truncation)]
...
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation
help: ... or use try_from
and handle the error accordingly
|
766 | if rhs >= u32::try_from(64 * N) {
| ~~~~~~~~~~~~~~~~~~~~~
lib/crypto/src/arithmetic/mod.rs|951 col 23| warning: casting usize
to u32
may truncate the value on targets with 64-bit wide pointers
--> lib/crypto/src/arithmetic/mod.rs:951:23
|
951 | let mut ret = N as u32 * 64;
| ^^^^^^^^
|
= help: if this is intentional allow the lint with #[allow(clippy::cast_possible_truncation)]
...
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation
help: ... or use try_from
and handle the error accordingly
|
951 | let mut ret = u32::try_from(N) * 64;
| ~~~~~~~~~~~~~~~~
lib/crypto/src/arithmetic/mod.rs|1092 col 1| warning: you have declared #[inline(always)]
on ct_mul_wide
. This is usually a bad idea
--> lib/crypto/src/arithmetic/mod.rs:1092:1
|
1092 | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
lib/crypto/src/arithmetic/mod.rs|1093 col 1| warning: this function could have a #[must_use]
attribute
--> lib/crypto/src/arithmetic/mod.rs:1093:1
|
1093 | pub const fn ct_mul_wide(lhs: Limb, rhs: Limb) -> (Limb, Limb) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: #[must_use] pub const fn ct_mul_wide(lhs: Limb, rhs: Limb) -> (Limb, Limb)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
lib/crypto/src/arithmetic/mod.rs|1097 col 6| warning: casting u128
to u64
may truncate the value
--> lib/crypto/src/arithmetic/mod.rs:1097:6
|
1097 | (ret as Limb, (ret >> Limb::BITS) as Limb)
| ^^^^^^^^^^^
|
= help: if this is intentional allow the lint with #[allow(clippy::cast_possible_truncation)]
...
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation
help: ... or use try_from
and handle the error accordingly
|
1097 | (Limb::try_from(ret), (ret >> Limb::BITS) as Limb)
| ~~~~~~~~~~~~~~~~~~~
lib/crypto/src/arithmetic/mod.rs|1104 col 1| warning: you have declared #[inline(always)]
on ct_adc
. This is usually a bad idea
--> lib/crypto/src/arithmetic/mod.rs:1104:1
|
1104 | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
lib/crypto/src/arithmetic/mod.rs|1105 col 1| warning: this function could have a #[must_use]
attribute
--> lib/crypto/src/arithmetic/mod.rs:1105:1
|
1105 | pub const fn ct_adc(lhs: Limb, rhs: Limb, carry: Limb) -> (Limb, Limb) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: #[must_use] pub const fn ct_adc(lhs: Limb, rhs: Limb, carry: Limb) -> (Limb, Limb)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
lib/crypto/src/arithmetic/mod.rs|1113 col 6| warning: casting u128
to u64
may truncate the value
--> lib/crypto/src/arithmetic/mod.rs:1113:6
|
1113 | (ret as Limb, (ret >> Limb::BITS) as Limb)
| ^^^^^^^^^^^
|
= help: if this is intentional allow the lint with #[allow(clippy::cast_possible_truncation)]
...
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation
help: ... or use try_from
and handle the error accordingly
|
1113 | (Limb::try_from(ret), (ret >> Limb::BITS) as Limb)
| ~~~~~~~~~~~~~~~~~~~
lib/crypto/src/arithmetic/mod.rs|1116 col 1| warning: this function could have a #[must_use]
attribute
--> lib/crypto/src/arithmetic/mod.rs:1116:1
|
1116 | pub const fn ct_ge(a: &Uint, b: &Uint) -> bool {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: #[must_use] pub const fn ct_ge<const N: usize>(a: &Uint<N>, b: &Uint<N>) -> bool
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
lib/crypto/src/arithmetic/mod.rs|1128 col 1| warning: this function could have a #[must_use]
attribute
--> lib/crypto/src/arithmetic/mod.rs:1128:1
|
1128 | pub const fn ct_eq(a: &Uint, b: &Uint) -> bool {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: #[must_use] pub const fn ct_eq<const N: usize>(a: &Uint<N>, b: &Uint<N>) -> bool
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
lib/crypto/src/field/fp.rs|63 col 5| warning: you have declared #[inline(always)]
on add_assign
. This is usually a bad idea
--> lib/crypto/src/field/fp.rs:63:5
|
63 | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
lib/crypto/src/field/fp.rs|69 col 13| warning: consider adding a ;
to the last statement for consistent formatting
--> lib/crypto/src/field/fp.rs:69:13
|
69 | a.subtract_modulus()
| ^^^^^^^^^^^^^^^^^^^^ help: add a ;
here: a.subtract_modulus();
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
lib/crypto/src/field/fp.rs|71 col 13| warning: consider adding a ;
to the last statement for consistent formatting
--> lib/crypto/src/field/fp.rs:71:13
|
71 | a.subtract_modulus_with_carry(c)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a ;
here: a.subtract_modulus_with_carry(c);
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
lib/crypto/src/field/fp.rs|76 col 5| warning: you have declared #[inline(always)]
on sub_assign
. This is usually a bad idea
--> lib/crypto/src/field/fp.rs:76:5
|
76 | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
lib/crypto/src/field/fp.rs|86 col 5| warning: you have declared #[inline(always)]
on double_in_place
. This is usually a bad idea
--> lib/crypto/src/field/fp.rs:86:5
|
86 | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
lib/crypto/src/field/fp.rs|92 col 13| warning: consider adding a ;
to the last statement for consistent formatting
--> lib/crypto/src/field/fp.rs:92:13
|
92 | a.subtract_modulus()
| ^^^^^^^^^^^^^^^^^^^^ help: add a ;
here: a.subtract_modulus();
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
lib/crypto/src/field/fp.rs|94 col 13| warning: consider adding a ;
to the last statement for consistent formatting
--> lib/crypto/src/field/fp.rs:94:13
|
94 | a.subtract_modulus_with_carry(c)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a ;
here: a.subtract_modulus_with_carry(c);
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
lib/crypto/src/field/fp.rs|99 col 5| warning: you have declared #[inline(always)]
on neg_in_place
. This is usually a bad idea
--> lib/crypto/src/field/fp.rs:99:5
|
99 | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
lib/crypto/src/field/fp.rs|114 col 5| warning: you have declared #[inline(always)]
on mul_assign
. This is usually a bad idea
--> lib/crypto/src/field/fp.rs:114:5
|
114 | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
lib/crypto/src/field/fp.rs|129 col 5| warning: you have declared #[inline(always)]
on square_in_place
. This is usually a bad idea
--> lib/crypto/src/field/fp.rs:129:5
|
129 | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
lib/crypto/src/field/fp.rs|136 col 5| warning: you have declared #[inline(always)]
on inverse
. This is usually a bad idea
--> lib/crypto/src/field/fp.rs:136:5
|
136 | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
lib/crypto/src/field/fp.rs|218 col 5| warning: you have declared #[inline(always)]
on into_bigint
. This is usually a bad idea
--> lib/crypto/src/field/fp.rs:218:5
|
218 | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
lib/crypto/src/field/fp.rs|244 col 1| warning: this function could have a #[must_use]
attribute
--> lib/crypto/src/field/fp.rs:244:1
|
244 | pub const fn inv<T: FpParams, const N: usize>() -> u64 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: #[must_use] pub const fn inv<T: FpParams<N>, const N: usize>() -> u64
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
lib/crypto/src/field/fp.rs|265 col 1| warning: this function could have a #[must_use]
attribute
--> lib/crypto/src/field/fp.rs:265:1
|
265 | pub const fn modulus_has_spare_bit<T: FpParams, const N: usize>() -> bool {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: #[must_use] pub const fn modulus_has_spare_bit<T: FpParams<N>, const N: usize>() -> bool
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
lib/crypto/src/field/fp.rs|341 col 5| warning: you have declared #[inline(always)]
on new_unchecked
. This is usually a bad idea
--> lib/crypto/src/field/fp.rs:341:5
|
341 | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
lib/crypto/src/field/fp.rs|347 col 5| warning: you have declared #[inline(always)]
on is_geq_modulus
. This is usually a bad idea
--> lib/crypto/src/field/fp.rs:347:5
|
347 | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
lib/crypto/src/field/fp.rs|348 col 5| warning: this method could have a #[must_use]
attribute
--> lib/crypto/src/field/fp.rs:348:5
|
348 | pub fn is_geq_modulus(&self) -> bool {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: #[must_use] pub fn is_geq_modulus(&self) -> bool
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
lib/crypto/src/field/fp.rs|352 col 5| warning: you have declared #[inline(always)]
on subtract_modulus
. This is usually a bad idea
--> lib/crypto/src/field/fp.rs:352:5
|
352 | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
lib/crypto/src/field/fp.rs|383 col 5| warning: this method could have a #[must_use]
attribute
--> lib/crypto/src/field/fp.rs:383:5
|
383 | pub const fn new(element: Uint) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: #[must_use] pub const fn new(element: Uint<N>) -> Self
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
lib/crypto/src/field/fp.rs|409 col 5| warning: you have declared #[inline(always)]
on subtract_modulus_with_carry
. This is usually a bad idea
--> lib/crypto/src/field/fp.rs:409:5
|
409 | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
lib/crypto/src/field/fp.rs|416 col 5| warning: you have declared #[inline(always)]
on mul_without_cond_subtract
. This is usually a bad idea
--> lib/crypto/src/field/fp.rs:416:5
|
416 | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
lib/crypto/src/const_helpers.rs|108 col 9| warning: casting usize
to u32
may truncate the value on targets with 64-bit wide pointers
--> lib/crypto/src/const_helpers.rs:108:9
|
108 | (N * 64) as u32 + (64 - self.1.leading_zeros())
| ^^^^^^^^^^^^^^^
|
= help: if this is intentional allow the lint with #[allow(clippy::cast_possible_truncation)]
...
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation
help: ... or use try_from
and handle the error accordingly
|
108 | u32::try_from(N * 64) + (64 - self.1.leading_zeros())
| ~~~~~~~~~~~~~~~~~~~~~
lib/crypto/src/const_helpers.rs|129 col 9| warning: casting usize
to u32
may truncate the value on targets with 64-bit wide pointers
--> lib/crypto/src/const_helpers.rs:129:9
|
129 | ((2 * N) * 64) as u32 + (64 - self.2.leading_zeros())
| ^^^^^^^^^^^^^^^^^^^^^
|
= help: if this is intentional allow the lint with #[allow(clippy::cast_possible_truncation)]
...
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation
help: ... or use try_from
and handle the error accordingly
|
129 | u32::try_from((2 * N) * 64) + (64 - self.2.leading_zeros())
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/crypto/src/poseidon2/mod.rs|182 col 5| warning: you have declared #[inline(always)]
on matmul_external
. This is usually a bad idea
--> lib/crypto/src/poseidon2/mod.rs:182:5
|
182 | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
lib/crypto/src/poseidon2/mod.rs|225 col 5| warning: you have declared #[inline(always)]
on matmul_m4
. This is usually a bad idea
--> lib/crypto/src/poseidon2/mod.rs:225:5
|
225 | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
lib/crypto/src/poseidon2/mod.rs|262 col 5| warning: you have declared #[inline(always)]
on matmul_internal
. This is usually a bad idea
--> lib/crypto/src/poseidon2/mod.rs:262:5
|
262 | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
lib/crypto/src/arithmetic/mod.rs|23 col 1| warning: missing documentation for a type alias
--> lib/crypto/src/arithmetic/mod.rs:23:1
|
23 | pub type Limb = u64;
| ^^^^^^^^^^^^^
|
= note: requested on the command line with -W missing-docs
lib/crypto/src/arithmetic/mod.rs|24 col 1| warning: missing documentation for a type alias
--> lib/crypto/src/arithmetic/mod.rs:24:1
|
24 | pub type Limbs = [Limb; N];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/crypto/src/arithmetic/mod.rs|25 col 1| warning: missing documentation for a type alias
--> lib/crypto/src/arithmetic/mod.rs:25:1
|
25 | pub type WideLimb = u128;
| ^^^^^^^^^^^^^^^^^
lib/crypto/src/arithmetic/mod.rs|33 col 1| warning: missing documentation for a struct
--> lib/crypto/src/arithmetic/mod.rs:33:1
|
33 | pub struct Uint {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
... (Too many findings. Dropped some findings)
Filtered Findings (0)
Annotations
Check warning on line 323 in lib/crypto/src/arithmetic/mod.rs
github-actions / clippy
[clippy] lib/crypto/src/arithmetic/mod.rs#L323
warning: 5 bindings with single-character names in scope
--> lib/crypto/src/arithmetic/mod.rs:323:17
|
323 | let mut i = 0;
| ^
...
330 | let mut j = 0;
| ^
...
334 | let k = i + j;
| ^
...
337 | let (n, c) = ct_mac_with_carry(
| ^ ^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#many_single_char_names
= note: `-W clippy::many-single-char-names` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::many_single_char_names)]`
Raw output
lib/crypto/src/arithmetic/mod.rs:323:17:w:warning: 5 bindings with single-character names in scope
--> lib/crypto/src/arithmetic/mod.rs:323:17
|
323 | let mut i = 0;
| ^
...
330 | let mut j = 0;
| ^
...
334 | let k = i + j;
| ^
...
337 | let (n, c) = ct_mac_with_carry(
| ^ ^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#many_single_char_names
= note: `-W clippy::many-single-char-names` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::many_single_char_names)]`
__END__
Check warning on line 323 in lib/crypto/src/arithmetic/mod.rs
github-actions / clippy
[clippy] lib/crypto/src/arithmetic/mod.rs#L323
warning: 5 bindings with single-character names in scope
--> lib/crypto/src/arithmetic/mod.rs:323:17
|
323 | let mut i = 0;
| ^
...
330 | let mut j = 0;
| ^
...
334 | let k = i + j;
| ^
...
346 | let (n, c) = ct_mac_with_carry(
| ^ ^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#many_single_char_names
Raw output
lib/crypto/src/arithmetic/mod.rs:323:17:w:warning: 5 bindings with single-character names in scope
--> lib/crypto/src/arithmetic/mod.rs:323:17
|
323 | let mut i = 0;
| ^
...
330 | let mut j = 0;
| ^
...
334 | let k = i + j;
| ^
...
346 | let (n, c) = ct_mac_with_carry(
| ^ ^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#many_single_char_names
__END__
Check warning on line 22 in lib/crypto/src/field/fp.rs
github-actions / clippy
[clippy] lib/crypto/src/field/fp.rs#L22
warning: unused import: `ops::Mul`
--> lib/crypto/src/field/fp.rs:22:5
|
22 | ops::Mul,
| ^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
Raw output
lib/crypto/src/field/fp.rs:22:5:w:warning: unused import: `ops::Mul`
--> lib/crypto/src/field/fp.rs:22:5
|
22 | ops::Mul,
| ^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
__END__
Check warning on line 26 in lib/crypto/src/field/fp.rs
github-actions / clippy
[clippy] lib/crypto/src/field/fp.rs#L26
warning: unused import: `ConstZero`
--> lib/crypto/src/field/fp.rs:26:18
|
26 | use num_traits::{ConstZero, One, Zero};
| ^^^^^^^^^
Raw output
lib/crypto/src/field/fp.rs:26:18:w:warning: unused import: `ConstZero`
--> lib/crypto/src/field/fp.rs:26:18
|
26 | use num_traits::{ConstZero, One, Zero};
| ^^^^^^^^^
__END__
Check warning on line 68 in lib/crypto/src/arithmetic/mod.rs
github-actions / clippy
[clippy] lib/crypto/src/arithmetic/mod.rs#L68
warning: method `const_add_with_carry` is never used
--> lib/crypto/src/arithmetic/mod.rs:223:25
|
68 | impl<const N: usize> Uint<N> {
| ---------------------------- method in this implementation
...
223 | pub(crate) const fn const_add_with_carry(
| ^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
Raw output
lib/crypto/src/arithmetic/mod.rs:68:1:w:warning: method `const_add_with_carry` is never used
--> lib/crypto/src/arithmetic/mod.rs:223:25
|
68 | impl<const N: usize> Uint<N> {
| ---------------------------- method in this implementation
...
223 | pub(crate) const fn const_add_with_carry(
| ^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
__END__
Check warning on line 69 in lib/crypto/src/arithmetic/mod.rs
github-actions / clippy
[clippy] lib/crypto/src/arithmetic/mod.rs#L69
warning: casting `usize` to `u32` may truncate the value on targets with 64-bit wide pointers
--> lib/crypto/src/arithmetic/mod.rs:69:27
|
69 | pub const BITS: u32 = (N as u32) * Limb::BITS;
| ^^^^^^^^^^
|
= help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ...
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation
= note: `-W clippy::cast-possible-truncation` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::cast_possible_truncation)]`
help: ... or use `try_from` and handle the error accordingly
|
69 | pub const BITS: u32 = u32::try_from(N) * Limb::BITS;
| ~~~~~~~~~~~~~~~~
Raw output
lib/crypto/src/arithmetic/mod.rs:69:27:w:warning: casting `usize` to `u32` may truncate the value on targets with 64-bit wide pointers
--> lib/crypto/src/arithmetic/mod.rs:69:27
|
69 | pub const BITS: u32 = (N as u32) * Limb::BITS;
| ^^^^^^^^^^
|
= help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ...
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation
= note: `-W clippy::cast-possible-truncation` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::cast_possible_truncation)]`
help: ... or use `try_from` and handle the error accordingly
|
69 | pub const BITS: u32 = u32::try_from(N) * Limb::BITS;
| ~~~~~~~~~~~~~~~~
__END__
Check warning on line 73 in lib/crypto/src/arithmetic/mod.rs
github-actions / clippy
[clippy] lib/crypto/src/arithmetic/mod.rs#L73
warning: this method could have a `#[must_use]` attribute
--> lib/crypto/src/arithmetic/mod.rs:73:5
|
73 | pub const fn new(value: [u64; N]) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub const fn new(value: [u64; N]) -> Self`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
= note: `-W clippy::must-use-candidate` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::must_use_candidate)]`
Raw output
lib/crypto/src/arithmetic/mod.rs:73:5:w:warning: this method could have a `#[must_use]` attribute
--> lib/crypto/src/arithmetic/mod.rs:73:5
|
73 | pub const fn new(value: [u64; N]) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub const fn new(value: [u64; N]) -> Self`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
= note: `-W clippy::must-use-candidate` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::must_use_candidate)]`
__END__
Check warning on line 77 in lib/crypto/src/arithmetic/mod.rs
github-actions / clippy
[clippy] lib/crypto/src/arithmetic/mod.rs#L77
warning: this method could have a `#[must_use]` attribute
--> lib/crypto/src/arithmetic/mod.rs:77:5
|
77 | pub const fn as_limbs(&self) -> &[Limb; N] {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub const fn as_limbs(&self) -> &[Limb; N]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
Raw output
lib/crypto/src/arithmetic/mod.rs:77:5:w:warning: this method could have a `#[must_use]` attribute
--> lib/crypto/src/arithmetic/mod.rs:77:5
|
77 | pub const fn as_limbs(&self) -> &[Limb; N] {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub const fn as_limbs(&self) -> &[Limb; N]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
__END__
Check warning on line 83 in lib/crypto/src/arithmetic/mod.rs
github-actions / clippy
[clippy] lib/crypto/src/arithmetic/mod.rs#L83
warning: this method could have a `#[must_use]` attribute
--> lib/crypto/src/arithmetic/mod.rs:83:5
|
83 | pub const fn zero() -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub const fn zero() -> Self`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
Raw output
lib/crypto/src/arithmetic/mod.rs:83:5:w:warning: this method could have a `#[must_use]` attribute
--> lib/crypto/src/arithmetic/mod.rs:83:5
|
83 | pub const fn zero() -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub const fn zero() -> Self`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
__END__
Check warning on line 87 in lib/crypto/src/arithmetic/mod.rs
github-actions / clippy
[clippy] lib/crypto/src/arithmetic/mod.rs#L87
warning: this method could have a `#[must_use]` attribute
--> lib/crypto/src/arithmetic/mod.rs:87:5
|
87 | pub const fn one() -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub const fn one() -> Self`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
Raw output
lib/crypto/src/arithmetic/mod.rs:87:5:w:warning: this method could have a `#[must_use]` attribute
--> lib/crypto/src/arithmetic/mod.rs:87:5
|
87 | pub const fn one() -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub const fn one() -> Self`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
__END__
Check warning on line 94 in lib/crypto/src/arithmetic/mod.rs
github-actions / clippy
[clippy] lib/crypto/src/arithmetic/mod.rs#L94
warning: this method could have a `#[must_use]` attribute
--> lib/crypto/src/arithmetic/mod.rs:94:5
|
94 | pub const fn from_u32(val: u32) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub const fn from_u32(val: u32) -> Self`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
Raw output
lib/crypto/src/arithmetic/mod.rs:94:5:w:warning: this method could have a `#[must_use]` attribute
--> lib/crypto/src/arithmetic/mod.rs:94:5
|
94 | pub const fn from_u32(val: u32) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub const fn from_u32(val: u32) -> Self`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
__END__
Check warning on line 101 in lib/crypto/src/arithmetic/mod.rs
github-actions / clippy
[clippy] lib/crypto/src/arithmetic/mod.rs#L101
warning: this method could have a `#[must_use]` attribute
--> lib/crypto/src/arithmetic/mod.rs:101:5
|
101 | pub const fn const_is_even(&self) -> bool {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub const fn const_is_even(&self) -> bool`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
Raw output
lib/crypto/src/arithmetic/mod.rs:101:5:w:warning: this method could have a `#[must_use]` attribute
--> lib/crypto/src/arithmetic/mod.rs:101:5
|
101 | pub const fn const_is_even(&self) -> bool {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub const fn const_is_even(&self) -> bool`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
__END__
Check warning on line 106 in lib/crypto/src/arithmetic/mod.rs
github-actions / clippy
[clippy] lib/crypto/src/arithmetic/mod.rs#L106
warning: this method could have a `#[must_use]` attribute
--> lib/crypto/src/arithmetic/mod.rs:106:5
|
106 | pub const fn const_is_odd(&self) -> bool {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub const fn const_is_odd(&self) -> bool`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
Raw output
lib/crypto/src/arithmetic/mod.rs:106:5:w:warning: this method could have a `#[must_use]` attribute
--> lib/crypto/src/arithmetic/mod.rs:106:5
|
106 | pub const fn const_is_odd(&self) -> bool {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub const fn const_is_odd(&self) -> bool`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
__END__
Check warning on line 111 in lib/crypto/src/arithmetic/mod.rs
github-actions / clippy
[clippy] lib/crypto/src/arithmetic/mod.rs#L111
warning: this method could have a `#[must_use]` attribute
--> lib/crypto/src/arithmetic/mod.rs:111:5
|
111 | pub const fn mod_4(&self) -> u8 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub const fn mod_4(&self) -> u8`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
Raw output
lib/crypto/src/arithmetic/mod.rs:111:5:w:warning: this method could have a `#[must_use]` attribute
--> lib/crypto/src/arithmetic/mod.rs:111:5
|
111 | pub const fn mod_4(&self) -> u8 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub const fn mod_4(&self) -> u8`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
__END__
Check warning on line 120 in lib/crypto/src/arithmetic/mod.rs
github-actions / clippy
[clippy] lib/crypto/src/arithmetic/mod.rs#L120
warning: this method could have a `#[must_use]` attribute
--> lib/crypto/src/arithmetic/mod.rs:120:5
|
120 | pub const fn const_shr(&self) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub const fn const_shr(&self) -> Self`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
Raw output
lib/crypto/src/arithmetic/mod.rs:120:5:w:warning: this method could have a `#[must_use]` attribute
--> lib/crypto/src/arithmetic/mod.rs:120:5
|
120 | pub const fn const_shr(&self) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub const fn const_shr(&self) -> Self`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
__END__
Check warning on line 120 in lib/crypto/src/arithmetic/mod.rs
github-actions / clippy
[clippy] lib/crypto/src/arithmetic/mod.rs#L120
warning: missing `#[must_use]` attribute on a method returning `Self`
--> lib/crypto/src/arithmetic/mod.rs:120:5
|
120 | / pub const fn const_shr(&self) -> Self {
121 | | let mut result = *self;
122 | | let mut t = 0;
123 | | crate::const_for!((i in 0..N) {
... |
130 | | result
131 | | }
| |_____^
|
= help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
= note: `-W clippy::return-self-not-must-use` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::return_self_not_must_use)]`
Raw output
lib/crypto/src/arithmetic/mod.rs:120:5:w:warning: missing `#[must_use]` attribute on a method returning `Self`
--> lib/crypto/src/arithmetic/mod.rs:120:5
|
120 | / pub const fn const_shr(&self) -> Self {
121 | | let mut result = *self;
122 | | let mut t = 0;
123 | | crate::const_for!((i in 0..N) {
... |
130 | | result
131 | | }
| |_____^
|
= help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
= note: `-W clippy::return-self-not-must-use` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::return_self_not_must_use)]`
__END__
Check warning on line 149 in lib/crypto/src/arithmetic/mod.rs
github-actions / clippy
[clippy] lib/crypto/src/arithmetic/mod.rs#L149
warning: this method could have a `#[must_use]` attribute
--> lib/crypto/src/arithmetic/mod.rs:149:5
|
149 | pub const fn two_adic_valuation(mut self) -> u32 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub const fn two_adic_valuation(mut self) -> u32`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
Raw output
lib/crypto/src/arithmetic/mod.rs:149:5:w:warning: this method could have a `#[must_use]` attribute
--> lib/crypto/src/arithmetic/mod.rs:149:5
|
149 | pub const fn two_adic_valuation(mut self) -> u32 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub const fn two_adic_valuation(mut self) -> u32`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
__END__
Check warning on line 165 in lib/crypto/src/arithmetic/mod.rs
github-actions / clippy
[clippy] lib/crypto/src/arithmetic/mod.rs#L165
warning: this method could have a `#[must_use]` attribute
--> lib/crypto/src/arithmetic/mod.rs:165:5
|
165 | pub const fn two_adic_coefficient(mut self) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub const fn two_adic_coefficient(mut self) -> Self`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
Raw output
lib/crypto/src/arithmetic/mod.rs:165:5:w:warning: this method could have a `#[must_use]` attribute
--> lib/crypto/src/arithmetic/mod.rs:165:5
|
165 | pub const fn two_adic_coefficient(mut self) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub const fn two_adic_coefficient(mut self) -> Self`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
__END__
Check warning on line 165 in lib/crypto/src/arithmetic/mod.rs
github-actions / clippy
[clippy] lib/crypto/src/arithmetic/mod.rs#L165
warning: missing `#[must_use]` attribute on a method returning `Self`
--> lib/crypto/src/arithmetic/mod.rs:165:5
|
165 | / pub const fn two_adic_coefficient(mut self) -> Self {
166 | | assert!(self.const_is_odd());
167 | | // Since `self` is odd, we can always subtract one
168 | | // without a borrow
... |
174 | | self
175 | | }
| |_____^
|
= help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
Raw output
lib/crypto/src/arithmetic/mod.rs:165:5:w:warning: missing `#[must_use]` attribute on a method returning `Self`
--> lib/crypto/src/arithmetic/mod.rs:165:5
|
165 | / pub const fn two_adic_coefficient(mut self) -> Self {
166 | | assert!(self.const_is_odd());
167 | | // Since `self` is odd, we can always subtract one
168 | | // without a borrow
... |
174 | | self
175 | | }
| |_____^
|
= help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
__END__
Check warning on line 181 in lib/crypto/src/arithmetic/mod.rs
github-actions / clippy
[clippy] lib/crypto/src/arithmetic/mod.rs#L181
warning: this method could have a `#[must_use]` attribute
--> lib/crypto/src/arithmetic/mod.rs:181:5
|
181 | pub const fn divide_by_2_round_down(mut self) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub const fn divide_by_2_round_down(mut self) -> Self`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
Raw output
lib/crypto/src/arithmetic/mod.rs:181:5:w:warning: this method could have a `#[must_use]` attribute
--> lib/crypto/src/arithmetic/mod.rs:181:5
|
181 | pub const fn divide_by_2_round_down(mut self) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub const fn divide_by_2_round_down(mut self) -> Self`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
__END__
Check warning on line 181 in lib/crypto/src/arithmetic/mod.rs
github-actions / clippy
[clippy] lib/crypto/src/arithmetic/mod.rs#L181
warning: missing `#[must_use]` attribute on a method returning `Self`
--> lib/crypto/src/arithmetic/mod.rs:181:5
|
181 | / pub const fn divide_by_2_round_down(mut self) -> Self {
182 | | if self.const_is_odd() {
183 | | self.limbs[0] -= 1;
184 | | }
185 | | self.const_shr()
186 | | }
| |_____^
|
= help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
Raw output
lib/crypto/src/arithmetic/mod.rs:181:5:w:warning: missing `#[must_use]` attribute on a method returning `Self`
--> lib/crypto/src/arithmetic/mod.rs:181:5
|
181 | / pub const fn divide_by_2_round_down(mut self) -> Self {
182 | | if self.const_is_odd() {
183 | | self.limbs[0] -= 1;
184 | | }
185 | | self.const_shr()
186 | | }
| |_____^
|
= help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
__END__
Check warning on line 190 in lib/crypto/src/arithmetic/mod.rs
github-actions / clippy
[clippy] lib/crypto/src/arithmetic/mod.rs#L190
warning: this method could have a `#[must_use]` attribute
--> lib/crypto/src/arithmetic/mod.rs:190:5
|
190 | pub const fn const_num_bits(self) -> u32 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub const fn const_num_bits(self) -> u32`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
Raw output
lib/crypto/src/arithmetic/mod.rs:190:5:w:warning: this method could have a `#[must_use]` attribute
--> lib/crypto/src/arithmetic/mod.rs:190:5
|
190 | pub const fn const_num_bits(self) -> u32 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub const fn const_num_bits(self) -> u32`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
__END__
Check warning on line 191 in lib/crypto/src/arithmetic/mod.rs
github-actions / clippy
[clippy] lib/crypto/src/arithmetic/mod.rs#L191
warning: casting `usize` to `u32` may truncate the value on targets with 64-bit wide pointers
--> lib/crypto/src/arithmetic/mod.rs:191:9
|
191 | ((N - 1) * 64) as u32 + (64 - self.limbs[N - 1].leading_zeros())
| ^^^^^^^^^^^^^^^^^^^^^
|
= help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ...
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation
help: ... or use `try_from` and handle the error accordingly
|
191 | u32::try_from((N - 1) * 64) + (64 - self.limbs[N - 1].leading_zeros())
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~
Raw output
lib/crypto/src/arithmetic/mod.rs:191:9:w:warning: casting `usize` to `u32` may truncate the value on targets with 64-bit wide pointers
--> lib/crypto/src/arithmetic/mod.rs:191:9
|
191 | ((N - 1) * 64) as u32 + (64 - self.limbs[N - 1].leading_zeros())
| ^^^^^^^^^^^^^^^^^^^^^
|
= help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ...
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation
help: ... or use `try_from` and handle the error accordingly
|
191 | u32::try_from((N - 1) * 64) + (64 - self.limbs[N - 1].leading_zeros())
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~
__END__
Check warning on line 259 in lib/crypto/src/arithmetic/mod.rs
github-actions / clippy
[clippy] lib/crypto/src/arithmetic/mod.rs#L259
warning: this method could have a `#[must_use]` attribute
--> lib/crypto/src/arithmetic/mod.rs:259:5
|
259 | pub const fn montgomery_r(&self) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub const fn montgomery_r(&self) -> Self`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
Raw output
lib/crypto/src/arithmetic/mod.rs:259:5:w:warning: this method could have a `#[must_use]` attribute
--> lib/crypto/src/arithmetic/mod.rs:259:5
|
259 | pub const fn montgomery_r(&self) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub const fn montgomery_r(&self) -> Self`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
__END__
Check warning on line 259 in lib/crypto/src/arithmetic/mod.rs
github-actions / clippy
[clippy] lib/crypto/src/arithmetic/mod.rs#L259
warning: missing `#[must_use]` attribute on a method returning `Self`
--> lib/crypto/src/arithmetic/mod.rs:259:5
|
259 | / pub const fn montgomery_r(&self) -> Self {
260 | | let two_pow_n_times_64 = crate::const_helpers::RBuffer([0u64; N], 1);
261 | | const_modulo!(two_pow_n_times_64, self)
262 | | }
| |_____^
|
= help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
Raw output
lib/crypto/src/arithmetic/mod.rs:259:5:w:warning: missing `#[must_use]` attribute on a method returning `Self`
--> lib/crypto/src/arithmetic/mod.rs:259:5
|
259 | / pub const fn montgomery_r(&self) -> Self {
260 | | let two_pow_n_times_64 = crate::const_helpers::RBuffer([0u64; N], 1);
261 | | const_modulo!(two_pow_n_times_64, self)
262 | | }
| |_____^
|
= help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
__END__