psa: programs: Add cipher example

Add `programs/psa/crypto_examples.c`. Update relevant Makefiles,
CMakeLists.txt, and .gitignore files.
This commit is contained in:
itayzafrir 2018-07-10 10:10:21 +03:00
parent 22e232ec04
commit a3ff8a6ed5
5 changed files with 18 additions and 0 deletions

1
programs/.gitignore vendored
View File

@ -29,6 +29,7 @@ pkey/rsa_sign
pkey/rsa_sign_pss pkey/rsa_sign_pss
pkey/rsa_verify pkey/rsa_verify
pkey/rsa_verify_pss pkey/rsa_verify_pss
psa/crypto_examples
psa/psa_constant_names psa/psa_constant_names
psa/psa_constant_names_generated.c psa/psa_constant_names_generated.c
psa/key_ladder_demo psa/key_ladder_demo

View File

@ -1,6 +1,7 @@
add_subdirectory(aes) add_subdirectory(aes)
add_subdirectory(hash) add_subdirectory(hash)
add_subdirectory(pkey) add_subdirectory(pkey)
add_subdirectory(psa)
add_subdirectory(random) add_subdirectory(random)
add_subdirectory(ssl) add_subdirectory(ssl)
add_subdirectory(test) add_subdirectory(test)

View File

@ -60,6 +60,7 @@ APPS = aes/aescrypt2$(EXEXT) aes/crypt_and_hash$(EXEXT) \
pkey/rsa_decrypt$(EXEXT) pkey/rsa_encrypt$(EXEXT) \ pkey/rsa_decrypt$(EXEXT) pkey/rsa_encrypt$(EXEXT) \
pkey/rsa_sign$(EXEXT) pkey/rsa_verify$(EXEXT) \ pkey/rsa_sign$(EXEXT) pkey/rsa_verify$(EXEXT) \
pkey/rsa_sign_pss$(EXEXT) pkey/rsa_verify_pss$(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) \ psa/key_ladder_demo$(EXEXT) psa/psa_constant_names$(EXEXT) \
ssl/dtls_client$(EXEXT) ssl/dtls_server$(EXEXT) \ ssl/dtls_client$(EXEXT) ssl/dtls_server$(EXEXT) \
ssl/ssl_client1$(EXEXT) ssl/ssl_client2$(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" echo " CC x509/req_app.c"
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) x509/req_app.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ $(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: clean:
ifndef WINDOWS ifndef WINDOWS
rm -f $(APPS) $(EXTRA_GENERATED) rm -f $(APPS) $(EXTRA_GENERATED)

View File

@ -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)

View File

@ -0,0 +1,4 @@
int main( void )
{
return( 0 );
}