-
Notifications
You must be signed in to change notification settings - Fork 247
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
sha3 v0.10 - chain_update(): unsatisfied trait bounds #335
Comments
|
Unfortunately, I can't because of the different padding, which would result to different digests. (Shake256 is expected by the standard). With sha3 v0.9 I used the chain() method, which works with the code above. I fail to see which other mid-level traits need to be used with the new version v0.10 to use the chain_update() method. Could you maybe provide me a link to the docs or similar? Or is it no longer possible to use the chain method together with Shake256? |
@newpavlov it seems like chained input should still work for XOFs? I would expect them to only differ from other hash functions in terms of finalization (with a XOF returning a stateful reader object in that case) |
Ah, yes. I forgot that in trait Update {
fn update(&mut self, data: &[u8]);
fn new_with_prefix(data: impl AsRef<[u8]>) -> Self
where Self: Sized + Default
{ let mut h = Self::default(); h.update(data.as_ref()); h }
} |
Thanks, that would be nice. :)
For me it would probably simplify some internals, but I am not sure if it is helpful in general. |
Thanks, just tested it with Shake256 :) BTW was the renaming of RustCrypto/traits@5acb9f7#diff-2d770173354c22c7a64855fd000b85e4fd0db68e370a0d571b11df3295578aceL72 I ask, because this will probably break code at other places, at least in the READMEs it requires some updates, but at a first glance it seems to effect other RustCrypto traits as well, for example: |
The issue with having both Ideally |
Yep, having both in scope won't work. But from my perspective, I understood the (There are more methods that are overlapping, for instance IMO using the same names for the method in the high-level trait and in the mid-level trait would make it easier to understand and use. |
Yeah, in |
I just updated sha3 v0.9 to v0.10, but struggle to use the chain_update method:
I skimmed through the Changelog and the docs, but failed to see a hint or note to fix the issue. Do you have any suggestions to get this working? :)
I added a minimal "working" example below:
Example
Cargo.toml
main.rs
The text was updated successfully, but these errors were encountered: