generated from amazon-archives/__template_Custom
-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
Description of feature:
We would like to use the SignWithLabel
and VerifyWithLabel
functionality from Section 5.1.2 with our data.
Implementation discussion (Optional)
I did this internally with this simple code:
#[derive(Clone, MlsSize, MlsEncode)]
struct SignContent<'a> {
#[mls_codec(with = "mls_rs_codec::byte_vec")]
label: Vec<u8>,
#[mls_codec(with = "mls_rs_codec::byte_vec")]
content: &'a [u8],
}
impl fmt::Debug for SignContent<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("SignContent")
.field("label", &mls_rs_core::debug::pretty_bytes(&self.label))
.field("content", &mls_rs_core::debug::pretty_bytes(self.content))
.finish()
}
}
impl SignContent<'_> {
pub fn new<'a>(label: &'a str, content: &'a [u8]) -> SignContent<'a> {
SignContent { label: [b"MLS 1.0 ", label.as_bytes()].concat(), content }
}
}
This is a trimmed down version of the functionality used by the Signable
trait.
Do you think we could make either the full trait public, or make a SignContent
struct available?
Thanks for considering!
Metadata
Metadata
Assignees
Labels
No labels