PSA Crypto Testcase checklist

February 4, 2025 ยท View on GitHub

GroupTestFunctionScenarioReturn ValueStepsTest CaseRemarks
Library Initializationtest_c001psa_crypto_initLibrary initializationPSA_SUCCESSCalling this function should return SUCCESS
Applications must call this function before calling any other function in this module.PSA_SUCCESSTry calling crypto operations doing a crypto_init should be successful(can be covered as part of other testcase)
Applications may call this function more than once. Once a call succeedssubsequent calls are guaranteed to succeed.PSA_SUCCESSTry calling multiple crypto init and should return SUCCESS
Applications must call this function before calling any other function in this module.PSA_ERROR_BAD_STATETry calling crypto operations without doing a crypto_init should return FAILURE
Key Managementtest_c002psa_import_keyImport a key in binary format.PSA_SUCCESS1. Initialize the PSA crypto library1. 16 Byte AES
2. Setup the attributes for the key2. 24 Byte AES
3. Import the key data into the key slot3. 32 Byte AES
4. Get basic metadata about a key4. 2048 RSA public key
5. Export a key in binary format5. 2048 RSA keypair
6. Check if original key data matches with the exported data6. DES 64 bit key
7. Reset the key attributes7. Triple DES 2-Key
8. Triple DES 3-Key
9. EC Public key
10. EC keypair
PSA_ERROR_NOT_SUPPORTEDCalling this function with incorrect key typeIncorrect key type
PSA_ERROR_INVALID_ARGUMENTCalling this function with invalid parameter should return this error1. Key data greater than the algorithm size
2. Incorrect key data size
PSA_ERROR_INVALID_HANDLECalling this function with invalid key handle should return this error
Key Managementtest_c003psa_export_keyExport a key in binary formatPSA_SUCCESS1. Initialize the PSA crypto library1. 16 Byte AES
2. Setup the attributes for the key2. 24 Byte AES
3. Import the key data into the key slot3. 32 Byte AES
4. Get basic metadata about a key4. 2048 RSA public key
5. Export a key in binary format5. 2048 RSA keypair
6. Check if original key data matches with the exported data6. DES 64 bit key
7. Reset the key attributes7. Triple DES 2-Key
8. Triple DES 3-Key
9. EC Public key
10. EC keypair
PSA_ERROR_BUFFER_TOO_SMALLCalling this function with buffer size less than requiredLess buffer size
PSA_ERROR_NOT_PERMITTEDCalling this function with with key policy as verify should return this errorKey policy as PSA_KEY_USAGE_VERIFY
PSA_ERROR_INVALID_HANDLECalling this function with invalid parameter should return this error1. Destroyed key slot
Key Managementtest_c004psa_export_public_keyExport a public key or the public part of a key pair in binary format.PSA_SUCCESS1. Initialize the PSA crypto library1. 2048 RSA public key
2. Setup the attributes for the key2. 2048 RSA keypair
3. Import the key data into the key slot3. EC Public key
4. Get basic metadata about a key4. EC keypair
5. Export a key in binary format
6. Check if original key data matches with the exported data
7. Reset the key attributes
PSA_ERROR_BUFFER_TOO_SMALLCalling this function with buffer size less than requiredLess buffer size
PSA_ERROR_INVALID_ARGUMENTCalling this function with invalid parameter should return this error1. DES 64 bit key
2. Triple DES 2-Key
3. Triple DES 3-Key
PSA_ERROR_NOT_PERMITTEDCalling this function with with key policy as verify should return this errorKey usage as PSA_KEY_USAGE_VERIFY
PSA_ERROR_INVALID_HANDLECalling this function with invalid key handle should return this error1. Destroyed key slot
PSA_ERROR_BAD_STATECalling this function with key policy that cannot be exportedInvalid key policy usage
PSA_ERROR_DOES_NOT_EXISTCalling this function with empty key slotEmpty key slot
Key Managementtest_c005psa_destroy_keyDestroy a key and restore the slot to its default state.PSA_SUCCESS1. Initialize the PSA crypto library1. 16 Byte AES
2. Setup the attributes for the key2. 24 Byte AES
3. Import the key data into the key slot3. 32 Byte AES
4. Get basic metadata about a key4. 2048 RSA public key
5. Destroy a key and restore the slot to its default state5. 2048 RSA keypair
6. Check that if the key metadata are destroyed6. DES 64 bit key
7. Triple DES 2-Key
8. Triple DES 3-Key
9. EC Public key
10. EC keypair
PSA_ERROR_INVALID_HANDLECalling this function with invalid parameter should return this errorAlready destroyed key slot
Message Digeststest_c006psa_hash_computeCalculate the hash (digest) of a messagePSA_SUCCESS1. Initialize the PSA crypto library1. MD2
2. Calculate the hash (digest) of a message2. MD4
3. Check if it matches with the expected values3. MD5
4. RIPEMD160
5. SHA1
6. SHA224
7. SHA256
8. SHA384
9. SHA512
10. AES-MMO-ZIGBEE
PSA_ERROR_BUFFER_TOO_SMALLCalling this function with small buffer size should return this errorsmall buffer size
PSA_ERROR_NOT_SUPPORTEDCalling this function with invalid algorithm should return this errorInvalid algorithm
Message Digeststest_c007psa_hash_compareCalculate the hash (digest) of a message and compare it with a reference valuePSA_SUCCESS1. Initialize the PSA crypto library1. MD2
2. Calculate the hash (digest) of a message and compare it with a reference value2. MD4
3. MD5
4. RIPEMD160
5. SHA1
6. SHA224
7. SHA256
8. SHA384
9. SHA512
PSA_ERROR_INVALID_SIGNATURECalling this function with incorrect expected hashIncorrect expected hash
Calling this function with incorrect expected hashIncorrect expected hash length
Key Derivationtest_c008psa_key_derivation_setupSet up a key derivation operation.PSA_SUCCESS1. Initialize the PSA crypto library1. ECDH + HKDF-SHA-256
2. Set up a key derivation operation
3. Abort the key derivation operation
PSA_ERROR_INVALID_ARGUMENTCalling this function with invalid parameter should return this error1. Bad key derivation algorithm
2. Invalid Algorithm
PSA_ERROR_NOT_SUPPORTEDCalling this function with unsupported parameter should return this errorECDH, unknown KDF
Key Derivationtest_c009psa_key_derivation_input_bytesProvide an input for key derivation or key agreementPSA_SUCCESS1. Initialize the PSA crypto library1. Step as Info
2. Initialize a key policy structure to a default that forbids all usage of the key2. Step as salt
3. Provide an input for key derivation or key agreement3. Step as label
4. Allocate a key slot for a transient key4. Step as seed
PSA_ERROR_INVALID_ARGUMENTCalling this function with invalid parameter should return this error1. Step as secret
2. Invalid step
PSA_ERROR_BAD_STATEKey derivation on an aborted operationAborted operation
Key Attributestest_c010psa_set_key_idSet the attributes for the keyNA1. Initialize the PSA crypto libraryTesting only volatile keys and persistence key types will be supported in future release
psa_set_key_lifetime2. Check if all the attributes are initialized to zero
psa_set_key_type3. Setup the attributes for the key
psa_set_key_bits4. Check if all the attributes are as per the input
psa_set_key_usage_flags5. Reset the attributes
psa_set_key_algorithm6. Check if all the attributes are erased
psa_get_key_idGet the attributes for the key
psa_get_key_lifetime
psa_get_key_type
psa_get_key_bits
psa_get_key_usage_flags
psa_get_key_algorithm
psa_reset_key_attributes
Message Digeststest_c011psa_hash_startStart a multipart hash operation.PSA_SUCCESS1. Initialize the PSA crypto library1. MD2
2. Start a multipart hash operation2. MD4
3. Abort the hash operation3. MD5
4. RIPEMD160
5. SHA1
6. SHA224
7. SHA256
8. SHA512
9. SHA512_224
10. SHA512_256
11. SHA3_224 1
2. SHA3_256 1
3. SHA3_384 1
4. SHA3_512
PSA_ERROR_NOT_SUPPORTEDCalling this function with unsupported algorithm should return errorInvalid hash algorithm
PSA_ERROR_BAD_STATECalling this function again after setupMultiple setup calls after one another
PSA_ERROR_INVALID_ARGUMENTCalling this function with invalid parameter should return this error1. Invalid algorithm
2. CTR algorithm
Message Digeststest_c012psa_hash_updateAdd a message fragment to a multipart hash operation.PSA_SUCCESS1. Initialize the PSA crypto library1. MD2
2. Start a multipart hash operation2. MD4
3. Add a message fragment to a multipart hash operation3. MD5
4. Abort the hash operation4. RIPEMD160
5. SHA1
6. SHA224
7. SHA256
8. SHA384
9. SHA512
PSA_ERROR_BAD_STATE1. Calling this function without calling the psa_hash_setup() should return errorOperation handle without setup
2. Calling this function with completed operation handle should return errorCompleted operation handle
Message Digeststest_c013psa_hash_verifyFinish the calculation of the hash of a message and compare it with an expected value.PSA_SUCCESS1. Initialize the PSA crypto library1. MD2
2. Start a multipart hash operation2. MD4
3. Add a message fragment to a multipart hash operation3. MD5
4. Finish the calculation of the hash of a message and compare it with an expected value4. RIPEMD160
5. Abort the hash operation5. SHA1
6. SHA224
7. SHA256
8. SHA384
9. SHA512
10. AES-MMO-ZIGBEE
PSA_ERROR_BAD_STATECalling this function with inactive operation handle should return error1. Inactive operation handle
Calling this function with invalid operation handle should return error2. Invalid operation handle
PSA_ERROR_INVALID_SIGNATURECalling this function with incorrect expected value should return error1. Incorrect expected hash value
2. Incorrect expected hash length
Message Digeststest_c014psa_hash_finishFinish the calculation of the hash of a message.PSA_SUCCESS1. Initialize the PSA crypto library1. MD2
2. Start a multipart hash operation2. MD4
3. Add a message fragment to a multipart hash operation3. MD5
4. Finish the calculation of the hash of a message4. RIPEMD160
5. Compare it with the expected value5. SHA1
6. Abort the hash operation6. SHA224
7. SHA256
8. SHA384
9. SHA512
PSA_ERROR_INVALID_ARGUMENTCalling this function with an inactive operation handle should return errorInactive operation handle
PSA_ERROR_BUFFER_TOO_SMALLCalling this function with a hash buffer whose size is less than the algorithm output should return errorBuffer size less than required
PSA_ERROR_BAD_STATECalling this function with completed operation handlecompleted operation handle
Message Digeststest_c015psa_hash_abortAbort a hash operation.PSA_SUCCESS1. Initialize the PSA crypto library1. MD2
2. Start a multipart hash operation2. MD4
3. Abort a hash operation3. MD5
4. RIPEMD160
5. SHA1
6. SHA224
7. SHA256
8. SHA384
9. SHA512
Generationtest_c016psa_generate_keyGenerate a key or key pairPSA_SUCCESS1. Initialize the PSA crypto library1. AES
2. Setup the attributes for the key2. DES
3. Generate a key or key pair3. ECC
4. Get basic metadata about a key4. RSA
5. Check if key type and key length matches
6. Export a key in binary format
7. Check if the metadata matches
8. Reset and destroy the key
PSA_ERROR_INVALID_ARGUMENTCalling this function with invalid usage flagsinvalid usage flags
PSA_ERROR_ALREADY_EXISTSCalling this function with pre-occupied key slot should return this errorPre-occupied key slot
PSA_ERROR_NOT_SUPPORTEDCalling this function to generate only public key should return this error1. Key type as public key
2. Invalid key type
Generationtest_c017psa_generate_randomGenerate random bytesPSA_SUCCESS1. Initialize the PSA crypto library1. 16 Byte data
2. Generate random bytes Run several times to ensure that every output byte will be nonzero at least once2. 24 Byte data
3. Check that no more than bytes have been overwritten3. 32 Byte data
4. Check that every byte was changed to nonzero at least once.4. 64 Byte data
5. 128 Byte data
6. 256 Byte data
7. 512 Byte data
8. 1000 Byte data
9. 1024 Byte data
Key Derivationtest_c018psa_key_derivation_input_keyProvide an input for key derivation in the form of a keyPSA_SUCCESS1. Initialize the PSA crypto library1. 16 Byte key
2. Setup the attributes for the key2. PBKDF2_HMAC - Password
3. Import the key data into the key slot3. PSA_ALG_TLS12_PSK_TO_MS
4. Set up a key derivation operation4. PSA_ALG_TLS_PRF
5. Provide cost and salt as input steps prior to Password5. SP800-108 HMAC
6. Provide an input for key derivation or key agreement6. SP800-108 CMAC
7. Abort the key derivation operation
PSA_ERROR_NOT_PERMITTEDCalling this function with incorrect data1. Invalid usage
2. Incorrect key algorithm
PSA_ERROR_INVALID_ARGUMENTCalling this function with invalid parameter should return this error1. Step as label
2. Step as info
3. Step as seed
4. Step as cost
5. Step as salt
6. Input key type as AES (not derive)
7. Key type a RSA public key
8. Key type as RSA Keypair
9. Invalid input step for algorithm
PSA_ERROR_INVALID_HANDLECalling this function with destroyed key handle1. No key in slot
PSA_ERROR_BAD_STATECalling this function without setup should return this error
Calling this function with out of order step as input1. PSA_ALG_TLS12_PSK_TO_MS
2. HKDF Extract
Key Derivationtest_c019psa_key_derivation_key_agreementPerform a key agreement and use the shared secret as input to a key derivationPSA_SUCCESS1. Initialize the PSA crypto library1. ECDH SECP256R1 [ECDH]
2. Setup the attributes for the key2. ECDH SECP384R1 [ECDH]
3. Import the key data into the key slot3. FFDH FFDHE2048[FFDH]
4. Set up a key agreement operation4. FFDH3072[FFDH]
5. Perform a key agreement5. FFDH4096[FFDH]
6. Abort6. ECDH SECP256R1 with PSA_ALG_TLS12_PSK_TO_MS
PSA_ERROR_INVALID_ARGUMENTCalling this function with invalid parameter should return this error1. Invalid step [ECDH and FFDH]
2. KDF instead of a key agreement algorithm [ECDH and FFDH]
3. Public key of different curve [ECDH and FFDH]
4. Public key instead of private key [ECDH and FFDH]
5. Invalid input step for kdf algorithm
PSA_ERROR_NOT_PERMITTEDCalling this function with invalid usage should return this errorInvalid usage [ECDH and FFDH]
PSA_ERROR_INVALID_HANDLE1. Zero as key slot
2. Empty key handle
Key Derivationtest_c020psa_key_derivation_output_bytesRead some data from a key derivation operationPSA_SUCCESS1. Initialize the PSA crypto library1. HKDF
2. Setup the attributes for the key2. ECDH with HKDF, optional salt
3. Import the key if the derivation input is key3. HKDF Extract
4. Set up a key derivation operation4. HKDF Expand
5. Set the capacity for the generator5. SP800_108 HMAC
6. Provide input as key or data depending on the step
7. Read some data from a key derivation operation
8. Abort the derivation operation
PSA_ERROR_BAD_STATECalling this function with only supportive step1. Salt
2. Label
3. Seed
4. Aborted operation
PSA_ERROR_INSUFFICIENT_DATACalling this function when there are no capacity1. Requesting greater capacity than available
2. No data available in the operation
Key Derivationtest_c021psa_key_derivation_output_keyDerive a key from an ongoing key derivation operationPSA_SUCCESS1. Initialize the PSA crypto library1. Key
2. Setup the attributes for the key2. Indo
3. Import the key if the derivation input is key3. Label
4. Set up a key derivation operation4. Seed
5. Set the capacity for the generator5. Salt
6. Provide input as key or data depending on the step6. DES key export
7. Setup the attributes for the new key7. ECC keypair
8. Derive a key from an ongoing key derivation operation9. RSA keypair
9. Abort the derivation operation
PSA_ERROR_INSUFFICIENT_DATACalling this function with insufficient data1. Requesting greater capacity than available
2. No data available in the operation
PSA_ERROR_BAD_STATECalling this function on an aborted operation shoukd return this errorAborted operation
PSA_ERROR_NOT_SUPPORTEDGenerating public key1. RSA public key
2. ECC public key
Key Derivationtest_c022psa_key_derivation_abortAbort a key derivation operationPSA_SUCCESS1. Initialize the PSA crypto library
2. Abort the key derivation operation for the different types of initialization
3. Read some data from a key derivation operation with no data in the operation
Key Derivationtest_c023psa_key_derivation_set_capacitySet the maximum capacity of a key derivation operationPSA_SUCCESS1. Initialize the PSA crypto library1. Less than operation capacity
psa_key_derivation_get_capacityRetrieve the current capacity of a key derivation operation2. Start the key derivation operation2. Equal to operation capacity
3. Set the capacity for the generator
4. Get the capacity for the generator
5. Check if the capacity as per the expected value
6. Abort the operation
PSA_ERROR_INVALID_ARGUMENTCalling this function with invalid parameter should return this errorMore than operation capacity
PSA_ERROR_BAD_STATECalling this function on an aborted operation shoukd return this error1. Get capacity on an aborted operation
2. Set capacity on an aborted operation
AEADtest_c024psa_aead_encryptProcess an authenticated encryption operationPSA_SUCCESS1. Initialize the PSA crypto library1. CCM - 16B AES - 13B Nounce & 8B addi data
2. Setup the attributes for the key2. AES-CCM
3. Import the key data into the key slot3. AES-CCM 24 bytes Tag length = 4
4. Call aead encrypt4. GCM - 16B AES - 12B Nounce & 12B addi data
5. Check if the status is expected5. AES - atleast Tag length = 4
6. Check if the cipher text and length is as expected6. Shortened tag - atleast length = 4
7. Destroy and reset the key7. CCM-ARIA 24 bytes Tag length = 4
8. CCM Star Any Tag
9. CHACHA20_POLY1305
10. XCHACHA20_POLY1305
PSA_ERROR_NOT_SUPPORTED1. DES key
2. Unsupported algorithm
PSA_ERROR_INVALID_HANDLEOperation on a destroyed key handle
PSA_ERROR_NOT_PERMITTED1. Small output buffer size
2. Invalid key usage
3. Tag length less than min. length
AEADtest_c025psa_aead_decryptProcess an authenticated decryption operationPSA_SUCCESS1. Initialize the PSA crypto library1. GCM -16B AES - 12B Nounce & 12B addi data
2. Setup the attributes for the key2. CCM - 16B AES - 13B Nounce & 8B addi data
3. Import the key data into the key slot3. AES CCM
4. Call aead decrypt4. AES-CCM 24 bytes Tag length = 4
5. Check if the status is expected5. AES - atleast Tag length = 4
6. Check if the cipher text and length is as expected6. Shortened tag - atleast length = 4
7. Destroy and reset the key7. CCM-ARIA 24 bytes Tag length = 4
PSA_ERROR_NOT_SUPPORTED1. DES key
2. Unsupported algorithm
PSA_ERROR_BUFFER_TOO_SMALLSmall output buffer size
PSA_ERROR_INVALID_ARGUMENTInvalid tag length
PSA_ERROR_INVALID_HANDLEDestroyed key handle
PSA_ERROR_NOT_PERMITTED1. Invalid key usage
2. Tag length less than min. length
PSA_ERROR_INVALID_SIGNATURE1. Invalid cipher text
2. Invalid cipher text size
Message Authentication Codestest_c026psa_mac_sign_setupStart a multipart MAC calculation operationPSA_SUCCESS1. Initialize the PSA crypto library1. 64 Byte HMAC
2. Setup the attributes for the key2. 16 Byte AES - CMAC
3. Import the key data into the key slot
4. Start a multipart MAC calculation operation
5. Abort the MAC operation
6. Destroy the key
PSA_ERROR_NOT_SUPPORTED1. 16 Byte AES - GMAC
2. Incompatible HMAC for CMAC
3. Bad algorithm (unknown MAC algorithm)
4. Truncated MAC too small
PSA_ERROR_NOT_PERMITTEDInvalid usage
PSA_ERROR_INVALID_ARGUMENT1. Invalid key type
2. Truncated MAC too large
3. Bad algorithm (not a MAC algorithm)
PSA_ERROR_INVALID_HANDLE1. Invalid key handle
2. Zero as key handle
Message Authentication Codestest_c027psa_mac_updateAdd a message fragment to a multipart MAC operationPSA_SUCCESS1. Initialize the PSA crypto library1.64 Byte HMAC SHA256
2. Setup the attributes for the key2. 16 Byte AES - CMAC
3. Import the key data into the key slot3. 32 Byte HMAC SHA512
4. Start a multipart MAC calculation operation
5. Add a message fragment to a multipart MAC operation
6. Finish the calculation of the MAC of a message
7. Abort a MAC operation
8. Destroy the key
PSA_ERROR_BAD_STATE1. Completed operation as input
2. Uninitialized operation as input
Message Authentication Codestest_c028psa_mac_sign_finishFinish the calculation of the MAC of a messagePSA_SUCCESS1. Initialize the PSA crypto library1. HMAC SHA 224
2. Setup the attributes for the key2. HMAC SHA 256
3. Import the key data into the key slot3. HMAC SHA 512
4. Start a multipart MAC calculation operation4. HMAC SHA 224 (truncated to 8 Byte)
5. Add a message fragment to a multipart MAC operation5. CMAC AES 128
6. Finish the calculation of the MAC of a message
7. Check if the MAC length matches with the expected length
8. Check if the MAC data matches with the expected data
PSA_ERROR_BUFFER_TOO_SMALLSmall size buffer
PSA_ERROR_BAD_STATEFinish the calculation of the MAC of a message using same operation should return errorAborted operation as input
Message Authentication Codestest_c029psa_mac_verify_setupPSA_SUCCESS1. Initialize the PSA crypto library1. 64 Byte HMAC
2. Setup the attributes for the key2. 16 Byte AES - CMAC
3. Import the key data into the key slot
4. Start a multipart MAC calculation operation
5. Abort the MAC operation
6. Destroy the key
PSA_ERROR_NOT_SUPPORTED1. 16 Byte AES - GMAC
2. Incompatible HMAC for CMAC
3. Bad algorithm (unknown MAC algorithm)
4. Truncated MAC too small
PSA_ERROR_NOT_PERMITTEDInvalid usage
PSA_ERROR_INVALID_ARGUMENT1. Invalid key type
2. Truncated MAC too large
3. Bad algorithm (unknown MAC algorithm)
PSA_ERROR_INVALID_HANDLE1. Invalid key handle
2. Zero as key handle
Message Authentication Codestest_c030psa_mac_verify_finishFinish the calculation of the MAC of a message and compare it with an expected valuePSA_SUCCESS1. Initialize the PSA crypto library1. HMAC SHA 224
2. Setup the attributes for the key2. HMAC SHA 256
3. Import the key data into the key slot3. HMAC SHA 512
4. Start a multipart MAC calculation operation4. HMAC SHA 224 (truncated to 8 Byte)
5. Add a message fragment to a multipart MAC operation5. CMAC AES 128
6. Finish the calculation of the MAC of a message and compare with expected value
PSA_ERROR_INVALID_SIGNATURE1. Small size buffer
2. Incorrect expected hash
PSA_ERROR_BAD_STATEInvalid operation as input
Message Authentication Codestest_c031psa_mac_abortAbort a MAC operationPSA_SUCCESS1. Initialize the PSA crypto library1. HMAC SHA 224
2. Setup the attributes for the key2. HMAC SHA 256
3. Import the key data into the key slot3. HMAC SHA 512
4. Start a multipart MAC calculation operation4. CMAC AES 128
5. Abort the MAC operation5. HMAC truncated
6. Destroy the key6. Multiple abort
7. psa_mac_finish after psa_mac_abort should return failure
Symmetric Cipherstest_c032psa_cipher_encrypt_setupSet the key for a multipart symmetric encryption operationPSA_SUCCESS1. Initialize the PSA crypto library1. 16 Byte AES
2. Setup the attributes for the key2. 24 Byte AES
3. Import the key data into the key slot3. 32 Byte AES
4. Set the key for a multipart symmetric encryption operation4. DES 64 bit key
5. Reset and destroy the key5. Triple DES 2-Key
6. Triple DES 3-Key
PSA_ERROR_NOT_SUPPORTED1. 16 Byte raw data
2. Unknown cipher algorithm
3. Incompatible key ARC4
PSA_ERROR_INVALID_ARGUMENT1. Not a cipher algorithm
2. RSA public key
3. RSA keypair
4. EC Public key
5. EC keypair
PSA_ERROR_NOT_PERMITTEDIncorrect usage
PSA_ERROR_INVALID_HANDLE1. Unallocated key handle
2. Zero as key handle
Symmetric Cipherstest_c033psa_cipher_decrypt_setupSet the key for a multipart symmetric decryption operationPSA_SUCCESS1. Initialize the PSA crypto library1. 16 Byte AES
2. Setup the attributes for the key2. 24 Byte AES
3. Import the key data into the key slot3. 32 Byte AES
4. Set the key for a multipart symmetric decryption operation4. DES 64 bit key
5. Reset and destroy the key5. Triple DES 2-Key
6. Triple DES 3-Key
PSA_ERROR_NOT_SUPPORTED1. 16 Byte raw data
2. Unknown cipher algorithm
3. Incompatible key ARC4
PSA_ERROR_INVALID_ARGUMENT1. Not a cipher algorithm
2. RSA public key
3. RSA keypair
4. EC Public key
5. EC keypair
PSA_ERROR_INVALID_HANDLE1. Unallocated key handle
2. Zero as key handle
PSA_ERROR_NOT_PERMITTEDInvalid usage
Symmetric Cipherstest_c034psa_cipher_generate_ivGenerate an IV for a symmetric encryption operationPSA_SUCCESS1. Initialize the PSA crypto library1. 16 Byte AES
2. Setup the attributes for the key2. 24 Byte AES
3. Import the key data into the key slot3. 32 Byte AES
4. Set the key for a multipart symmetric decryption operation4. DES 64 bit key
5. Generate an IV for a symmetric encryption operation5. Triple DES 2-Key
6. Check that if generated iv length match the expected length6. Triple DES 3-Key
7. Check that if generated iv are not zero7. AES - large iv buffer
8. Reset and destroy the key8. DES - large iv buffer
PSA_ERROR_BUFFER_TOO_SMALL1. AES - small iv buffer
2. DES - small iv buffer
PSA_ERROR_BAD_STATE1. Completed operation handle
Symmetric Cipherstest_c035psa_cipher_set_ivSet the IV for a symmetric encryption or decryption operationPSA_SUCCESS1. Initialize the PSA crypto library1. 16 Byte AES
2. Setup the attributes for the key2. 24 Byte AES
3. Import the key data into the key slot3. 32 Byte AES
4. Set the key for a multipart symmetric encryption/decryption operation4. DES 64 bit key
5. Set an IV for a symmetric encryption/decryption operation5. Triple DES 2-Key
6. Reset and destroy the key6. Triple DES 3-Key
PSA_ERROR_INVALID_ARGUMENT1. AES - small iv buffer
2. DES - small iv buffer
3. AES - large iv buffer
4. DES - large iv buffer
PSA_ERROR_BAD_STATESetting an IV for a symmetric encryption/decryption operation using the same operator should fail1. Completed operation handle
Symmetric Cipherstest_c036psa_cipher_updateEncrypt or decrypt a message fragment in an active cipher operationPSA_SUCCESS1. Initialize the PSA crypto library1. AES CBC_NO_PADDING
2. Setup the attributes for the key2. AES CBC_NO_PADDING (Short input)
3. Import the key data into the key slot3. AES CBC_PKCS7
4. Set the key for a multipart symmetric encryption operation4. AES CBC_PKCS7 (Short input)
5. Set an IV for a symmetric encryption operation5. AES CTR
6. Encrypt or decrypt a message fragment in an active cipher operation6. DES CBC (nopad)
7. Check if the output length matches the expected length7. 2-key 3DE -CBC (nopad)
8. Check if the output data matches the expected data8. 3-key 3DE -CBC (nopad)
9. Reset and destroy the key9. Stream cipher - CHACHA20
10. Stream cipher - XCHACHA20
PSA_ERROR_BAD_STATEEncrypt or decrypt a message fragment in an invalid cipher operation should failInvalid operation as input
PSA_ERROR_BUFFER_TOO_SMALLSmall output buffer size
Symmetric Cipherstest_c037psa_cipher_finishFinish encrypting or decrypting a message in a cipher operationPSA_SUCCESS1. Initialize the PSA crypto library1. AES CBC_NO_PADDING
2. Setup the attributes for the key2. AES CBC_PKCS7
3. Import the key data into the key slot3. AES CBC_PKCS7 (Short input)
4. Set the key for a multipart symmetric encryption operation4. AES CTR
5. Set an IV for a symmetric encryption operation5. DES CBC (nopad)
6. Encrypt or decrypt a message fragment in an active cipher operation6. 2-key 3DE -CBC (nopad)
7. Finish encrypting or decrypting a message in a cipher operation7. 3-key 3DE -CBC (nopad)
8. Check if the output length matches the expected length8. CCM Star no Tag
9. Check if the output data matches the expected data
10. Reset and destroy the key
PSA_ERROR_BAD_STATEEncrypt or decrypt a message fragment in an invalid cipher operation should failInvalid operation as input
PSA_ERROR_BUFFER_TOO_SMALLSmall output buffer size
PSA_ERROR_INVALID_ARGUMENTAES CBC_NO_PADDING (Short input)
Symmetric Cipherstest_c038psa_cipher_abortAbort a cipher operationPSA_SUCCESS1. Initialize the PSA crypto library1. Encrypt - AES CBC_NO_PADDING
2. Setup the attributes for the key2. Encrypt - AES CBC_PKCS7
3. Import the key data into the key slot3. Encrypt - AES CTR
4. Set the key for a multipart symmetric encryption/decryption operation4. Encrypt - DES CBC (nopad)
5. Abort a cipher operation5. Encrypt - 2-key 3DE -CBC (nopad)
6. Multiple abort cipher operation should return success6. Encrypt - 3-key 3DE -CBC (nopad)
7. Decrypt - AES CBC_NO_PADDING
8. Decrypt - AES CBC_PKCS7
9. Decrypt - AES CTR
10. Decrypt - DES CBC (nopad)
11. Decrypt - 2-key 3DE -CBC (nopad)
12. Decrypt - 3-key 3DE -CBC (nopad)
13. psa_cipher_update after psa_cipher_abort should fail
Asymmetric Cryptographytest_c039psa_asymmetric_encryptEncrypt a short message with a public keyPSA_SUCCESS1. Initialize the PSA crypto library1. RSA PKCS1V15
2. Setup the attributes for the key2. RSA OAEP SHA256
3. Import the key data into the key slot3. RSA OAEP SHA256 with label
4. Encrypt a short message with a public key4. RSA KEYPAIR PKCS1V15
5. Check if the output length matches with the expected output length
6. Decrypt the cipher text
7. Check if the output length matches with the input length
8. Check if the output matches with the given input data
9. Reset and destroy the key
PSA_ERROR_INVALID_ARGUMENT1. Invalid key type
2. Invalid algorithm
PSA_ERROR_NOT_PERMITTEDInvalid usage
PSA_ERROR_BUFFER_TOO_SMALLSmall output buffer
PSA_ERROR_INVALID_HANDLE1. Invalid handle
2. Zero as key handle
Asymmetric Cryptographytest_c040psa_asymmetric_decryptDecrypt a short message with a private keyPSA_SUCCESS1. Initialize the PSA crypto library1. RSA KEYPAIR PKCS1V15
2. Setup the attributes for the key2. RSA KEYPAIR OAEP SHA256
3. Import the key data into the key slot3. RSA KEYPAIR OAEP SHA256 with label
4. Decrypt a short message with a private key
5. Check if the output length matches with the expected length
6. Check if the output matches with the expected data
7. Reset and destroy the key
PSA_ERROR_INVALID_ARGUMENT+E5241. Invalid key type (RSA public key)
2. Invalid algorithm
3. Invalid key type (AES Key)
PSA_ERROR_DOES_NOT_EXISTEmpty key slot
PSA_ERROR_NOT_PERMITTEDInvalid usage
PSA_ERROR_INVALID_HANDLEUninitialized key handle
PSA_ERROR_BUFFER_TOO_SMALLSmall output buffer
Asymmetric Cryptographytest_c041psa_sign_hashSign a hash or short message with a private keyPSA_SUCCESS1. Initialize the PSA crypto library1. RSA KEYPAIR PKCS1V15 RAW
2. Setup the attributes for the key2. RSA KEYPAIR PKCS1V15 SHA-256
3. Import the key data into the key slot3. ECDSA KEYPAIR SECP256R1 SHA-256
4. Sign a hash or short message with a private key4. EDDSA Ed25519PH
4. Check if the output length matches with the expected length
5. Check if the output matches with the expected data
6. Reset and destroy the key
PSA_ERROR_INVALID_ARGUMENT1. Invalid key type (RSA public key)
2. Invalid algorithm
3. Invalid key type (AES Key)
4. Wrong hash size
5. Invalid hash value
PSA_ERROR_INVALID_HANDLEUninitialized key handle
PSA_ERROR_DOES_NOT_EXISTEmpty key slot
PSA_ERROR_NOT_PERMITTEDInvalid usage
Invalid key algorithm
PSA_ERROR_BUFFER_TOO_SMALLSmall output buffer
Asymmetric Cryptographytest_c042psa_verify_hashVerify the signature a hash or short message using a public keyPSA_SUCCESS1. Initialize the PSA crypto library1. RSA KEYPAIR PKCS1V15 RAW
2. Setup the attributes for the key2. RSA KEYPAIR PKCS1V15 SHA-256
3. Import the key data into the key slot3. ECDSA KEYPAIR SECP256R1 SHA-256
4. Verify the signature a hash or short message using a public key4. RSA public key
5. Reset and destroy the key5. EC public key
6. PSA_ALG_RSA_PSS_ANY_SALT
7. EDDSA Ed25519PH
PSA_ERROR_INVALID_ARGUMENT1. Invalid algorithm
2. Wrong hash size
PSA_ERROR_INVALID_HANDLE
PSA_ERROR_INVALID_SIGNATUREWrong signature size
Wrong signature
Invalid hash
PSA_ERROR_DOES_NOT_EXISTEmpty key slot
PSA_ERROR_NOT_PERMITTEDInvalid usage
PSA_ERROR_NOT_SUPPORTEDInvalid key type (AES Key)
PSA_ERROR_BUFFER_TOO_SMALLSmall output buffer
Key Derivationtest_c043psa_raw_key_agreementPerform a key agreement and return the raw shared secretPSA_SUCCESS1. Initialize the PSA crypto library1. ECDH SECP256R1
2. Setup the attributes for the key2. ECDH SECP384R1
3. Import the key data into the key slot
4. Set up a key agreement operation
5. Reset and destroy the key
PSA_ERROR_INVALID_ARGUMENT1. Not a key agreement alg
2. Public key on different curve
3. Public key instead of private key
4. Unknown KDF
5. Small size buffer
PSA_ERROR_INVALID_HANDLEUninitialized key handle
PSA_ERROR_NOT_PERMITTEDInvalid usage
Key Managementtest_c044psa_copy_keyCopy key material from one location to anotherPSA_SUCCESS1. Initialize the PSA crypto library1. 16 Byte AES
2. Setup the attributes for the key2. 24 Byte AES
3. Import the key data into the key slot3. 32 Byte AES with constraints
4. Setup the attributes for the target key4. 2048 RSA public key
5. Make a copy of a key5. 2048 RSA key pair
6. Destroy the source to ensure that this does not affect the target6. DES 64 bit key
7. Export a key in binary format and check if it matches with source material7. Triple DES 2-Key
8. Reset and destroy the key8. Triple DES 3-Key
9. EC Public key
10. EC key pair
11. CHACHA20 Key
12. XCHACHA20 Key
PSA_ERROR_INVALID_ARGUMENT1. Incompatible target policy(source and target)
2. Incompatible constraint
3. Incompatible target policy
4. Copy on a destroyed source
PSA_ERROR_INVALID_HANDLE1. Unallocated target key slot
PSA_ERROR_NOT_PERMITTEDUsage set as export (not copy)
Key Managementtest_c045psa_hash_cloneClone a hash operation.PSA_SUCCESS1. Initialize the PSA crypto library1. MD2
2. Start a multipart hash operation2. MD4
3. Clone a hash operation3. MD5
4. Add a message fragment to a multipart hash source_operation4. RIPEMD160
5. Finish the calculation of the hash of a message5. SHA1
6. Abort the hash operation6. SHA224
7. SHA256
8. SHA512
PSA_ERROR_BAD_STATECloning to an active hash operation should be an error1. Active clone hash
2. Aborted operator
Message Authentication Codestest_c046psa_mac_computeCalculate the MAC (message authentication code) of a message.PSA_SUCCESS1. Initialize the PSA crypto library1. HMAC SHA 224
2. Setup the attributes for the key2. CMAC AES 128
3. Import the key data into the key slot3. HMAC SHA 224 (truncated to 8 Byte)
4. Calculate the MAC (message authentication code) of a message4. HMAC SHA 512
5. Check if the MAC length and data matches with the expected values5. HMAC SHA 256
6. Reset and destroy the key6. HMAC SHA 256 (atleast length = 20)
7. Truncated MAC (atleast length = 20)
8. CMAC ARIA 128
PSA_ERROR_NOT_SUPPORTEDCalling this function with unsupported values1. Incompactible HMAC for CMAC
2. Invalid usage
3. Truncated MAC too small
4. Bad algorithm (unknown MAC algorithm)
PSA_ERROR_NOT_PERMITTEDCalling this function with MAC length less than min. length should return this errorMAC length less than min. length
PSA_ERROR_INVALID_ARGUMENTCalling this function with invalid parameter should return this error1. Invalid key type
2. Truncated MAC too large
PSA_ERROR_BUFFER_TOO_SMALLSmall size buffer
PSA_ERROR_INVALID_HANDLEDestroyed key handle
Message Authentication Codestest_c047psa_mac_verifyCalculate the MAC of a message and compare it with a reference valuePSA_SUCCESS1. Initialize the PSA crypto library1. HMAC SHA 224
2. Setup the attributes for the key2. HMAC SHA 256
3. Import the key data into the key slot3. HMAC SHA 512
4. Calculate and verify MAC with reference value4. HMAC SHA 224 (truncated to 8 Byte)
5. Reset and destroy the key5. CMAC AES 128
6. HMAC SHA 224 (atleast length = 8)
7. Truncated MAC (atleast length = 8)
8. CMAC ARIA 128
PSA_ERROR_NOT_SUPPORTEDCalling this function with unsupported values1. Incompactible HMAC for CMAC
2. Invalid usage
3. Truncated MAC too small
4. Bad algorithm (unknown MAC algorithm)
PSA_ERROR_NOT_PERMITTEDCalling this function with MAC length less than min. length should return this errorMAC length less than min. length
PSA_ERROR_INVALID_SIGNATURE1. Small size buffer
2. Incorrect expected MAC
PSA_ERROR_INVALID_ARGUMENT1. Truncated MAC too large
2. Invalid key type
PSA_ERROR_INVALID_HANDLEDestroyed key handle
Message Authentication Codestest_c048psa_mac_sign_multipartCalculate the MAC of a message using multi-part operation.PSA_SUCCESS1. Initialize the PSA crypto library1. HMAC SHA 224
2. Setup the attributes for the key2. HMAC SHA 256
3. Import the key data into the key slot
4. Set up a multi-part MAC calculation operation
5. Add a message fragment to multi-part MAC operation
6. Finish the calculation of the MAC of a message
7. Check if the MAC data matches with the expected data
8. Reset attributes and destroy the key
Message Authentication Codestest_c049psa_mac_verify_multipartVerify the MAC of a message with some expected value using multi-part operation.PSA_SUCCESS1. Initialize the PSA crypto library1. HMAC SHA 224
2. Setup the attributes for the key2. HMAC SHA 256
3. Import the key data into the key slot
4. Set up a multi-part MAC verification operation
5. Add a message fragment to multi-part MAC operation
6. Finish the calculation of MAC of the message and comparing it with an expected value
7. Reset attributes and destroy the key
Symmetric Cipherstest_c050psa_cipher_encryptEncrypt a message using a symmetric cipher.PSA_SUCCESS1. Initialize the PSA crypto library1. AES CBC_NO_PADDING
2. Setup the attributes for the key2. AES CBC_PKCS7
3. Import the key data into the key slot3. AES CBC_PKCS7 (Short input)
4. Encrypt a message using a symmetric cipher4. AES CTR
5. Check if the output matches the expected value5. AES CTR (short input)
6. Reset and destroy the key6. DES CBC (nopad)
7. 2-key 3DE -CBC (nopad)
8. 3-key 3DE -CBC (nopad)
9. AES ARIA
10. CCM Star No Tag
11. Stream Cipher - CHACHA20
12. Stream Cipher - XCHACHA20
PSA_ERROR_NOT_PERMITTEDDecrypt - AES CBC_NO_PADDING
PSA_ERROR_BUFFER_TOO_SMALLSmall output buffer size
PSA_ERROR_INVALID_ARGUMENTAES CBC_NO_PADDING (Short input)
PSA_ERROR_INVALID_HANDLEAborted key handle
Symmetric Cipherstest_c051psa_cipher_decryptDecrypt a message using a symmetric cipher.PSA_SUCCESS1. Initialize the PSA crypto library1. AES CBC_NO_PADDING
2. Setup the attributes for the key2. AES CBC_PKCS7
3. Import the key data into the key slot3. AES CBC_PKCS7 (Short input)
4. Encrypt a message using a symmetric cipher4. AES CTR
5. Check if the output matches the expected value5. AES CTR (short input)
6. Reset and destroy the key6. DES CBC (nopad)
7. 2-key 3DE -CBC (nopad)
8. 3-key 3DE -CBC (nopad)
9. AES ARIA
PSA_ERROR_INVALID_ARGUMENTAES CBC_NO_PADDING (Short input)
PSA_ERROR_NOT_PERMITTEDAES CBC_NO_PADDING
PSA_ERROR_BUFFER_TOO_SMALLSmall output buffer size
PSA_ERROR_INVALID_HANDLEAborted key handle
Asymmetric Cryptographytest_c052psa_sign_messageSign a message with a private keyPSA_SUCCESS1. Initialize the PSA crypto library1. ECDSA SECP256R1 SHA-256
2. Setup the attributes for the key2. EDDSA Ed25519
3. Import the key data into the key slot3. EDDSA 448PH
4. Sign a message with a private key
5. Check if the output length and data matches with the expected values
6. Destroy the created key
PSA_ERROR_INVALID_ARGUMENT1. RSA KEY_PAIR PKCS1V15 RAW
2. Invalid key type (RSA public key)
3. Invalid algorithm
4. Invalid key type (AES Key)
5. Mismatch key type and algorithm
PSA_ERROR_PROGRAMMER_ERRORRSA KEY_PAIR PKCS1V15 SHA-256
PSA_ERROR_BUFFER_TOO_SMALLSmall output buffer
PSA_ERROR_NOT_PERMITTED1. Invalid usage
2. Algorithm mismatch in key and API call
PSA_ERROR_INVALID_HANDLE1. Invalid key handle
2. Zero as key handle
Asymmetric Cryptographytest_c053psa_verify_messageVerify the signature of a message with a public keyPSA_SUCCESS1. Initialize the PSA crypto library1. ECDSA KEY_PAIR SECP256R1 SHA-256
2. Setup the attributes for the key2. ECDSA Public Key SECP256R1 SHA-256
3. Import the key data into the key slot3. EDDSA Ed25519
4. Verify the signature of hash or short message using a public key4. EDDSA 448PH
5. Destroy the created key
PSA_ERROR_INVALID_ARGUMENT1. RSA KEY_PAIR PKCS1V15 RAW
2. RSA Public Key PKCS1V15 RAW
3. Invalid algorithm
4. Invalid key type (AES Key)
5. Wrong message size
PSA_ERROR_INVALID_SIGNATURE1. RSA KEY_PAIR PKCS1V15 SHA-256
2. Small output buffer
3. Wrong signature
4. Wrong signatue size
PSA_ERROR_NOT_PERMITTEDInvalid usage
PSA_ERROR_INVALID_HANDLE1. Invalid key handle
2. Zero as key handle
AEADtest_c054psa_aead_encrypt_setupSet the key for a multipart authenticated encryption operationPSA_SUCCESS1. Initialize the PSA crypto library1. AES-CCM
2. Setup the attributes for the key2. AES-CCM 24 bytes Tag length = 4
3. Import the key data into the key slot3. GCM - 16B AES - 12B Nounce & 12B addi data
4. Set the key for a multipart authenticated encryption operation
5. Destroy the key
6. Abort the AEAD operation
PSA_ERROR_NOT_SUPPORTED1. DES Key
2. Unsupported Algorithm
PSA_ERROR_NOT_PERMITTEDInvalid key usage
PSA_ERROR_INVALID_HANDLEDestroyed key handle
AEADtest_c055psa_aead_decrypt_setupSet the key for a multipart authenticated decryption operationPSA_SUCCESS1. Initialize the PSA crypto library1. AES-CCM
2. Setup the attributes for the key2. AES-CCM 24 bytes Tag length = 4
3. Import the key data into the key slot3. GCM - 16B AES - 12B Nounce & 12B addi data
4. Set the key for a multipart authenticated decryption operation
5. Destroy the key
6. Abort the AEAD operation
PSA_ERROR_NOT_SUPPORTED1. DES Key
2. Unsupported Algorithm
PSA_ERROR_NOT_PERMITTEDInvalid key usage
PSA_ERROR_INVALID_HANDLEDestroyed key handle
AEADtest_c056psa_aead_generate_nonceGenerate a random nonce for an authenticated encryption operationPSA_SUCCESS1. Initialize the PSA crypto library1. AES-CCM
2. Setup the attributes for the key2. AES-CCM 24 bytes Tag length = 4
3. Import the key data into the key slot3. GCM - 16B AES - 12B Nounce & 12B addi data
4. Set the key for a multipart authenticated decryption operation
5. Generate a random nonce for an authenticated encryption operation
6. Check that if generated iv are non zero
7. Destroy the key
8. Reset the key attributes
PSA_ERROR_BUFFER_TOO_SMALLSmall buffer size
PSA_ERROR_BAD_STATE1. Call generate a random nonce twice
2. Aborted operation
AEADtest_c057psa_aead_set_nonceSet the nonce for an authenticated encryption or decryption operationPSA_SUCCESS1. Initialize the PSA crypto library1. AES-CCM
2. Setup the attributes for the key2. AES-CCM 24 bytes Tag length = 4
3. Import the key data into the key slot3. GCM - 16B AES - 12B Nounce & 12B addi data
4. Set the key for a multipart authenticated decryption operation
5. Set the nonce for an authenticated encryption operation
6. Reset and destroy the key
PSA_ERROR_INVALID_ARGUMENT1. Small nounce size
2. Large nonce size
PSA_ERROR_BAD_STATE1. Call set nonce twice
2. Aborted operation
AEADtest_c058psa_aead_set_lengthsDeclare the lengths of the message and additional data for AEADPSA_SUCCESS1. Initialize the PSA crypto library1. AES-CCM
2. Setup the attributes for the key2. AES-CCM 24 bytes Tag length = 4
3. Import the key data into the key slot
4. Set the key for a multipart authenticated decryption operation
5. Set the nonce for an authenticated encryption operation
6. Declare the lengths of the message and additional data for AEAD
7. Abort the AEAD operation
8. Reset and destroy the key
PSA_ERROR_INVALID_ARGUMENT1. Zero ad size
2. Zero plaintext size
3. Invalid lengths
4. Vey large lengths
PSA_ERROR_BAD_STATE1. Failed operation
2. Aborted operation
AEADtest_c059psa_aead_update_adPass additional data to an active AEAD operationPSA_SUCCESS1. Initialize the PSA crypto library1. AES-CCM
2. Setup the attributes for the key2. AES-CCM 24 bytes Tag length = 4
3. Import the key data into the key slot
4. Set the key for a multipart authenticated decryption operation
5. Set the nonce for an authenticated encryption operation
6. Declare the lengths of the message and additional data for AEAD
7. Pass additional data to an active AEAD operation
8. Reset and destroy the key
PSA_ERROR_INVALID_ARGUMENT1. Zero ad size
2. Zero plaintext size
3. Invalid lengths
4. Vey large lengths
PSA_ERROR_BAD_STATEInactive AEAD operation
AEADtest_c060psa_aead_updateEncrypt or decrypt a message fragment in an active AEAD operationPSA_SUCCESS1. Initialize the PSA crypto library1. AES-CCM
2. Setup the attributes for the key2. AES-CCM 24 bytes Tag length = 4
3. Import the key data into the key slot3. GCM - 16B AES - 12B Nounce & 12B addi data
4. Set the key for a multipart authenticated decryption operation
5. Set the nonce for an authenticated encryption operation
6. Declare the lengths of the message and additional data for AEAD
7. Pass additional data to an active AEAD operation
8. Encrypt or decrypt a message fragment in an active AEAD operation
9. Compare the output and its length with the expected values
10. Abort the AEAD operation
11. Reset and destroy the key
PSA_ERROR_INVALID_ARGUMENT1. Zero plaintext size
2. Input length overflows plaintext length
PSA_ERROR_BUFFER_TOO_SMALLSmall buffer size
PSA_ERROR_BAD_STATEInactive AEAD operation
AEADtest_c061psa_aead_finishFinish encrypting a message in an AEAD operationPSA_SUCCESS1. Initialize the PSA crypto library1. AES-CCM
2. Setup the attributes for the key2. AES-CCM 24 bytes Tag length = 4
3. Import the key data into the key slot3. GCM - 16B AES - 12B Nounce & 12B addi data
4. Set the key for a multipart authenticated decryption operation4. CHACHA20_POLY1305
5. Set the nonce for an authenticated encryption operation5. XCHACHA20_POLY1305
6. Declare the lengths of the message and additional data for AEAD
7. Pass additional data to an active AEAD operation
8. Encrypt or decrypt a message fragment in an active AEAD operation
9. Finish encrypting a message in an AEAD operation
10. Compare the output and its length with the expected values
11. Abort the AEAD operation
12. Reset and destroy the key
PSA_ERROR_INVALID_ARGUMENT1. Zero plaintext size
2. Input length overflows plaintext length
PSA_ERROR_BUFFER_TOO_SMALLSmall buffer size
PSA_ERROR_BAD_STATEInactive AEAD operation
AEADtest_c062psa_aead_abortAbort an AEAD operationPSA_SUCCESS1. Initialize the PSA crypto library1. AES-CCM
2. Setup the attributes for the key2. AES-CCM 24 bytes Tag length = 4
3. Import the key data into the key slot3. GCM - 16B AES - 12B Nounce & 12B addi data
4. Set the key for a multipart authenticated decryption operation
5. Abort the AEAD operation
6. Reset and destroy the key
AEADtest_c063psa_aead_verifyFinish authenticating and decrypting a message in an AEAD operationPSA_SUCCESS1. Initialize the PSA crypto library1. AES-CCM
2. Setup the attributes for the key2. AES-CCM 24 bytes Tag length = 4
3. Import the key data into the key slot3. GCM - 16B AES - 12B Nounce & 12B addi data
4. Set the key for a multipart authenticated decryption operation
5. Set the nonce for an authenticated encryption operation
6. Declare the lengths of the message and additional data for AEAD
7. Pass additional data to an active AEAD operation
8. Encrypt or decrypt a message fragment in an active AEAD operation
9. Finish decrypting a message in an AEAD operation
10. Compare the output and its length with the expected values
11. Abort the AEAD operation
12. Reset and destroy the key
PSA_ERROR_INVALID_ARGUMENTInput length is less than plaintext length
PSA_ERROR_BUFFER_TOO_SMALLSmall buffer size
PSA_ERROR_BAD_STATEInactive operator
Message Digeststest_c064psa_hash_suspendHalt the hash operation and extract the intermediate state of the hash computationPSA_SUCCESS1. Initialize the PSA crypto library1. MD2
2. Start a multipart hash operation2. MD4
3. Add a message fragment to multipart hash operation3. MD5
4. Suspend hash operation and verify against the known hash4. RIPEMD160
5. Abort the hash operation5. SHA1
6. SHA224
7. SHA256
8. SHA384
9. SHA512
PSA_ERROR_BUFFER_TOO_SMALLCalling this function with small buffer size should return this errorsmall buffer size
PSA_ERROR_BAD_STATECalling this function with invalid operation state should return this errorInvalid operation state
Message Digeststest_c065psa_hash_resumeSet up a multi-part hash operation from a previously suspended hash operationPSA_SUCCESS1. Initialize the PSA crypto library1. MD2
2. Start a multipart hash operation2. MD4
3. Add a message fragment to multipart hash operation3. MD5
4. Suspend hash operation4. RIPEMD160
5. Resume hash operation5. SHA1
6. Finish the calculation of the hash of a message6. SHA224
7. Abort the hash operation7. SHA256
8. SHA384
9. SHA512
PSA_ERROR_INVALID_ARGUMENTCalling this function with invalid hash state should return this error1. Invalid hash state length
2. Invalid hash state
PSA_ERROR_BAD_STATECalling this function with invalid operation state should return this errorInvalid operation state
Key Derivationtest_c066psa_key_derivation_input_integerProvide a numeric input for key derivation or key agreementPSA_SUCCESS1. Initialize the PSA crypto library1. Step as Cost
2. Set up a key derivation operation
3. Provide an integer input for key derivation
4. Abort the key derivation operation
PSA_ERROR_INVALID_ARGUMENTCalling this function with invalid parameter should return this error1. Step as Salt
2. Step as Password
PSA_ERROR_NOT_SUPPORTEDCalling this function with input as negative integer should return this errorInput as negative integer
PSA_ERROR_BAD_STATEKey derivation on an aborted operationAborted operation
Key Derivationtest_c067psa_key_derivation_verify_bytesCompare output data from a key derivation operation to an expected valuePSA_SUCCESS1. Initialize the PSA crypto library1. PBKDF2_HMAC - Password
2. Setup the attributes for the key2. HKDF
3. Import the key data into the key slot3. HKDF - optional salt
4. Set up a key derivation operation4. HKDF Extract
5. Set the capacity for the generator5. HKDF Expand
6. Provide input as data, integer or key depending on the step
7. Verify data-bytes from ongoing key derivation operation
8. Verify set zero capacity for provided invalid operations capacity
9. Destroy the created key and reset key attributes
10. Abort the derivation operation
PSA_ERROR_NOT_PERMITTEDCalling this function with incorrect usage flag should return this errorIncorrect usage flagSkipping this for now
PSA_ERROR_INVALID_SIGNATURECalling this function with mismatching expected value should return this errorMismatched expected value
PSA_ERROR_INSUFFICIENT_DATACalling this function with invalid operation's capacity should return this errorInvalid operation's capacity
PSA_ERROR_BAD_STATECalling this function with missing input steps should return this error1. Missing input steps
Key derivation on an aborted operation2. Aborted operation
Key Derivationtest_c068psa_key_derivation_verify_keyCompare output data from a key derivation operation to expected value stored in a keyPSA_SUCCESS1. Initialize the PSA crypto library1. PBKDF2_HMAC - Salt
2. Set up a key derivation operation2. PBKDF2_HMAC - Password
3. Set the capacity for the generator3. PBKDF2_AES_CMAC_PRF_128 - Password
4. Setup the attributes for the key
5. Provide input as data or integer depending on the step
6. Import the verification data into its key slot
7. Verify the key from ongoing key derivation operation
8. Verify set zero capacity for provided invalid operation capacity
9. Destroy the created key
10. Abort the derivation operation
PSA_ERROR_NOT_PERMITTEDCalling this function with incorrect usage flag should return this errorIncorrect usage flag
PSA_ERROR_INVALID_SIGNATURECalling this function with mismatching expected value in key should return this errorMismatched expected value stored in a key
Calling this function with invalid input key dataHKDF Expand with invalid input pseudorandom key
PSA_ERROR_INSUFFICIENT_DATACalling this function with invalid operation capacity should return this errorInvalid operation capacity
PSA_ERROR_INVALID_ARGUMENTCalling this function with incorrect key-type should return this errorIncorrect key-type
PSA_ERROR_INVALID_HANDLECalling this function with invalid key identifier should return this errorInvalid key identifier
PSA_ERROR_BAD_STATEKey derivation on an aborted operationAborted operation
PAKEtest_c069psa_pake_setupSetup Password authenticated key exchangePSA_SUCCESS1. Initialize the PSA crypto library1.JPAKE
2. Initialize PAKE operation object2.SPAKE2P-HMAC
3. setup the key attributes3.SPAKE2P-CMAC
4. Import the key data into a key slot4.SPAKE2P MATTER
5. Setup the PAKE operation
6. Abort the PAKE operation
PSA_ERROR_INVALID_ARGUMENTCalling this function with invalid(non PAKE) algorithmCMAC
Calling this function with invalid hash algorithmSPAKE2P CMAC with MD5
Calling this function with invalid PAKE primitivesetting Diffie-Hellman primitive type with ECC primitive family for JPAKE
Calling this function with invalid key confirmation value1.JPAKE with confirmed key
2.SPAKE2P-HMAC with unconfirmed key
Calling this function with non-compatible key typeSPAKE2P-CMAC with PSA_KEY_TYPE_PASSWORD_HASH
PSA_ERROR_NOT_SUPPORTEDCalling this function with invalid PAKE primitivesetting Diffie-Hellman primitive type with ECC primitive family for JPAKE
PSA_ERROR_INVALID_HANDLECalling this function with invalid key identifierzero as key handle
PSA_ERROR_NOT_PERMITTEDCalling this function with invalid usage flag for password keyJPAKE with invalid usage flag
PSA_ERROR_BAD_STATEcalling this function with inactive operation objectinactive operation object
PAKEtest_c070psa_pake_set_roleSet participant role for password authenticated key exchangePSA_SUCCESS1. Initialize the PSA crypto library1.JPAKE
2. Initialize PAKE operation object2.SPAKE2P-HMAC
3. Setup the key attributes3.SPAKE2P-CMAC
4. Import the key data into a key slot4.SPAKE2P MATTER
5. Setup the PAKE operation
6. Set the role for a participant of PAKE operation
6. Abort the PAKE operation
PSA_ERROR_INVALID_ARGUMENTCalling this function with an invalid role for a particular PAKE algorithm1.JPAKE with invalid role
2.SPAKE2P-CMAC with invalid role
3.JPAKE with invalid role (setting an other than specification mentioned role)
Calling this function with non compatible key type1.SPAKE2P-CMAC with invalid key type
2.SPAKE2P MATTER with invalid key type
PSA_ERROR_BAD_STATEcalling this function on an inactive PAKE operation objectinactive PAKE operation object
PAKEtest_c071psa_pake_set_userSet user ID for password authenticated key exchangePSA_SUCCESS1. Initialize the PSA crypto library1.JPAKE
2. Initialize the PAKE operation object2.SPAKE2P-HAMC
3. Setup the key attributes3.SPAKE2P-CMAC
4. Import the key data into a key slot4.SPAKE2P MATTER
5. Setup the PAKE operation
6. Set the participant role for key exchange
7. Set the user ID for a participant in key exchange operation
8. Abort the PAKE operation
PSA_ERROR_INVALID_ARGUMENTcalling this function with an invalid user ID1.JPAKE with NULL as user ID
2.SPAKE2P-HMAC with NULL as user ID
3.SPAKE2P-CMAC with NULL as user ID
Calling this function with an invalid user ID lengthJPAKE with zero user ID length
PSA_ERROR_NOT_SUPPORTEDCalling this function with not supported user IDJPAKE with invalid user ID
PSA_ERROR_BAD_STATECalling this function on inactive PAKE operation objectinactive operation object
PAKEtest_c072psa_pake_set_peerSet peer ID for password authenticated key exchangePSA_SUCCESS1. Initialize the PSA crypto library1.JPAKE
2. Initialize the PAKE operation object2.SPAKE2P-HMAC
3. Setup the key attributes3.SPAKE2P-CMAC
4. Import the key data into a key slot4.SPAKE2P MATTER
5. Setup the PAKE operation
6. Set the role for a participant of PAKE operation
7. Set the user ID for participant in key exchange operation
8. Set the peer ID for participant in key exchange operation
9. Abort the PAKE operation
PSA_ERROR_INVALID_ARGUMENTCalling this function with an invalid peer ID1.JPAKE with NULL as peer ID
2.SPAKE2P-CMAC with NULL as peer ID
3.SPAKE2P MATTER with NULL as peer ID
Calling this function with an invalid peer ID lengthJPAKE with zero as peer ID length
PSA_ERROR_NOT_SUPPORTEDCalling this function with non supported peer IDJPAKE with invalid peer ID
PSA_ERROR_BAD_STATECalling this function on an inactive PAKE operation objectinactive PAKE operation object
PAKEtest_c073psa_pake_set_contextSet the context for password authenticated key exchangePSA_SUCCCES1. Initialize the PSA crypto library1.SPAKE2P-HMAC
2. Initialize PAKE operation object2.SPAKE2P-HAMC with zero as context length
3. Setup the key attributes3.SPAKE2P-CMAC
4. Import the key data into a key slot4.SPAKE2P MATTER
5. Setup the PAKE operation
6. Set the participant role for key exchange
7. Set the user ID for participant in key exchange operation
8. set the peer ID for participant in key exchange operation
9. Set the context for the key exchange
10. Abort the PAKE operation
PSA_ERROR_INVALID_ARGUMENTCalling this function with invalid context1.SPAKE2P-HMAC with NULL as context
2.SPAKE2P-CMAC with NULL as context
PSA_ERROR_BAD_ERRORCalling this function with non supported PAKE algorithmJPAKE
Calling this function on an inactive PAKE operation objectinactive operation object
PAKEtest_c074psa_pake_outputGet an output for a particular step of key exchangePSA_SUCCESS1. Initialize the PSA crypto library1.JPAKE
2. Initialize PAKE operation object2.SPAKE2P-HMAC
3. Setup the key attributes3.SPAKE2P-CMAC
4. Import the key data into a key slot4.SPAKE2P MATTER
5. Setup the PAKE operation
6. Set each participants role for key exchange
7. Set the User ID and peer ID for each participant of key exchange
8. Set context for key exchange for augmented PAKE algorithms
9. Get output for a particular step of key exchange
10. Abort the PAKE operation
PSA_ERROR_INVALID_ARGUMENTCalling this function with invalid step for PAKE algorithm1.JPAKE with an invalid step
2.SPAKE2P-HMAC with an invalid step
3.SPAKE2P-CMAC with an invalid step
4.SPAKE2P MATTER with an invalid step
PSA_ERROR_BUFFER_TOO_SMALLCalling this function with small output buffer size1.JPAKE
2.SPAKE2P-HMAC
PSA_ERROR_BAD_STATECalling this function on inactive PAKE operation objectinactive PAKE operation object
PAKEtest_c075psa_pake_inputProvide an input for a particular step of key exchangePSA_SUCCESS1. Initialize the PSA crypto library1.JPAKE
2. initialize the PAKE operation object for user and peer2.SPAKE2P-HMAC
3. Setup the key attributes3.SPAKE2P-CMAC
4. Import the key data into a key slot4.SPAKE2P-MATTER
5. Setup the PAKE operation
6. Set the participants role for key exchange
7. Set the user ID and peer ID for each participant of key exchange
8. Set context for key exchange for augmented PAKE algorithms
9. Get output for a particular step of key exchange
10. Provide input for a particular step of key exchange
11. Abort the PAKE operation
PSA_ERROR_INVALID_ARGUMENTcalling this function with invalid step for PAKE algorithmJPAKE with invalid step
SPAKE2P with invalid step
Calling this function with invalid inputNULL as input
PSA_ERROR_INVALID_SIGNATURECalling this function with invalid input for PSA_PAKE_STEP_ZK_PROOF or PSA_PAKE_STEP_CONFIRMinvalid input
PSA_ERROR_BAD_STATECalling this function on an inactive PAKE operation objectinactive PAKE operation object
PAKEtest_c076psa_pake_abortAbort a PAKE operationPSA_SUCCESS1. Initialize the PSA crypto library1.JPAKE
2. Initialize the PAKE operation object2.SPAKE2P-HMAC
3. Setup the key attributes3.SPAKE2p-CMAC
4. Import the key data into a key slot4.SPAKE2P MATTER
5. Setup the PAKE operation
6. Abort the PAKE operation
PAKEtest_c077psa_pake_get_shared_keyExtract the shared secret of key exchange as keyPSA_SUCCESS1. Initialize the PSA crypto library1.JPAKE
2. initialize the PAKE operation object for user and peer2.SPAKE2P-HAMC
3. Setup the key attributes3.SPAKE2P-CMAC
4. Import the key data into a key slot4.SPAKE2P MATTER
5. Setup the PAKE operation
6. Set the participants role for key exchange
7. Set the user ID and peer ID for each participant of key exchange
8. Set context for key exchange for augmented PAKE algorithms
9. Perform the key exchange rounds for PAKE algorithm
10. Extract the shared secret after key exchange is done
11. Abort the PAKE operation
PSA_ERROR_INVALID_ARGUMENTcalling this function with invalid key attributes1.JPAKE with invalid key type
2.JPAKE with invalid key policy
3.SPAKE2P-HMAC with invalid key type
4.SPAKE2P-CMAC with invalid key policy
PSA_ERROR_BAD_STATECalling this function before key exchange is completed1.JPAKE
2.SPAKE2P
Calling this function on an inactive PAKE operation objectinactive PAKE operation object
PAKEtest_c078JPAKE testBalanced PAKE algorithms testPSA_SUCCESS1. Initialize the PSA crypto library
2. Initialize the PAKE operation object
3. Setup the key attributes
4. Import the key data into a key slot
5. Setup the PAKE operation
6. Set the participants role for key exchange
7. Set the user ID and peer ID for each participant of key exchange
8. Perform key exchange rounds for JPAKE
9. Extract the shared secret as a key from both user and peer
10. Perform key derivation operation for user and peer to read data from shared key
11. Compare if user and peer have derived same shared secret
12. Abort the PAKE operation for user and peer
PAKEtest_c079SPAKE2P TestAugmented PAKE algorithm testPSA_SUCCESS1. Initialize the PSA crypto library
2. Initialize the PAKE operation object
3. Setup the key attributes
4. Import the key data into a key slot
5. Setup the PAKE operation
6. Set the participants role for key exchange
7. Set the user ID, peer ID and context for each participant of key exchange
8. Perform key exchange rounds for SPAKE2P algorithms
9. Extract the shared secret as a key from both prover and verifier
10. Perform key derivation operation for prover and verifier to read data from shared key
11. Compare if prover and verifier have derived same shared secret
12. Abort the PAKE operation for prover and verifier
Key Agreementtest_c080psa_key_agreementProvide the shared secret resulting from key agreement as a key.PSA_SUCCESS1. Initialize PSA crypto library1. ECDH SECP256R1
2. Setup the private key attributes.2. ECDH SECP384R1
3. Import the private key into the slot
4. setup the desired attributes for the derived key
5. perform key agreement and get the shared secret as a key.
6. Destroy the private key and derived key.
PSA_ERROR_NOT_PERMITTEDCalling this function with invalid usage for private keyinvalid usage flag
PSA_ERROR_INVALID_ARGUMENT1. Public key on a different curve
2. Invalid private key algorithm
3. Invalid private key type
4. invalid derived key type
5. invalid derived key policy
PSA_ERROR_INVALID_HANDLE1. Uninitialized key handle
2. Zero as key handle

Arm PSA test suite is distributed under Apache v2.0 License.


Copyright (c) 2018-2025, Arm Limited and Contributors. All rights reserved.