Skip to content

Initial Code! #1

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

Merged
merged 16 commits into from
Aug 19, 2019
Merged

Initial Code! #1

merged 16 commits into from
Aug 19, 2019

Conversation

brentru
Copy link
Member

@brentru brentru commented Aug 19, 2019

This module implements a common interface to many different secure hash and message digest algorithms. Included are the FIPS secure hash algorithms SHA1, SHA224, SHA256, SHA384, and SHA512 (defined in FIPS 180-2) as well as RSA’s MD5 algorithm (defined in Internet RFC 1321).

SHA1 and MD5 algorithms are not currently supported by the CircuitPython module, but constructors/sub-modules are included in the library to retain backwards-compatibility with the CPython3 hashlib module's available algorithms.

This library is based on the work performed in the micropython-lib hashlib module by Paul Sokolovsky. I refactored __init__.py to expose the available algorithms (accessible by calling the algorithms_available constructor, mimicking CPython), added classes for SHA1/MD5, comments and linting performed in all the algorithm sub-modules, exposed submodule class name ("suitable as a parameter to new() to create another hash of this type", same as CPython). The unittest-like tests within _sha256.py and _sha512.py have been removed to save space.

ReadTheDocs for this module has been created (https://circuitpython.readthedocs.io/projects/hashlib/en/latest) and will be online post-merge.

@brentru brentru requested a review from a team August 19, 2019 20:17
@ladyada ladyada merged commit 5b0d124 into adafruit:master Aug 19, 2019
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.

2 participants