-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support tagged ZIP 32 child derivation #7
Conversation
0f687c5
to
ae219c7
Compare
(for tagged ZIP 32 child derivation). Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
ae219c7
to
0d3f591
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK b9c2120
src/prf_expand.rs
Outdated
match lead { | ||
None => self.apply(c_par, &[sk_par, i, tag]), | ||
Some(b) => self.apply(c_par, &[sk_par, i, &[b], tag]), | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zcash/zips#978 says that the input to PRF^Expand is sk_par || i
if lead == 0 && tag.is_empty()
. Here if lead = None
then the tag still gets appended. We should instead do something like lead.unwrap_or(0)
and then the full check.
Co-authored-by: Jack Grigg <jack@electriccoin.co> Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
a07c889
to
a0d5af6
Compare
of `PrfExpand` (e.g. the `zip32` crate). Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
5987f26
to
295ed47
Compare
src/prf_expand.rs
Outdated
pub const REGISTERED_ZIP32_CHILD: Self = Self::new(0xAC); | ||
|
||
/// Expands the given secret key in this domain. | ||
pub fn with(self, sk: &[u8], a: &[u8; 32], b: &[u8; 4], c: Option<(u8, &[u8])>) -> [u8; 64] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it intended that Some((0, &[]))
be a valid input to this function?
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
201d5e6
to
997bf72
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK 997bf72
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK 997bf72
No description provided.