micropython-lib/hmac
Christopher Cooper 96c981b1ee hmac: Calculate correct digest when non-trivial key is used.
This incorrect behavior was a result of the function that performs
table-driven byte translation. The function first used the chr(...)
function to convert each resulting byte, represented as an integer,
to a string of length one. Then, the <str>.encode(...) function was
used to convert the string to a byte string with an intended length
of one. That didn't work well for bytes with high bit set, as they
were trated as UTF-8 chars. Instead, perform operations directly on
bytes.

This was an artifact of porting this to MicroPython, as the original
CPython module uses bytes.translate(...) method (not available in
uPy).
2017-08-13 14:52:52 +03:00
..
hmac.py hmac: Calculate correct digest when non-trivial key is used. 2017-08-13 14:52:52 +03:00
metadata.txt hmac: Calculate correct digest when non-trivial key is used. 2017-08-13 14:52:52 +03:00
setup.py hmac: Calculate correct digest when non-trivial key is used. 2017-08-13 14:52:52 +03:00
test_hmac.py hmac: Calculate correct digest when non-trivial key is used. 2017-08-13 14:52:52 +03:00