-
Notifications
You must be signed in to change notification settings - Fork 106
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
chore: remove derived Debug
and Serialize
from private key types
#696
Conversation
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.
left comment on one file, but applicable to other similar places.
pub fn to_tagged_base64(&self) -> Result<TaggedBase64, Tb64Error> { | ||
TaggedBase64::new(tag::BLS_SIGNING_KEY, &self.to_bytes()) | ||
} |
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.
- should we explicit about
tag::BLS_OVER_BN254_SIGN_KEY
? - add code doc on
SignKey
that if one wants to implement serde on outer struct that contains this key (which should be rare), need to exercise self-caution about the implication of that, (since we removed it), and manually implement them by calling one ofto_bytes
orto_tagged_base64()
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.
I'm slightly hesitant on the first one. It's making a long tag.
Doc add in 5f85f10
signature/src/bls_over_bls12381.rs
Outdated
fn serialized_size(&self, _compress: Compress) -> usize { | ||
BLS_SIG_SK_SIZE | ||
/// Deserialize `SignKey` from bytes. | ||
pub fn from_bytes(bytes: &[u8]) -> Result<BLSSignKey, BLST_ERROR> { |
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 possible for these to have explicit lengths? e.g. can from_bytes
take a &[u8; 32]
here (since to_bytes()
returns one)?
similar comment for the other to_bytes
/from_bytes
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.
Tried this: 8d25a8b
see if you like it or not
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.
only left a nit comment on phrasing. otherwise LGTM.
closes: #694
This PR:
In
jf-signature
crateDebug
for private signing keys to not print the actual value.to/from_bytes()
and the conversions to/fromTaggedBase64
.This PR does not:
Private key type in
elgamal
crate still has derivations. Because of this ephemeral key in the ciphertext:jellyfish/elgamal/src/lib.rs
Line 147 in 5f06aa1
Private key type in
aead
crate still has derivations. Because of this ephemeral key in the ciphertext:jellyfish/aead/src/lib.rs
Line 279 in 5f06aa1
jf-vrf
crate should be updated after to adopt these changes injf-signature
.Key places to review:
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
CHANGELOG.md
of touched crates.Files changed
in the GitHub PR explorer