Mbed forum

HMAC DRBG SHA-256 Port to 24-bit Native Types

(R Speers) #1

I have a project where we need to run the HMAC DRBG code in an environment where the native type is only a 24-bit uint. This looks possible in general until I get to the SHA-256 code which it depends on, which is heavily reliant on 32-bit operations. Is anyone aware of how to address this section of it?

I believe I will need to modify at least these files for the code path that this needs to support:
Parts of entropy.c
Parts of md.c

(Ron Eldor) #2

Mbed TLS is designed to support architectures used by Arm( 32 bit and 62 bit architectures ). It is reasonable that 24 bit might have issues, as it wasn’t tested.
I can suggest you have some type \ Macro in your platform to handle the 32 bit types as a struct of two 24 bit types, and do the calculations to use 32 bits out of them. Does that make sense?