MCPcopy Create free account
hub / github.com/BitVM/BitVM / digit_signature

Function digit_signature

bitvm/src/signatures/winternitz.rs:79–85  ·  view source on GitHub ↗

Returns the signature of a given digit, requires the digit index to modify the secret key for each digit

(secret_key: &SecretKey, digit_index: u32, message_digit: u32)

Source from the content-addressed store, hash-verified

77
78/// Returns the signature of a given digit, requires the digit index to modify the secret key for each digit
79pub fn digit_signature(secret_key: &SecretKey, digit_index: u32, message_digit: u32) -> HashOut {
80 let mut hash = secret_key_for_digit(secret_key, digit_index);
81 for _ in 0..message_digit {
82 hash = hash160::Hash::hash(&hash[..]);
83 }
84 *hash.as_byte_array()
85}
86
87/// Returns the public key of a given digit, requires the digit index to modify the secret key for each digit
88fn public_key_for_digit(ps: &Parameters, secret_key: &SecretKey, digit_index: u32) -> HashOut {

Callers 3

sign_digitsMethod · 0.85
sign_digitsMethod · 0.85
sign_signed_digitsFunction · 0.85

Calls 1

secret_key_for_digitFunction · 0.85

Tested by

no test coverage detected