Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions doc/crypto/api.db/psa/crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ typedef struct psa_custom_key_parameters_t {
#define PSA_ALG_IS_KEY_DERIVATION_STRETCHING(alg) \
/* specification-defined value */
#define PSA_ALG_IS_KEY_ENCAPSULATION(alg) /* specification-defined value */
#define PSA_ALG_IS_KEY_WRAP(alg) /* specification-defined value */
#define PSA_ALG_IS_MAC(alg) /* specification-defined value */
#define PSA_ALG_IS_PAKE(alg) /* specification-defined value */
#define PSA_ALG_IS_PBKDF2_HMAC(alg) /* specification-defined value */
Expand Down Expand Up @@ -139,6 +140,8 @@ typedef struct psa_custom_key_parameters_t {
/* specification-defined value */
#define PSA_ALG_KEY_AGREEMENT_GET_BASE(alg) /* specification-defined value */
#define PSA_ALG_KEY_AGREEMENT_GET_KDF(alg) /* specification-defined value */
#define PSA_ALG_KW ((psa_algorithm_t)0x0B400100)
#define PSA_ALG_KWP ((psa_algorithm_t)0x0BC00200)
#define PSA_ALG_MD2 ((psa_algorithm_t)0x02000001)
#define PSA_ALG_MD4 ((psa_algorithm_t)0x02000002)
#define PSA_ALG_MD5 ((psa_algorithm_t)0x02000003)
Expand Down Expand Up @@ -335,9 +338,11 @@ typedef struct psa_custom_key_parameters_t {
#define PSA_KEY_USAGE_EXPORT ((psa_key_usage_t)0x00000001)
#define PSA_KEY_USAGE_SIGN_HASH ((psa_key_usage_t)0x00001000)
#define PSA_KEY_USAGE_SIGN_MESSAGE ((psa_key_usage_t)0x00000400)
#define PSA_KEY_USAGE_UNWRAP ((psa_key_usage_t)0x00020000)
#define PSA_KEY_USAGE_VERIFY_DERIVATION ((psa_key_usage_t)0x00008000)
#define PSA_KEY_USAGE_VERIFY_HASH ((psa_key_usage_t)0x00002000)
#define PSA_KEY_USAGE_VERIFY_MESSAGE ((psa_key_usage_t)0x00000800)
#define PSA_KEY_USAGE_WRAP ((psa_key_usage_t)0x00010000)
#define PSA_MAC_LENGTH(key_type, key_bits, alg) \
/* implementation-defined value */
#define PSA_MAC_MAX_SIZE /* implementation-defined value */
Expand Down Expand Up @@ -380,6 +385,9 @@ typedef struct psa_custom_key_parameters_t {
/* implementation-defined value */
#define PSA_TLS12_ECJPAKE_TO_PMS_OUTPUT_SIZE 32
#define PSA_TLS12_PSK_TO_MS_PSK_MAX_SIZE /* implementation-defined value */
#define PSA_WRAP_KEY_OUTPUT_SIZE(wrap_key_type, alg, key_type, key_bits) \
/* implementation-defined value */
#define PSA_WRAP_KEY_PAIR_MAX_SIZE /* implementation-defined value */
psa_status_t psa_aead_abort(psa_aead_operation_t * operation);
psa_status_t psa_aead_decrypt(psa_key_id_t key,
psa_algorithm_t alg,
Expand Down Expand Up @@ -735,6 +743,12 @@ psa_status_t psa_sign_message(psa_key_id_t key,
uint8_t * signature,
size_t signature_size,
size_t * signature_length);
psa_status_t psa_unwrap_key(const psa_key_attributes_t * attributes,
psa_key_id_t wrapping_key,
psa_algorithm_t alg,
const uint8_t * data,
size_t data_length,
psa_key_id_t * key);
psa_status_t psa_verify_hash(psa_key_id_t key,
psa_algorithm_t alg,
const uint8_t * hash,
Expand All @@ -747,3 +761,9 @@ psa_status_t psa_verify_message(psa_key_id_t key,
size_t input_length,
const uint8_t * signature,
size_t signature_length);
psa_status_t psa_wrap_key(psa_key_id_t wrapping_key,
psa_algorithm_t alg,
psa_key_id_t key,
uint8_t * data,
size_t data_size,
size_t * data_length);
22 changes: 22 additions & 0 deletions doc/crypto/api/keys/policy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,28 @@ The usage flags are encoded in a bitmask, which has the type `psa_key_usage_t`.

If this flag is present on all keys used in calls to `psa_key_derivation_input_key()` for a key-derivation operation, then it permits calling `psa_key_derivation_verify_bytes()` or `psa_key_derivation_verify_key()` at the end of the operation.

.. macro:: PSA_KEY_USAGE_WRAP
:definition: ((psa_key_usage_t)0x00010000)

.. summary::
Permission to wrap another key with the key.

This flag is required to use the key in a key-wrapping operation.
The flag must be present on keys used with the following APIs:

* `psa_wrap_key()`

.. macro:: PSA_KEY_USAGE_UNWRAP
:definition: ((psa_key_usage_t)0x00020000)

.. summary::
Permission to unwrap another key with the key.

This flag is required to use the key in a key-unwrapping operation.
The flag must be present on keys used with the following APIs:

* `psa_unwrap_key()`

.. function:: psa_set_key_usage_flags

.. summary::
Expand Down
8 changes: 8 additions & 0 deletions doc/crypto/api/keys/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ Symmetric keys
* `PSA_ALG_ECB_NO_PADDING`
* `PSA_ALG_CCM`
* `PSA_ALG_GCM`
* `PSA_ALG_KW`
* `PSA_ALG_KWP`
* `PSA_ALG_SP800_108_COUNTER_CMAC` (secret input)

.. subsection:: Key format
Expand Down Expand Up @@ -369,6 +371,8 @@ Symmetric keys
* `PSA_ALG_ECB_NO_PADDING`
* `PSA_ALG_CCM`
* `PSA_ALG_GCM`
* `PSA_ALG_KW`
* `PSA_ALG_KWP`
* `PSA_ALG_SP800_108_COUNTER_CMAC` (secret input)

.. subsection:: Key format
Expand Down Expand Up @@ -463,6 +467,8 @@ Symmetric keys
* `PSA_ALG_ECB_NO_PADDING`
* `PSA_ALG_CCM`
* `PSA_ALG_GCM`
* `PSA_ALG_KW`
* `PSA_ALG_KWP`
* `PSA_ALG_SP800_108_COUNTER_CMAC` (secret input)

.. subsection:: Key format
Expand Down Expand Up @@ -500,6 +506,8 @@ Symmetric keys
* `PSA_ALG_ECB_NO_PADDING`
* `PSA_ALG_CCM`
* `PSA_ALG_GCM`
* `PSA_ALG_KW`
* `PSA_ALG_KWP`
* `PSA_ALG_SP800_108_COUNTER_CMAC` (secret input)

.. subsection:: Key format
Expand Down
15 changes: 15 additions & 0 deletions doc/crypto/api/ops/algorithms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ The specific algorithm identifiers are described alongside the cryptographic ope
* :secref:`mac-algorithms`
* :secref:`cipher-algorithms`
* :secref:`aead-algorithms`
* :secref:`key-wrapping-algorithms`
* :secref:`key-derivation-algorithms`
* :secref:`sign`
* :secref:`asymmetric-encryption-algorithms`
Expand Down Expand Up @@ -125,6 +126,20 @@ Algorithm categories

See :secref:`aead-algorithms` for a list of defined AEAD algorithms.

.. macro:: PSA_ALG_IS_KEY_WRAP
:definition: /* specification-defined value */

.. summary::
Whether the specified algorithm is a key wrapping algorithm.

.. param:: alg
An algorithm identifier: a value of type `psa_algorithm_t`.

.. return::
``1`` if ``alg`` is a key-wrapping algorithm, ``0`` otherwise. This macro can return either ``0`` or ``1`` if ``alg`` is not a supported algorithm identifier.

See :secref:`key-wrapping-algorithms` for a list of defined key-wrapping algorithms.

.. macro:: PSA_ALG_IS_KEY_DERIVATION
:definition: /* specification-defined value */

Expand Down
3 changes: 2 additions & 1 deletion doc/crypto/api/ops/index.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. SPDX-FileCopyrightText: Copyright 2018-2022, 2024 Arm Limited and/or its affiliates <[email protected]>
.. SPDX-FileCopyrightText: Copyright 2018-2025 Arm Limited and/or its affiliates <[email protected]>
.. SPDX-License-Identifier: CC-BY-SA-4.0 AND LicenseRef-Patent-license

.. _crypto-operations:
Expand All @@ -14,6 +14,7 @@ Cryptographic operation reference
mac
cipher
aead
key-wrapping
key-derivation
signature
pk-encryption
Expand Down
Loading