Move aead_non_psa out of the psa/ directory

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
This commit is contained in:
Manuel Pégourié-Gonnard 2022-01-31 13:27:39 +01:00
parent 69bb3f5332
commit 6fdc9e8df1
7 changed files with 32 additions and 19 deletions

4
programs/.gitignore vendored
View file

@ -13,6 +13,7 @@
*.exe
aes/crypt_and_hash
cipher/aead_demo
hash/generic_sum
hash/hello
hash/hmac_demo
@ -39,8 +40,7 @@ pkey/rsa_sign
pkey/rsa_sign_pss
pkey/rsa_verify
pkey/rsa_verify_pss
psa/aead_non_psa
psa/aead_psa
psa/aead_demo
psa/crypto_examples
psa/hmac_demo
psa/key_ladder_demo

View file

@ -1,4 +1,5 @@
add_subdirectory(aes)
add_subdirectory(cipher)
if (NOT WIN32)
add_subdirectory(fuzz)
endif()

View file

@ -62,6 +62,7 @@ endif
## make sure to check that it still works if you tweak the format here.
APPS = \
aes/crypt_and_hash \
cipher/aead_demo \
hash/generic_sum \
hash/hello \
hash/hmac_demo \
@ -85,8 +86,7 @@ APPS = \
pkey/rsa_sign_pss \
pkey/rsa_verify \
pkey/rsa_verify_pss \
psa/aead_non_psa \
psa/aead_psa \
psa/aead_demo \
psa/crypto_examples \
psa/hmac_demo \
psa/key_ladder_demo \
@ -177,6 +177,10 @@ aes/crypt_and_hash$(EXEXT): aes/crypt_and_hash.c $(DEP)
echo " CC aes/crypt_and_hash.c"
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) aes/crypt_and_hash.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
cipher/aead_demo$(EXEXT): cipher/aead_demo.c $(DEP)
echo " CC cipher/aead_demo.c"
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) cipher/aead_demo.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
hash/generic_sum$(EXEXT): hash/generic_sum.c $(DEP)
echo " CC hash/generic_sum.c"
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) hash/generic_sum.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
@ -269,13 +273,9 @@ pkey/rsa_encrypt$(EXEXT): pkey/rsa_encrypt.c $(DEP)
echo " CC pkey/rsa_encrypt.c"
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/rsa_encrypt.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
psa/aead_non_psa$(EXEXT): psa/aead_non_psa.c $(DEP)
echo " CC psa/aead_non_psa.c"
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) psa/aead_non_psa.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
psa/aead_psa$(EXEXT): psa/aead_psa.c $(DEP)
echo " CC psa/aead_psa.c"
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) psa/aead_psa.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
psa/aead_demo$(EXEXT): psa/aead_demo.c $(DEP)
echo " CC psa/aead_demo.c"
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) psa/aead_demo.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
psa/crypto_examples$(EXEXT): psa/crypto_examples.c $(DEP)
echo " CC psa/crypto_examples.c"

View file

@ -0,0 +1,13 @@
set(executables
aead_demo
)
foreach(exe IN LISTS executables)
add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:mbedtls_test>)
target_link_libraries(${exe} ${mbedcrypto_target})
target_include_directories(${exe} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tests/include)
endforeach()
install(TARGETS ${executables}
DESTINATION "bin"
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)

View file

@ -4,7 +4,7 @@
* This program AEAD-encrypts a message, using the algorithm and key size
* specified on the command line, using the multi-part API.
*
* It comes with a companion program aead_psa.c, which does the same
* It comes with a companion program psa/aead_demo.c, which does the same
* operations with the PSA Crypto API. The goal is that comparing the two
* programs will help people migrating to the PSA Crypto API.
*
@ -18,7 +18,7 @@
* On the other hand, with PSA, the algorithms encodes the desired tag length;
* with Cipher the desired tag length needs to be tracked separately.
*
* This program and its companion aead_psa.c illustrate this by doing the
* This program and its companion psa/aead_demo.c illustrate this by doing the
* same sequence of multi-part AEAD computation with both APIs; looking at the
* two side by side should make the differences and similarities clear.
*/
@ -66,7 +66,7 @@ int main( void )
/* The real program starts here. */
const char usage[] = "Usage: aead_psa [aes128-gcm|aes256-gcm|aes128-gcm_8|chachapoly]";
const char usage[] = "Usage: aead_demo [aes128-gcm|aes256-gcm|aes128-gcm_8|chachapoly]";
/* Dummy data for encryption: IV/nonce, additional data, 2-part message */
const unsigned char iv1[12] = { 0x00 };

View file

@ -1,6 +1,5 @@
set(executables
aead_non_psa
aead_psa
aead_demo
crypto_examples
hmac_demo
key_ladder_demo

View file

@ -4,7 +4,7 @@
* This program AEAD-encrypts a message, using the algorithm and key size
* specified on the command line, using the multi-part API.
*
* It comes with a companion program aead_non_psa.c, which does the same
* It comes with a companion program cipher/aead_demo.c, which does the same
* operations with the legacy Cipher API. The goal is that comparing the two
* programs will help people migrating to the PSA Crypto API.
*
@ -18,7 +18,7 @@
* On the other hand, with PSA, the algorithms encodes the desired tag length;
* with Cipher the desired tag length needs to be tracked separately.
*
* This program and its companion aead_non_psa.c illustrate this by doing the
* This program and its companion cipher/aead_demo.c illustrate this by doing the
* same sequence of multi-part AEAD computation with both APIs; looking at the
* two side by side should make the differences and similarities clear.
*/
@ -68,7 +68,7 @@ int main( void )
/* The real program starts here. */
const char usage[] = "Usage: aead_psa [aes128-gcm|aes256-gcm|aes128-gcm_8|chachapoly]";
const char usage[] = "Usage: aead_demo [aes128-gcm|aes256-gcm|aes128-gcm_8|chachapoly]";
/* Dummy data for encryption: IV/nonce, additional data, 2-part message */
const unsigned char iv1[12] = { 0x00 };