Thanks to visit codestin.com
Credit goes to github.com

Skip to content

uhashlib not compatible with micropython-hmac #4500

Closed
@Jongy

Description

@Jongy

micropython-hmac uses micropython-hashlib, which attempts to import various hash classes (sha1, sha256 etc) from uhashlib if they exist. For any missing class, it imports a pure Python implementation.

Now, the pure Python differ a bit in the API they expose, comparing to the implementations in uhashlib itself. That wouldn't be of a problem, but the hmac module later uses some of these APIs... So if your uhashlib has e.g sha1 then you can't use hmac(digestmod=sha1).

Specifically, digest_size, block_size and copy are missing (at least from what I've seen, possibly more missing attributes exist)

Metadata

Metadata

Assignees

No one assigned

    Labels

    extmodRelates to extmod/ directory in sourceproposed-closeSuggest this issue should be closed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions