DRAFT
PSA Crypto Driver Model Specification
Draft 0.3
DRAFT
DRAFT
Contents
1 Introduction 1
2 Module Index 9
2.1 Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3 Data Structure Index 11
3.1 Data Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4 Module Documentation 13
4.1 Opaque Message Authentication Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.1.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.1.2 Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.1.2.1 psa_drv_mac_opaque_setup_t . . . . . . . . . . . . . . . . . . . . . . . 13
4.1.2.2 psa_drv_mac_opaque_update_t . . . . . . . . . . . . . . . . . . . . . . 14
4.1.2.3 psa_drv_mac_opaque_finish_t . . . . . . . . . . . . . . . . . . . . . . . 14
4.1.2.4 psa_drv_mac_opaque_finish_verify_t . . . . . . . . . . . . . . . . . . . 14
4.1.2.5 psa_drv_mac_opaque_abort_t . . . . . . . . . . . . . . . . . . . . . . . 15
4.1.2.6 psa_drv_mac_opaque_generate_t . . . . . . . . . . . . . . . . . . . . . 15
4.1.2.7 psa_drv_mac_opaque_verify_t . . . . . . . . . . . . . . . . . . . . . . . 15
4.2 Transparent Message Authentication Code . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.2.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.2.2 Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.2.2.1 psa_drv_mac_transparent_context_t . . . . . . . . . . . . . . . . . . . 17
4.2.2.2 psa_drv_mac_transparent_setup_t . . . . . . . . . . . . . . . . . . . . 17
4.2.2.3 psa_drv_mac_transparent_update_t . . . . . . . . . . . . . . . . . . . 18
DRAFT
iv CONTENTS
4.2.2.4 psa_drv_mac_transparent_finish_t . . . . . . . . . . . . . . . . . . . . 18
4.2.2.5 psa_drv_mac_transparent_finish_verify_t . . . . . . . . . . . . . . . . 19
4.2.2.6 psa_drv_mac_transparent_abort_t . . . . . . . . . . . . . . . . . . . . 19
4.2.2.7 psa_drv_mac_transparent_t . . . . . . . . . . . . . . . . . . . . . . . . 19
4.2.2.8 psa_drv_mac_transparent_verify_t . . . . . . . . . . . . . . . . . . . . 20
4.3 Opaque Symmetric Ciphers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.3.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.3.2 Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.3.2.1 psa_drv_cipher_opaque_setup_t . . . . . . . . . . . . . . . . . . . . . . 21
4.3.2.2 psa_drv_cipher_opaque_set_iv_t . . . . . . . . . . . . . . . . . . . . . 21
4.3.2.3 psa_drv_cipher_opaque_update_t . . . . . . . . . . . . . . . . . . . . . 22
4.3.2.4 psa_drv_cipher_opaque_finish_t . . . . . . . . . . . . . . . . . . . . . . 22
4.3.2.5 psa_drv_cipher_opaque_abort_t . . . . . . . . . . . . . . . . . . . . . . 23
4.3.2.6 psa_drv_cipher_opaque_ecb_t . . . . . . . . . . . . . . . . . . . . . . . 23
4.4 Transparent Block Cipher . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.4.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.4.2 Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.4.2.1 psa_drv_cipher_transparent_context_t . . . . . . . . . . . . . . . . . . 24
4.4.2.2 psa_drv_cipher_transparent_setup_t . . . . . . . . . . . . . . . . . . . 24
4.4.2.3 psa_drv_cipher_transparent_set_iv_t . . . . . . . . . . . . . . . . . . 25
4.4.2.4 psa_drv_cipher_transparent_update_t . . . . . . . . . . . . . . . . . . 25
4.4.2.5 psa_drv_cipher_transparent_finish_t . . . . . . . . . . . . . . . . . . . 26
4.4.2.6 psa_drv_cipher_transparent_abort_t . . . . . . . . . . . . . . . . . . . 27
4.5 Message Digests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.5.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.5.2 Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.5.2.1 psa_drv_hash_context_t . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.5.2.2 psa_drv_hash_setup_t . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.5.2.3 psa_drv_hash_update_t . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.5.2.4 psa_drv_hash_finish_t . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
PSA Crypto Driver Model Specification Draft 0.3
DRAFT
CONTENTS v
4.5.2.5 psa_drv_hash_abort_t . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.6 Opaque Asymmetric Cryptography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.6.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.6.2 Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.6.2.1 psa_drv_asymmetric_opaque_sign_t . . . . . . . . . . . . . . . . . . . 31
4.6.2.2 psa_drv_asymmetric_opaque_verify_t . . . . . . . . . . . . . . . . . . 31
4.6.2.3 psa_drv_asymmetric_opaque_encrypt_t . . . . . . . . . . . . . . . . . 32
4.6.2.4 psa_drv_asymmetric_opaque_decrypt_t . . . . . . . . . . . . . . . . . 32
4.7 Transparent Asymmetric Cryptography . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
4.7.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
4.7.2 Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
4.7.2.1 psa_drv_asymmetric_transparent_sign_t . . . . . . . . . . . . . . . . . 34
4.7.2.2 psa_drv_asymmetric_transparent_verify_t . . . . . . . . . . . . . . . . 34
4.7.2.3 psa_drv_asymmetric_transparent_encrypt_t . . . . . . . . . . . . . . . 35
4.7.2.4 psa_drv_asymmetric_transparent_decrypt_t . . . . . . . . . . . . . . . 36
4.8 AEAD Opaque . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
4.8.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
4.8.2 Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
4.8.2.1 psa_drv_aead_opaque_encrypt_t . . . . . . . . . . . . . . . . . . . . . 37
4.8.2.2 psa_drv_aead_opaque_decrypt_t . . . . . . . . . . . . . . . . . . . . . 37
4.9 AEAD Transparent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
4.9.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
4.9.2 Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
4.9.2.1 psa_drv_aead_transparent_encrypt_t . . . . . . . . . . . . . . . . . . . 39
4.9.2.2 psa_drv_aead_transparent_decrypt_t . . . . . . . . . . . . . . . . . . . 40
4.10 Entropy Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
4.10.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
4.10.2 Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
4.10.2.1 psa_drv_entropy_init_t . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
4.10.2.2 psa_drv_entropy_get_bits_t . . . . . . . . . . . . . . . . . . . . . . . . 41
PSA Crypto Driver Model Specification Draft 0.3