Skip to content
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

feat: add blake3 160, 192 & 256 bits #18

Merged
merged 1 commit into from
Nov 30, 2022
Merged

feat: add blake3 160, 192 & 256 bits #18

merged 1 commit into from
Nov 30, 2022

Conversation

vlopes11
Copy link
Contributor

closes #6

Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Looks good! I left a few comments inline.

@grjte grjte requested review from bobbinth and 0xkanekiken and removed request for grjte November 29, 2022 09:47
Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just one minor nit inline.

Copy link
Contributor

@0xkanekiken 0xkanekiken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks! I left a few very minor comments inline related to docs/comments.

@vlopes11
Copy link
Contributor Author

@bobbinth I started a PR in winterfell fixing that. Unfortunately, it will not be an isolated change since it will impact also Hasher and ElementHasher (that will have to define their outputs).

Alternatively, we can wait for generic const expressions, so we don't leak the output requirement from the digest (hence, it can be defined during the trait implementation). Could be something like this in the end:

#![feature(generic_const_exprs)]

pub trait Digest {
    const OUTPUT: usize;

    fn as_bytes(&self) -> &[u8; Self::OUTPUT];
}

wdyt? If we go for the latter, then its an isolated change. The former, however, will require that all hasher defines their target output size (which kinda makes sense IMO, but it will change 3 traits instead of one)

Copy link
Contributor

@0xkanekiken 0xkanekiken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Looks good to me.

Copy link
Collaborator

@Al-Kindi-0 Al-Kindi-0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, and I am in favor of the generic const solution.

Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks good! Thank you!

Regarding Digest updates - I'd also prefer the const generic solution. So, let's wait for that.

@bobbinth bobbinth merged commit 0257538 into next Nov 30, 2022
@bobbinth bobbinth deleted the add-blake3 branch November 30, 2022 21:51
@bobbinth bobbinth mentioned this pull request Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants