Skip to content

Commit

Permalink
Adding comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rodoufu authored Dec 13, 2023
1 parent 4a89edc commit a82c618
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions starknet-core/src/crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@ pub fn ecdsa_verify(
}
}

/// MaskBits masks the specified (excess) bits in a byte slice.
///
/// Parameters:
/// - mask: is an integer representing the number of bits to mask
/// - word_size: is an integer representing the number of bits in each element of the slice
/// - slice: is a byte slice on which the masking operation is performed
/// Makes the operation in place on slice, gets a new byte slice that contains the masked bits
/// Porting the MaskBits from https://github.com/NethermindEth/starknet.go/blob/main/curve/utils.go#L128-L143
pub fn mask_bits(mask: usize, word_size: usize, slice: &mut [u8]) {
let mut excess = slice.len() * word_size - mask;

Expand Down

0 comments on commit a82c618

Please sign in to comment.