Skip to content

extmod/moduhashlib.c: Add block_size/digest_size. #9030

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

Closed
wants to merge 1 commit into from

Conversation

jimmo
Copy link
Member

@jimmo jimmo commented Aug 8, 2022

These are used by the hmac library in micropython-lib, and are necessary for correct calculation/padding of the key.

Technically this PR isn't strictly necessary because the hmac library only needs block_size, and furthermore because they're 64 for all the supported built-in hash functions it can make a sensible default. If we ever added a sha512 to hashlib then we would need this.

These are used by the hmac library in micropython-lib.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
@jimmo
Copy link
Member Author

jimmo commented Aug 8, 2022

See micropython/micropython-lib#515 which updates micropython-lib's hmac to use a sensible default.

@dpgeorge dpgeorge added the extmod Relates to extmod/ directory in source label Aug 8, 2022
@dpgeorge
Copy link
Member

dpgeorge commented Aug 8, 2022

Since this isn't strictly needed, let's hold out on it for now. If/when we have hashing algos that have a block size different to 64 then we can add the block_size attribute.

@dpgeorge dpgeorge closed this Aug 8, 2022
RetiredWizard pushed a commit to RetiredWizard/micropython that referenced this pull request Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extmod Relates to extmod/ directory in source
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants