curve: Mark scalar::clamp_integer as must_use (#558)

This commit is contained in:
moiseev-signal 2023-08-11 22:44:09 -07:00 committed by GitHub
parent 6dd17b2836
commit bf2c4eea23
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1240,6 +1240,7 @@ fn read_le_u64_into(src: &[u8], dst: &mut [u64]) {
///
/// See [here](https://neilmadden.blog/2020/05/28/whats-the-curve25519-clamping-all-about/) for
/// more details.
#[must_use]
pub const fn clamp_integer(mut bytes: [u8; 32]) -> [u8; 32] {
bytes[0] &= 0b1111_1000;
bytes[31] &= 0b0111_1111;