Lines Matching refs:in

4 This document describes an interface for cryptoprocessor drivers in the PSA cryptography API. This …
6 …ecification is work in progress and should be considered to be in a beta stage. There is ongoing w…
12 …ns in a uniform way regardless of how the operations are performed. Under the hood, different keys…
14 …icies, and dispatches cryptographic operations either to the applicable driver or to built-in code.
16 Functions in the PSA Cryptography API invoke functions in the core. Code from the core calls driver…
22 * **Transparent** drivers implement cryptographic operations on keys that are provided in cleartext…
33 …hardware: accelerators that operate on keys in cleartext; cryptoprocessors that can wrap keys with…
35 …actions with platform-specific hardware happen only inside the driver (and in fact a driver need n…
47 …to implement some functions with C linkage, and to declare these functions in a **driver descripti…
49 …ver description file is JSON. The structure of this JSON file is specified in the section [“Driver…
53 * A driver description file (in JSON format).
54 …ed by the driver description. The names of these header files are declared in the driver descripti…
65 …iver description files are passed to the implementation as an ordered list in an unspecified manne…
71 …ame that starts with this prefix unless overridden with a `"name"` element in the applicable capab…
77 …sparent drivers, optional for opaque drivers, integer or string). The size in bytes of the [persis…
91 …invoke this capability of the driver for all applicable key sizes. Key sizes are expressed in bits.
92 … described by the `"entry_points"` property, to the name of the C function in the driver that impl…
93 …river may return `PSA_ERROR_NOT_SUPPORTED`, in which case the core should call another driver or u…
97 …tographic mechanism, it invokes available driver entry points as described in the section [“Driver…
117 …f entry point, algorithm, key type and key size, the first matching driver in the [specification l…
131 …with a SECP256R1 or SECP384R1 private key (with either hash being possible in combination with eit…
175 …f the driver. Most driver entry points correspond to a particular function in the PSA Cryptography…
177 … should use the status codes documented for PSA services in general and for PSA Cryptography in pa…
184 3. `size_t key_buffer_size`: the size of the key buffer in bytes.
186 …buffer contains the key material, in the same format as defined for `psa_export_key()` and `psa_ex…
190 * For entry points that are involved in key creation, the `psa_key_id_t *` output parameter is repl…
192 2. `size_t key_buffer_size`: the size of the key buffer in bytes.
193 2. `size_t *key_buffer_length`: the length of the data written to the key buffer in bytes.
195 …e grouped in families that must be implemented as a whole. If a driver supports an entry point fam…
204 …ype `size_t *` is provided to report the actual length of the data written in the buffer if the fu…
205 * An in-out buffer has the type `uint8_t *` and is immediately followed by a parameter of type `siz…
209 Input buffers and other input-only parameters (`const` pointers) may be in read-only memory. Overla…
213 The following driver entry points perform a cryptographic operation in one shot (single-part operat…
217 …e correct MAC. Although transparent drivers may implement this entry point in addition to `"mac_co…
234 …that implements a multi-part operation must define all of the entry points in this family as well …
246 This family corresponds to the calculation of a hash in multiple steps.
339 * The key attributes (`attributes`) have the same semantics as in the PSA Cryptography application …
340 * For the `"import_key"` entry point, the input in the `data` buffer is either the export format or…
341 …etermined from the driver description and the key attributes, as specified in the section [“Key fo…
343 …point must determine or validate the key size and set `*bits` as described in the section [“Key si…
345 All key creation entry points must ensure that the resulting key is valid as specified in the secti…
351 When importing a key, the key size recorded in the key attributes can be either a size specified by…
363 … certain size, or if the keying material involves integers that have to be in a certain range, key…
392in the `output` buffer, in bits. This must be at least `1` on success. The value is ignored on fai…
393 …stem is running as an application in an operating system and `"get_entropy"` returns data from the…
394in bytes. This size should be large enough to allow a driver to pass unconditioned data with a low…
396in the buffer, so the driver may write less than `output_size` bytes but the core does not need to…
425 A driver may declare an `"init"` entry point in a capability with no algorithm, key type or key siz…
427 When multiple drivers have an init entry point, the order in which they are called is unspecified. …
435 …a transparent driver and one for an opaque driver. You can use the mapping in capabilities' `"name…
441in applications. Refer to the documentation of [`psa_export_key()`](https://armmbed.github.io/mbed…
456 As discussed in [the general section about key management entry points](#driver-entry-points-for-ke…
469in the input buffer `data`. The driver must support the export format for the key types that the e…
470 2. Validate the key data. The necessary validation is described in the section [“Key validation wit…
472in the canonical format documented for [`psa_export_key()`](https://armmbed.github.io/mbed-crypto/…
481 * The random generator may either be deterministic (in the sense that it always returns the same da…
485 … type, entry points and parameters (TODO: where exactly are the parameters in the JSON structure?):
522 …fer in bytes. It is guaranteed to be at least `1`, but it may be smaller than the amount of entrop…
526 …mediately after each call to `"get_random"`. The core must call this function in two circumstances:
537 Note that `"get_entropy"` returns data with an estimated amount of entropy that is in general less …
539 …ntropy_size}$ and $\mathtt{entropy_size}$ is the desired amount of entropy in bytes (typically the…
547 …rivers without an `"add_entropy"` entry point, or only accept such drivers in certain configuratio…
550 * the core saves random data in persistent storage to be preserved across platform resets.
567 * `output_size`: the size of the `output` buffer in bytes.
572 …raphic-quality random data. Note that this may be less than `output_size`; in this case the core s…
579 …ons on key sizes, but it cannot cover all the possibilities that may arise in practice. Furthermor…
582 …r that supports the mechanism, if there is one. The core considers drivers in the order given by t…
584 …bled and return `PSA_ERROR_NOT_SUPPORTED`, the core will perform the operation using built-in code.
585 …value is returned to the application, without attempting to call any other driver or built-in code.
587 …re should not include any other code for this capability, whether built in or in another transpare…
591 …ions to a separate environment that might not allow exporting key material in cleartext. The opaqu…
593 …on of a key is the key material wrapped with a master key which is located in the cryptoprocessor …
600 Note that since the core stores the key context blob as it is in memory, it must only contain data …
602 The `"key_context"` property in the [driver description](#driver-description-top-level-element) spe…
604 * `"base_size"` (integer or string, optional): this many bytes are included in every key context. I…
605 * `"key_pair_size"` (integer or string, optional): this many bytes are included in every key contex…
606 * `"public_key_size"` (integer or string, optional): this many bytes are included in every key cont…
609 … name of a function that returns the number of bytes that the driver needs in a key context for a …
610 …xt for [built-in keys](#built-in-keys). This allows drivers to efficiently represent application k…
612 … `sizeof(acme_key_context_t)` where `acme_key_context_t` is a type defined in a driver header file.
620 …ction` is the function named in the `"size_function"` property, `key_type` is the key type and `ke…
644 where `key_bytes = ((key_bits + 7) / 8)` is the key size in bytes.
648 If the key is stored in the secure element and the driver only needs to store a label for the key, …
650in the secure element, but the secure element does not store the public part of a key pair and can…
654 If the key is stored in wrapped form outside the secure element, and the wrapped form of the key pl…
666 …lled by functions that access a key to retrieve information about a [built-in key](#built-in-keys).
670 …psa_key_derivation_output_key()` or `psa_copy_key()` before creating a key in the location of this…
673 #### Key creation in a secure element without storage
685 #### Key management in a secure element with storage
704 …r in the key context. This function should not modify the state of the secure element. It may modi…
714 * Fail the creation of the key without indicating this to the driver. This can happen, in particula…
719in the key attributes to identify a key. Some implementations of the PSA Cryptography API store ke…
721in the secure element or in the driver's persistent storage. To allocate a key slot, find a free s…
722 …d range in the secure element or in the driver's persistent storage. To allocate a key slot, incre…
728 #### Key creation entry points in opaque drivers
746 If the driver has an [`"allocate_key"` entry point](#key-management-in-a-secure-element-with-storag…
750 #### Key export entry points in opaque drivers
769 … on a private key. Drivers implementers may choose to store the public key in the key context buff…
775 …e byte array whose size is given by the `"persistent_state_size"` property in the [driver descript…
777 …tate in memory before it calls the driver's [init entry point](#driver-initialization). It is adju…
791in persistent storage. Only the portion at byte offsets `from` inclusive to `from + length` exclus…
793in storage while an entry point is running except when the entry point calls `psa_crypto_driver_co…
797 #### Built-in keys
799 Opaque drivers may declare built-in keys. Built-in keys can be accessed, but not created, through t…
801in key is identified by its location and its **slot number**. Drivers that support built-in keys m…
813in case the driver has more specific knowledge about the actual persistence level of the key which…
817in key, the key context is a reference to key material that is kept inside the secure element, sim…
822 …` is insufficient. In this case, the driver must pass the key's attributes in `*attributes`. In pa…
826 …estroy a built-in key to the [`"destroy_key"`](#key-management-in-a-secure-element-with-storage) e…
836 …times-and-locations). The driver is invoked for all actions that use a key in that location. A key…
859 …d where operations on the key are performed. Location values can be stored in a variable of type `…
861 …. Keys in the default location (`PSA_KEY_LOCATION_LOCAL_STORAGE = 0`) are transparent: the core ha…
863 ### Creating a key in a secure element
865in the driver description. For convenience, Mbed TLS also declares a compile-time constant for the…
890 …SON integers? C preprocessor integers (which could be e.g. a macro defined in some header file)? C…
931 ### Partial computations in drivers
935 Earlier drafts of the driver interface had a concept of _substitution points_: places in the calcul…
937 …entiation, but not the padding. The driver should be able to leverage the padding code in the core.
938 …rforms a block cipher operation only for a single block, or only in ECB mode, or only in CTR mode.…
940 … reuse portable code such as specifying inner functions like `psa_rsa_pad` in the core, should be …
944 #### Mixing drivers in key derivation
952 …te it on creation, on demand, or anything in between. Opaque drivers have a choice of storing the …
960 … let it through because the driver presumably handles it more efficiently (in terms of speed and c…
972 …member which driver it's calling. This may require a thread-local variable in a multithreaded core…
980 …`"add_entropy"` needs an extra parameter to indicate the amount of entropy in the data. The core m…
981 …`"add_entropy"` needs an extra parameter to indicate the amount of entropy in the data. The core m…