From a3ff8a6ed59e9c8e803f5388a41a1bba18f77919 Mon Sep 17 00:00:00 2001 From: itayzafrir Date: Tue, 10 Jul 2018 10:10:21 +0300 Subject: [PATCH] psa: programs: Add cipher example Add `programs/psa/crypto_examples.c`. Update relevant Makefiles, CMakeLists.txt, and .gitignore files. --- programs/.gitignore | 1 + programs/CMakeLists.txt | 1 + programs/Makefile | 5 +++++ programs/psa/CMakeLists.txt | 7 +++++++ programs/psa/crypto_examples.c | 4 ++++ 5 files changed, 18 insertions(+) create mode 100644 programs/psa/CMakeLists.txt create mode 100644 programs/psa/crypto_examples.c diff --git a/programs/.gitignore b/programs/.gitignore index d58253d49..453ae0d13 100644 --- a/programs/.gitignore +++ b/programs/.gitignore @@ -29,6 +29,7 @@ pkey/rsa_sign pkey/rsa_sign_pss pkey/rsa_verify pkey/rsa_verify_pss +psa/crypto_examples psa/psa_constant_names psa/psa_constant_names_generated.c psa/key_ladder_demo diff --git a/programs/CMakeLists.txt b/programs/CMakeLists.txt index 4cdae7821..661b12071 100644 --- a/programs/CMakeLists.txt +++ b/programs/CMakeLists.txt @@ -1,6 +1,7 @@ add_subdirectory(aes) add_subdirectory(hash) add_subdirectory(pkey) +add_subdirectory(psa) add_subdirectory(random) add_subdirectory(ssl) add_subdirectory(test) diff --git a/programs/Makefile b/programs/Makefile index 9e1a5279e..b1534071c 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -60,6 +60,7 @@ APPS = aes/aescrypt2$(EXEXT) aes/crypt_and_hash$(EXEXT) \ pkey/rsa_decrypt$(EXEXT) pkey/rsa_encrypt$(EXEXT) \ pkey/rsa_sign$(EXEXT) pkey/rsa_verify$(EXEXT) \ pkey/rsa_sign_pss$(EXEXT) pkey/rsa_verify_pss$(EXEXT) \ + psa/crypto_examples$(EXEXT) \ psa/key_ladder_demo$(EXEXT) psa/psa_constant_names$(EXEXT) \ ssl/dtls_client$(EXEXT) ssl/dtls_server$(EXEXT) \ ssl/ssl_client1$(EXEXT) ssl/ssl_client2$(EXEXT) \ @@ -308,6 +309,10 @@ x509/req_app$(EXEXT): x509/req_app.c $(DEP) echo " CC x509/req_app.c" $(CC) $(LOCAL_CFLAGS) $(CFLAGS) x509/req_app.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ +psa/crypto_examples$(EXEXT): psa/crypto_examples.c $(DEP) + echo " CC psa/crypto_examples.c" + $(CC) $(LOCAL_CFLAGS) $(CFLAGS) psa/crypto_examples.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ + clean: ifndef WINDOWS rm -f $(APPS) $(EXTRA_GENERATED) diff --git a/programs/psa/CMakeLists.txt b/programs/psa/CMakeLists.txt new file mode 100644 index 000000000..a0fe803d7 --- /dev/null +++ b/programs/psa/CMakeLists.txt @@ -0,0 +1,7 @@ +add_executable(crypto_examples crypto_examples.c) +target_link_libraries(crypto_examples mbedtls) + +install(TARGETS crypto_examples + DESTINATION "bin" + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) + diff --git a/programs/psa/crypto_examples.c b/programs/psa/crypto_examples.c new file mode 100644 index 000000000..3a549ff86 --- /dev/null +++ b/programs/psa/crypto_examples.c @@ -0,0 +1,4 @@ +int main( void ) +{ + return( 0 ); +}