Skip to content

Commit 6a3dd89

Browse files
Improve alignment in comments
1 parent f77a6ac commit 6a3dd89

File tree

1 file changed

+65
-64
lines changed

1 file changed

+65
-64
lines changed

include/psa/crypto_se_driver.h

Lines changed: 65 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ typedef struct {
5959
* session to the next.
6060
*
6161
* The core allocates a memory buffer for the persistent data.
62-
* The pointer is guaranteed to be suitably alignedfor any data type,
62+
* The pointer is guaranteed to be suitably aligned for any data type,
6363
* like a pointer returned by `malloc` (but the core can use any
6464
* method to allocate the buffer, not necessarily `malloc`).
6565
*
@@ -164,7 +164,7 @@ typedef psa_status_t (*psa_drv_se_mac_setup_t)(psa_drv_se_context_t *drv_context
164164
* updated
165165
* \param[in] p_input A buffer containing the message to be appended
166166
* to the MAC operation
167-
* \param[in] input_length The size in bytes of the input message buffer
167+
* \param[in] input_length The size in bytes of the input message buffer
168168
*/
169169
typedef psa_status_t (*psa_drv_se_mac_update_t)(void *op_context,
170170
const uint8_t *p_input,
@@ -195,10 +195,10 @@ typedef psa_status_t (*psa_drv_se_mac_finish_t)(void *op_context,
195195
* operation by comparing the resulting MAC against a provided value
196196
*
197197
* \param[in,out] op_context A hardware-specific structure for the previously
198-
* started MAC operation to be fiinished
199-
* \param[in] p_mac The MAC value against which the resulting MAC will
200-
* be compared against
201-
* \param[in] mac_length The size in bytes of the value stored in `p_mac`
198+
* started MAC operation to be fiinished
199+
* \param[in] p_mac The MAC value against which the resulting MAC
200+
* will be compared against
201+
* \param[in] mac_length The size in bytes of the value stored in `p_mac`
202202
*
203203
* \retval PSA_SUCCESS
204204
* The operation completed successfully and the MACs matched each
@@ -215,14 +215,14 @@ typedef psa_status_t (*psa_drv_se_mac_finish_verify_t)(void *op_context,
215215
* operation
216216
*
217217
* \param[in,out] op_context A hardware-specific structure for the previously
218-
* started MAC operation to be aborted
218+
* started MAC operation to be aborted
219219
*/
220220
typedef psa_status_t (*psa_drv_se_mac_abort_t)(void *op_context);
221221

222222
/** \brief A function that performs a secure element MAC operation in one
223223
* command and returns the calculated MAC
224224
*
225-
* \param[in,out] drv_context The driver context structure.
225+
* \param[in,out] drv_context The driver context structure.
226226
* \param[in] p_input A buffer containing the message to be MACed
227227
* \param[in] input_length The size in bytes of `p_input`
228228
* \param[in] key_slot The slot of the key to be used
@@ -344,7 +344,7 @@ typedef struct {
344344
/** \brief A function that provides the cipher setup function for a
345345
* secure element driver
346346
*
347-
* \param[in,out] drv_context The driver context structure.
347+
* \param[in,out] drv_context The driver context structure.
348348
* \param[in,out] op_context A structure that will contain the
349349
* hardware-specific cipher context.
350350
* \param[in] key_slot The slot of the key to be used for the
@@ -440,19 +440,19 @@ typedef psa_status_t (*psa_drv_se_cipher_abort_t)(void *op_context);
440440
* Note: this function should only be used with implementations that do not
441441
* provide a needed higher-level operation.
442442
*
443-
* \param[in,out] drv_context The driver context structure.
444-
* \param[in] key_slot The slot of the key to be used for the operation
445-
* \param[in] algorithm The algorithm to be used in the cipher operation
446-
* \param[in] direction Indicates whether the operation is an encrypt or
447-
* decrypt
448-
* \param[in] p_input A buffer containing the data to be
449-
* encrypted/decrypted
450-
* \param[in] input_size The size in bytes of the buffer pointed to by
451-
* `p_input`
452-
* \param[out] p_output The caller-allocated buffer where the output will
453-
* be placed
454-
* \param[in] output_size The allocated size in bytes of the `p_output`
455-
* buffer
443+
* \param[in,out] drv_context The driver context structure.
444+
* \param[in] key_slot The slot of the key to be used for the operation
445+
* \param[in] algorithm The algorithm to be used in the cipher operation
446+
* \param[in] direction Indicates whether the operation is an encrypt or
447+
* decrypt
448+
* \param[in] p_input A buffer containing the data to be
449+
* encrypted/decrypted
450+
* \param[in] input_size The size in bytes of the buffer pointed to by
451+
* `p_input`
452+
* \param[out] p_output The caller-allocated buffer where the output
453+
* will be placed
454+
* \param[in] output_size The allocated size in bytes of the `p_output`
455+
* buffer
456456
*
457457
* \retval PSA_SUCCESS
458458
* \retval PSA_ERROR_NOT_SUPPORTED
@@ -538,7 +538,7 @@ typedef psa_status_t (*psa_drv_se_asymmetric_sign_t)(psa_drv_se_context_t *drv_c
538538
* \brief A function that verifies the signature a hash or short message using
539539
* an asymmetric public key in a secure element
540540
*
541-
* \param[in,out] drv_context The driver context structure.
541+
* \param[in,out] drv_context The driver context structure.
542542
* \param[in] key_slot Key slot of a public key or an asymmetric key
543543
* pair
544544
* \param[in] alg A signature algorithm that is compatible with
@@ -563,7 +563,7 @@ typedef psa_status_t (*psa_drv_se_asymmetric_verify_t)(psa_drv_se_context_t *drv
563563
* \brief A function that encrypts a short message with an asymmetric public
564564
* key in a secure element
565565
*
566-
* \param[in,out] drv_context The driver context structure.
566+
* \param[in,out] drv_context The driver context structure.
567567
* \param[in] key_slot Key slot of a public key or an asymmetric key
568568
* pair
569569
* \param[in] alg An asymmetric encryption algorithm that is
@@ -604,7 +604,7 @@ typedef psa_status_t (*psa_drv_se_asymmetric_encrypt_t)(psa_drv_se_context_t *dr
604604
* \brief A function that decrypts a short message with an asymmetric private
605605
* key in a secure element.
606606
*
607-
* \param[in,out] drv_context The driver context structure.
607+
* \param[in,out] drv_context The driver context structure.
608608
* \param[in] key_slot Key slot of an asymmetric key pair
609609
* \param[in] alg An asymmetric encryption algorithm that is
610610
* compatible with the type of `key`
@@ -674,7 +674,7 @@ typedef struct {
674674
/** \brief A function that performs a secure element authenticated encryption
675675
* operation
676676
*
677-
* \param[in,out] drv_context The driver context structure.
677+
* \param[in,out] drv_context The driver context structure.
678678
* \param[in] key_slot Slot containing the key to use.
679679
* \param[in] algorithm The AEAD algorithm to compute
680680
* (\c PSA_ALG_XXX value such that
@@ -717,7 +717,7 @@ typedef psa_status_t (*psa_drv_se_aead_encrypt_t)(psa_drv_se_context_t *drv_cont
717717

718718
/** A function that peforms a secure element authenticated decryption operation
719719
*
720-
* \param[in,out] drv_context The driver context structure.
720+
* \param[in,out] drv_context The driver context structure.
721721
* \param[in] key_slot Slot containing the key to use
722722
* \param[in] algorithm The AEAD algorithm to compute
723723
* (\c PSA_ALG_XXX value such that
@@ -787,10 +787,10 @@ typedef struct {
787787
* \param[in,out] drv_context The driver context structure.
788788
* \param[in,out] persistent_data A pointer to the persistent data
789789
* that allows writing.
790-
* \param[in] attributes Attributes of the key.
791-
* \param[out] key_slot Slot where the key will be stored.
792-
* This must be a valid slot for a key of the
793-
* chosen type. It must be unoccupied.
790+
* \param[in] attributes Attributes of the key.
791+
* \param[out] key_slot Slot where the key will be stored.
792+
* This must be a valid slot for a key of the
793+
* chosen type. It must be unoccupied.
794794
*
795795
* \retval #PSA_SUCCESS
796796
* Success.
@@ -810,16 +810,16 @@ typedef psa_status_t (*psa_drv_se_allocate_key_t)(
810810
* This function can support any output from psa_export_key(). Refer to the
811811
* documentation of psa_export_key() for the format for each key type.
812812
*
813-
* \param[in,out] drv_context The driver context structure.
814-
* \param[in] key_slot Slot where the key will be stored
815-
* This must be a valid slot for a key of the chosen
816-
* type. It must be unoccupied.
817-
* \param[in] lifetime The required lifetime of the key storage
818-
* \param[in] type Key type (a \c PSA_KEY_TYPE_XXX value)
819-
* \param[in] algorithm Key algorithm (a \c PSA_ALG_XXX value)
820-
* \param[in] usage The allowed uses of the key
821-
* \param[in] p_data Buffer containing the key data
822-
* \param[in] data_length Size of the `data` buffer in bytes
813+
* \param[in,out] drv_context The driver context structure.
814+
* \param[in] key_slot Slot where the key will be stored
815+
* This must be a valid slot for a key of the chosen
816+
* type. It must be unoccupied.
817+
* \param[in] lifetime The required lifetime of the key storage
818+
* \param[in] type Key type (a \c PSA_KEY_TYPE_XXX value)
819+
* \param[in] algorithm Key algorithm (a \c PSA_ALG_XXX value)
820+
* \param[in] usage The allowed uses of the key
821+
* \param[in] p_data Buffer containing the key data
822+
* \param[in] data_length Size of the `data` buffer in bytes
823823
*
824824
* \retval #PSA_SUCCESS
825825
* Success.
@@ -846,7 +846,7 @@ typedef psa_status_t (*psa_drv_se_import_key_t)(psa_drv_se_context_t *drv_contex
846846
* \param[in,out] drv_context The driver context structure.
847847
* \param[in,out] persistent_data A pointer to the persistent data
848848
* that allows writing.
849-
* \param key_slot The key slot to erase.
849+
* \param key_slot The key slot to erase.
850850
*
851851
* \retval #PSA_SUCCESS
852852
* The slot's content, if any, has been erased.
@@ -871,7 +871,7 @@ typedef psa_status_t (*psa_drv_se_destroy_key_t)(
871871
* `psa_export_key()` does. Refer to the
872872
* documentation of `psa_export_key()` for the format for each key type.
873873
*
874-
* \param[in,out] drv_context The driver context structure.
874+
* \param[in,out] drv_context The driver context structure.
875875
* \param[in] key Slot whose content is to be exported. This must
876876
* be an occupied key slot.
877877
* \param[out] p_data Buffer where the key data is to be written.
@@ -902,22 +902,23 @@ typedef psa_status_t (*psa_drv_se_export_key_t)(psa_drv_se_context_t *drv_contex
902902
* The format of the public key information will match the format specified for
903903
* the psa_export_key() function for the key type.
904904
*
905-
* \param[in,out] drv_context The driver context structure.
906-
* \param[in] key_slot Slot where the generated key will be placed
907-
* \param[in] type The type of the key to be generated
908-
* \param[in] usage The prescribed usage of the generated key
909-
* Note: Not all Secure Elements support the same
910-
* restrictions that PSA Crypto does (and vice versa).
911-
* Driver developers should endeavor to match the
912-
* usages as close as possible.
913-
* \param[in] bits The size in bits of the key to be generated.
914-
* \param[in] extra Extra parameters for key generation. The
915-
* interpretation of this parameter should match the
916-
* interpretation in the `extra` parameter is the
917-
* `psa_generate_key` function
918-
* \param[in] extra_size The size in bytes of the \p extra buffer
919-
* \param[out] p_pubkey_out The buffer where the public key information will
920-
* be placed
905+
* \param[in,out] drv_context The driver context structure.
906+
* \param[in] key_slot Slot where the generated key will be placed
907+
* \param[in] type The type of the key to be generated
908+
* \param[in] usage The prescribed usage of the generated key
909+
* Note: Not all Secure Elements support the same
910+
* restrictions that PSA Crypto does (and vice
911+
* versa).
912+
* Driver developers should endeavor to match the
913+
* usages as close as possible.
914+
* \param[in] bits The size in bits of the key to be generated.
915+
* \param[in] extra Extra parameters for key generation. The
916+
* interpretation of this parameter should match
917+
* the interpretation in the `extra` parameter is
918+
* the `psa_generate_key` function
919+
* \param[in] extra_size The size in bytes of the \p extra buffer
920+
* \param[out] p_pubkey_out The buffer where the public key information will
921+
* be placed
921922
* \param[in] pubkey_out_size The size in bytes of the `p_pubkey_out` buffer
922923
* \param[out] p_pubkey_length Upon successful completion, will contain the
923924
* size of the data placed in `p_pubkey_out`.
@@ -1011,12 +1012,12 @@ typedef struct {
10111012
/** \brief A function that Sets up a secure element key derivation operation by
10121013
* specifying the algorithm and the source key sot
10131014
*
1014-
* \param[in,out] drv_context The driver context structure.
1015+
* \param[in,out] drv_context The driver context structure.
10151016
* \param[in,out] op_context A hardware-specific structure containing any
1016-
* context information for the implementation
1017-
* \param[in] kdf_alg The algorithm to be used for the key derivation
1018-
* \param[in] source_key The key to be used as the source material for the
1019-
* key derivation
1017+
* context information for the implementation
1018+
* \param[in] kdf_alg The algorithm to be used for the key derivation
1019+
* \param[in] source_key The key to be used as the source material for
1020+
* the key derivation
10201021
*
10211022
* \retval PSA_SUCCESS
10221023
*/

0 commit comments

Comments
 (0)