Skip to content

SHA_test_sign_verify fix #14

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 1 commit into from
Aug 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions adafruit_rsa/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def int2bytes(number, fill_size=None, chunk_size=None, overflow=False):
raise ValueError("You can either fill or pad chunks, but not both")

# Ensure these are integers.
assert number & 1 == 0, "Number must be an unsigned integer, not a float."
assert isinstance(number, int), "Number must be an unsigned integer, not a float."

raw_bytes = b""

Expand All @@ -202,7 +202,7 @@ def int2bytes(number, fill_size=None, chunk_size=None, overflow=False):
raise OverflowError(
"Need %d bytes for number, but fill size is %d" % (length, fill_size)
)
raw_bytes = "% {}s".format(fill_size).encode() % raw_bytes
raw_bytes = (b"\x00" * (fill_size - len(raw_bytes))) + raw_bytes
elif chunk_size and chunk_size > 0:
remainder = length % chunk_size
if remainder:
Expand Down