psa_raw_key_agreement and psa_key_derivation_key_agreement use the pointer to key to store the result of the key exchange. In the application where the Diffie-Hellman key exchange are used, the result of the DH (regardless it is raw or derived) can be used for another cryptographic service like the block cipher or MAC. In my opinion, it is more consistent to use the psa_key_id_t * key as a parameter to drain the result of the DH operation.
Edit: typos and grammar
psa_raw_key_agreementandpsa_key_derivation_key_agreementuse the pointer to key to store the result of the key exchange. In the application where the Diffie-Hellman key exchange are used, the result of the DH (regardless it is raw or derived) can be used for another cryptographic service like the block cipher or MAC. In my opinion, it is more consistent to use thepsa_key_id_t * keyas a parameter to drain the result of the DH operation.Edit: typos and grammar