return invalid argument for unsupported algorithms
diff --git a/library/psa_crypto.c b/library/psa_crypto.c
index 5810853..aaaa8a5 100755
--- a/library/psa_crypto.c
+++ b/library/psa_crypto.c
@@ -1564,6 +1564,10 @@
 
         mbedtls_ccm_free( &ccm );
     }
+    else
+    {
+        return( PSA_ERROR_INVALID_ARGUMENT );
+    }
     memcpy( ciphertext + plaintext_length, tag, sizeof( tag ) );
     *ciphertext_length = plaintext_length + sizeof( tag );
     return( PSA_SUCCESS );