Returns the public key for the given secret key and the parameters
(ps: &Parameters, secret_key: &SecretKey)
| 103 | |
| 104 | /// Returns the public key for the given secret key and the parameters |
| 105 | pub fn generate_public_key(ps: &Parameters, secret_key: &SecretKey) -> PublicKey { |
| 106 | let mut public_key = PublicKey::with_capacity(ps.total_digit_len() as usize); |
| 107 | for i in 0..ps.total_digit_len() { |
| 108 | public_key.push(public_key_for_digit(ps, secret_key, i)); |
| 109 | } |
| 110 | public_key |
| 111 | } |
| 112 | |
| 113 | /// Computes the checksum for the given message. |
| 114 | fn checksum(ps: &Parameters, message_digits: &[u32]) -> u32 { |