Change the hash data to not include the null byte used to terminate
the string. Pass sizeof() - 1 to the hash operation API functions
so that the null byte can be ignored.
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
Restructure the start of the program to make it
clear to a user exactly what this program is for.
Add a comment for additional clarity.
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
Change wording from "failed" since this implied the
function had returned an error status instead of
producing the wrong result.
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
Remove the mbedtls and psa prefixes from variable
names in order to make clearer what is part of
the API and what is just part of the demo program.
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
Replace MBEDTLS_SHA256_C for PSA_WANT_ALG_SHA_256
everywhere, including comments and print statements.
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
Define HALH_ALG to the desired PSA algorithm
to demostrate the ease of swapping algorithms
with the PSA API.
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
This PR was originally created before the code
style was changed. This commit updates the style.
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
This commit adds the example program for PSA
hash as well as the relevant changes to
CMakeLists.txt and the Makefile.
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
If the user has set a value in the build environment, it will be used.
Otherwise, if SDK has a default value, it will be picked.
If either of these values are lower than 0x0501 (XP) we should not force
some calls that will not work on the minimum target OS. We should use
dynamic loading of these API's to support them in higher versions of the
OS.
winsock2.h needs to be included before windows.h and will pick the
default _WIN32_WINNT from the SDK or use the one from the user, by
setting _WIN32_WINNT in the CFLAGS.
Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
The _WIN32_WINNT value will pick the default value for the SDK when
including windows.h. Depending on its value some calls will be possible or not.
Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
On runtime it will attempt to get FindFirstFileW() from kernel32.dll
but it's not there and the DLL/program containing mbedtls will not load.
Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
when target flags are not set at command line, armclang
will reports required feature not set error.
This is found and verified at 6.20.1. And it does not work
for 6.6
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>