Returns the secret key for given digit, appending the representation of it in bigger endian bytes to the message secret key
(secret_key: &SecretKey, mut digit_index: u32)
| 67 | |
| 68 | /// Returns the secret key for given digit, appending the representation of it in bigger endian bytes to the message secret key |
| 69 | pub fn secret_key_for_digit(secret_key: &SecretKey, mut digit_index: u32) -> hash160::Hash { |
| 70 | let mut secret_i = secret_key.clone(); |
| 71 | while digit_index > 0 { |
| 72 | secret_i.push((digit_index & 255) as u8); |
| 73 | digit_index >>= 8; |
| 74 | } |
| 75 | hash160::Hash::hash(&secret_i) |
| 76 | } |
| 77 | |
| 78 | /// Returns the signature of a given digit, requires the digit index to modify the secret key for each digit |
| 79 | pub fn digit_signature(secret_key: &SecretKey, digit_index: u32, message_digit: u32) -> HashOut { |
no test coverage detected