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
Update kes #674
Update kes #674
Conversation
Test Results 3 files ±0 28 suites ±0 5m 18s ⏱️ + 2m 44s Results for commit b592b22. ± Comparison against base commit a43b1b8. This pull request removes 1 and adds 4 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
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.
LGTM 👍
if kes_sk_period <= provided_period { | ||
// We need to perform the evolutions | ||
for period in kes_sk_period..provided_period { | ||
kes_sk | ||
.update() | ||
.map_err(|_| ProtocolInitializerErrorWrapper::KesUpdate(period))?; | ||
} | ||
|
||
Some(kes_sk.sign(&stm_initializer.verification_key().to_bytes())) | ||
Some(kes_sk.sign(&stm_initializer.verification_key().to_bytes())) | ||
} else { | ||
return Err(ProtocolInitializerErrorWrapper::KesMismatch( | ||
kes_sk_period, | ||
provided_period, | ||
)); | ||
} |
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.
Maybe you could first check that the periods don't mismatch for readability:
if kes_sk_period > provided_period {
return Err(ProtocolInitializerErrorWrapper::KesMismatch(
kes_sk_period,
provided_period,
));
}
// We need to perform the evolutions
for period in kes_sk_period..provided_period {
kes_sk
.update()
.map_err(|_| ProtocolInitializerErrorWrapper::KesUpdate(period))?;
}
Some(kes_sk.sign(&stm_initializer.verification_key().to_bytes()))
Content
This PR adapts the code to the new version of the KES library. Signatures and Public keys are compatible with older versions. However, secret keys are not. This should not be a backwards compatibility problem, as new nodes will still be compatible with older versions of the protocol and viceversa. However, secret keys serialised with the current library cannot be deserialised with an old version (or by the haskell node). The opposite, however, does work. New nodes will be able to deserialise previous file formats (or ones generated by the haskell node).
Pre-submit checklist