noloader / SHA-Intrinsics

SHA-1, SHA-256 and SHA-512 compression functions using Intel, ARMv8 and Power8 SHA intrinsics
197 stars 40 forks source link

Mobile phone and Android Studio #11

Open bobford opened 1 year ago

bobford commented 1 year ago

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