Lines Matching refs:a

10a design document. The target audience is library maintainers. See the companion document [“Transi…
15 * [OPEN] Open question: a specific aspect of the design where there are several plausible decisions.
27 In Mbed TLS 4.0, the cryptography will be provided by a separate project [TF-PSA-Crypto](https://gi…
40 * Only PSA supports isolating cryptographic material in a secure service.
45 …ion, many applications cannot be migrated in a single go. For large projects, it is impractical to…
53 …oducing encrypted or signed files, finding mutually supported algorithms in a network protocol neg…
61 * Creating a key with the legacy API and consuming it in the PSA API.
62 * Creating a key with the PSA API and consuming it in the legacy API.
67 The goal of this document is to bridge the legacy API and the PSA API. The goal is not to provide a
86 …callback (returning `MBEDTLS_ERR_xxx`) on top of PSA functions, but this is a very limited use cas…
92 …ontrivial data format. Therefore the only gap is with metadata, namely specifying a hash algorithm.
125 …s internally: the EC-JPAKE interface only needs one piece of metadata, namely, to identify a curve.
127 …tiple types, and PSA keys have a policy that (for the most part) limits them to one algorithm, the…
131 …This means converting between an `mbedtls_ecp_group_id` and a pair of `{psa_ecc_family_t; size_t}`.
139 * Simultaneously supporting **a key type and an algorithm**.
143 …On the PSA side, this is a `psa_key_type_t` value and an algorithm which is normally encoded as po…
145 #### Using a legacy key pair or public key with PSA
147 …al scenarios where an application has a legacy key pair or public key (`mbedtls_pk_context`) and n…
149 Reasons for first creating a legacy key object, where it's impossible or impractical to directly cr…
151 * A very common case where the input is a legacy key object is parsing. PSA does not (yet) have an …
153 * The pk object may be created by a part of the application (or a third-party library) that hasn't …
155 Reasons for needing a PSA key object:
157a PSA key identifier as input. (Mbed TLS itself has a few TLS functions that take PSA key identifi…
158 * Benefiting from a PSA accelerator, or from PSA's world separation, even without `MBEDTLS_USE_PSA_…
160a way to create a PSA key object from an `mbedtls_pk_context`. This partially exists in the form o…
162 #### Using a PSA key as a PK context
164a PSA key and needs to use it through an interface that wants an `mbedtls_pk_context` object. Typi…
166 There is a function `mbedtls_pk_setup_opaque` that mostly does this. However, it has several limita…
168 * It creates a PK key of type `MBEDTLS_PK_OPAQUE` that wraps the PSA key. This is good enough in so…
170a priority concern, since we generally expect people to activate `MBEDTLS_USE_PSA_CRYPTO` at an ea…
172 It therefore appears that we need two ways to “convert” a PSA key to PK:
174 …This works for any PSA key but is limited by the key's lifetime and creates a PK object with limit…
175 * Copying, which requires a new function. This requires an exportable key but creates a fully indep…
177 Gap: a way to copy a PSA key into a PK context. This can only be expected to work if the PSA key is…
186 * For ECDSA, PSA uses a fixed-size concatenation of (r,s), whereas X.509 and pk use an ASN.1 DER en…
190a design choice here: do we provide conversions functions for ECDSA specifically, or do we provide…
192a sufficiently generic interface to convert between the PSA and the pk signature format, parametri…
194a signature field) or X.509 (the signature is inside a BITSTRING, not directly in a SEQUENCE). So …
206 Each action to implement a function entails:
244 * [OPEN] Is there a decent way to convert between `mbedtls_pk_type_t` plus extra information, and `…
245 …Thinking so far: there isn't really a nice way to present this conversion. For a specific key, `mb…
247 #### API to create a PSA key from a PK context
249 Based on the [gap analysis](#using-a-legacy-key-pair-or-public-key-with-psa):
251a function that creates a PSA key with the same key material and algorithm. “Same key material” is…
253 When creating a PSA key, apart from the key material, the key is determined by attributes, which fa…
255 …ed to the key material and can be deduced from it if the key material is in a structured format, w…
256 …e flags. Users who want a more restrictive usage can call `psa_copy_key` and `psa_destroy_key` to …
259a persistent key more convenient, the conversion function shall take a `const psa_key_attributes_t…
261 …paque`, but does not bake in the implementation-specific consideration that a PSA key has exactly …
274 …s` does not change the id/lifetime fields of the attributes (which indicate a volatile key by defa…
275 …et them to 0? Resetting is more convenient for the case where the pk key is a `MBEDTLS_PK_OPAQUE`.…
277a key pair if the context contains a private key and the indicated usage is a private-key usage. T…
282 …* It is an error if `usage` has more than one flag set, or has a usage that is incompatible with t…
284 …, the algorithm policy is `PSA_ALG_RSA_PKCS1V15_SIGN(PSA_ALG_ANY_HASH)` for a sign/verify usage, a…
285 …e, the algorithm policy is `PSA_ALG_RSA_PSS_ANY_SALT(PSA_ALG_ANY_HASH)` for a sign/verify usage, a…
286 …* For an `MBEDTLS_PK_ECKEY` or `MBEDTLS_PK_ECDSA` with a sign/verify usage, the algorithm policy i…
288a `MBEDTLS_PK_OPAQUE`, this function reads the attributes of the existing PK key and copies them (…
289 …* Public-key restriction: if `usage` is a public-key usage, change the type to the corresponding p…
291 * The key type can be a public key even if the private key is available.
295 #### API to copy a PSA key to a PK context
297 Based on the [gap analysis](#using-a-psa-key-as-a-pk-context):
307 * It is an error if the key is neither a key pair nor a public key.
309 …ct has a transparent type, not `MBEDTLS_PK_OPAQUE`. That's `MBEDTLS_PK_RSA` for RSA keys (since pk…
311 …is a matching operation type (sign/verify, encrypt/decrypt), but with no restriction on the hash (…
314 …reating the key material (for example to benefit from a PSA accelerator driver, or to start using
316 #### API to create a PK object that wraps a PSA key
318 Based on the [gap analysis](#using-a-psa-key-as-a-pk-context):
343 …github.com/Mbed-TLS/mbedtls/pull/8681#discussion_r1445980971), and it isn't a burden on the caller…
344 …S/mbedtls/pull/8703). Providing the functions from the ASN.1 module [won on a compromise of code s…