Skip to content
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

Mobile phone and Android Studio #11

Open
bobford opened this issue Feb 16, 2023 · 0 comments
Open

Mobile phone and Android Studio #11

bobford opened this issue Feb 16, 2023 · 0 comments

Comments

@bobford
Copy link

bobford commented Feb 16, 2023

I have your code running on a mobile phone developed under Android Studio. The baseline gives the correct answer for the empty message but if I change message[0] to 0x61, for example, I do not see the correct sha-256 for "a". For padding, I added message[1] = 0x80 followed by 54 zeros followed by the message length (1) in the next 8 bytes. I may very well have the padding wrong! Any suggestions would be appreciated. Thank you.
Problem solved: message length in the last 8 bytes needs a <<3! Thanks to mbedtls_sha256_finish at:
https://github.com/Mbed-TLS/mbedtls/blob/development/library/sha256.c

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

No branches or pull requests

1 participant