Home
last modified time | relevance | path

Searched refs:a (Results 1 – 25 of 223) sorted by relevance

123456789

/mbedtls-latest/3rdparty/everest/library/kremlib/
DFStar_UInt128_extracted.c25 static uint64_t FStar_UInt128_constant_time_carry(uint64_t a, uint64_t b) in FStar_UInt128_constant_time_carry() argument
27 return (a ^ ((a ^ b) | ((a - b) ^ b))) >> (uint32_t)63U; in FStar_UInt128_constant_time_carry()
30 static uint64_t FStar_UInt128_carry(uint64_t a, uint64_t b) in FStar_UInt128_carry() argument
32 return FStar_UInt128_constant_time_carry(a, b); in FStar_UInt128_carry()
35 FStar_UInt128_uint128 FStar_UInt128_add(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b) in FStar_UInt128_add() argument
38 flat = { a.low + b.low, a.high + b.high + FStar_UInt128_carry(a.low + b.low, b.low) }; in FStar_UInt128_add()
43 FStar_UInt128_add_underspec(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b) in FStar_UInt128_add_underspec() argument
46 flat = { a.low + b.low, a.high + b.high + FStar_UInt128_carry(a.low + b.low, b.low) }; in FStar_UInt128_add_underspec()
50 FStar_UInt128_uint128 FStar_UInt128_add_mod(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b) in FStar_UInt128_add_mod() argument
53 flat = { a.low + b.low, a.high + b.high + FStar_UInt128_carry(a.low + b.low, b.low) }; in FStar_UInt128_add_mod()
[all …]
DFStar_UInt64_FStar_UInt32_FStar_UInt16_FStar_UInt8.c13 uint64_t FStar_UInt64_eq_mask(uint64_t a, uint64_t b) in FStar_UInt64_eq_mask() argument
15 uint64_t x = a ^ b; in FStar_UInt64_eq_mask()
22 uint64_t FStar_UInt64_gte_mask(uint64_t a, uint64_t b) in FStar_UInt64_gte_mask() argument
24 uint64_t x = a; in FStar_UInt64_gte_mask()
35 uint32_t FStar_UInt32_eq_mask(uint32_t a, uint32_t b) in FStar_UInt32_eq_mask() argument
37 uint32_t x = a ^ b; in FStar_UInt32_eq_mask()
44 uint32_t FStar_UInt32_gte_mask(uint32_t a, uint32_t b) in FStar_UInt32_gte_mask() argument
46 uint32_t x = a; in FStar_UInt32_gte_mask()
57 uint16_t FStar_UInt16_eq_mask(uint16_t a, uint16_t b) in FStar_UInt16_eq_mask() argument
59 uint16_t x = a ^ b; in FStar_UInt16_eq_mask()
[all …]
/mbedtls-latest/programs/
DREADME.md4 …ample programs that illustrate specific features of the library, as well as a few test and support…
20 …ey.c`](pkey/gen_key.c): generates a key for any of the supported public-key algorithms (RSA or ECC…
22 * [`pkey/key_app.c`](pkey/key_app.c): loads a PEM or DER public key or private key file and dumps i…
24 …app_writer.c`](pkey/key_app_writer.c): loads a PEM or DER public key or private key file and write…
26 …_decrypt.c`](pkey/pk_decrypt.c): loads a PEM or DER public/private key file and uses the key to en…
28 …y/pk_verify.c`](pkey/pk_verify.c): loads a PEM or DER private/public key file and uses the key to …
32 * [`pkey/ecdsa.c`](pkey/ecdsa.c): generates an ECDSA key, signs a fixed message and verifies the si…
34 …_decrypt.c): loads an RSA public/private key and uses it to encrypt/decrypt a short string through…
36 * [`pkey/rsa_genkey.c`](pkey/rsa_genkey.c): generates an RSA key and writes it to a file that can b…
38 …y/rsa_verify.c): loads an RSA private/public key and uses it to sign/verify a short string with th…
[all …]
/mbedtls-latest/tests/suites/
Dtest_suite_common.function4 static void fill_arrays(unsigned char *a,
11 a[i] = (unsigned char) i * 3;
23 unsigned char *a = NULL, *b = NULL, *r1 = NULL, *r2 = NULL;
24 TEST_CALLOC(a, n + 1);
30 fill_arrays(a, b, r1, r2, n);
32 r1[i] = a[i] ^ b[i];
34 mbedtls_xor(r2, a, b, n);
37 /* Test r == a */
38 fill_arrays(a, b, r1, r2, n);
46 fill_arrays(a, b, r1, r2, n);
[all …]
Dtest_suite_bignum_mod.function9 #define TEST_COMPARE_MPI_RESIDUES(a, b) \
10 TEST_MEMORY_COMPARE((a).p, (a).limbs * sizeof(mbedtls_mpi_uint), \
237 mbedtls_mpi_mod_residue a = { NULL, 0 };
252 * with a non-zero final parameter. */
253 TEST_EQUAL(0, test_read_residue(&a, &m, input_A, expected_ret != 0));
267 mbedtls_mpi_mod_sub(&x, &a, &b, &m));
279 mbedtls_mpi_mod_sub(&x, &a, &b, &m));
285 /* Negative testing with too many/too few limbs in a and b is covered by
293 /* a - b => Correct result, or expected error */
294 TEST_EQUAL(expected_ret, mbedtls_mpi_mod_sub(&x, &a, &b, &m));
[all …]
/mbedtls-latest/docs/architecture/
Dpsa-keystore-design.md8a key identifier (key ID for short). Applications must first create a key object, which allocates …
16 …store** consists of a collection of **key slots**. Each key slot contains the metadata for one key…
18 A key slot has the type `psa_key_slot_t`. The key store is a global object which is private inside …
22 The following operations allocate a key slot by calling `psa_reserve_free_key_slot()`:
24 * **Creating** a key object, through means such as import, random generation, deterministic derivat…
25 * **Loading** a persistent key from storage, or loading a built-in key. This is done through `psa_g…
27 The following operations free a key slot by calling `psa_wipe_key_slot()` and, if applicable, `psa_…
29 * **Destroying** a key.
30 * **Purging** a persistent key from memory, either explicitly at the application's request or to fr…
42 The state of a key slot is indicated by its `state` field of type `psa_key_slot_state_t`, which can…
[all …]
Dpsa-storage-resilience.md5a persistent key store. It is possible to create a persistent key and read it back later. This mus…
7a system crash or power loss. That is, we assume that the underlying platform behaves nominally, e…
9 This document explores the problem space, defines a library design and a test design.
15 …any given point in time, the system is either in a state where the function has not started yet, o…
17a function returns, the data has been written to the persistent storage. As a consequence, if the …
19 …mple, if a key creation function in the PSA Crypto API reports to the application that a key has b…
23 PSA relies on a PSA ITS (Internal Trusted Storage) interface, which exposes a simple API. There are…
25 * `set()` writes a whole file (either creating it, or replacing the previous content).
26 * `remove()` removes a file (returning a specific error code if the file does not exist).
30 …atomic, the content of a file is always a version that was previously passed to `set()`. We do not…
[all …]
Dmbed-crypto-storage-specification.md5 Key storage was originally introduced in a product called Mbed Crypto, which was re-distributed via…
11 …ation from this document unless it has always been incorrect or it is about a version that you are…
28 * [Persistent transparent keys](#key-file-format-for-0.1.0) designated by a [slot number](#key-name…
31 This is a beta release, and we do not promise backward compatibility, with one exception:
33 > On Mbed OS, if a device has a nonvolatile random seed file produced with Mbed OS 5.11.x and is up…
39 Information about each key is stored in a dedicated file whose name is constructed from the key ide…
41 The valid values for a key identifier are the range from 1 to 0xfffeffff. This limitation on the ra…
47 There is a shared namespace for all callers.
53 The layout of a key file is:
66 The nonvolatile random seed file contains a seed for the random generator. If present, it is rewrit…
[all …]
Dpsa-shared-memory.md6 …h an untrusted process. On such systems, the untrusted process might access a shared memory buffer…
19a system that has memory separation between partitions: a partition can't access another partition…
21a system where our PSA Crypto implementation is running inside one partition, called the **crypto …
23a risk that this other partition will access it while the crypto implementation is working. Althou…
25 …only possible if an untrusted entity accesses a buffer while the crypto service is processing the …
29 We consider a security architecture with two or three entities:
31 * a crypto service, which offers PSA crypto API calls over RPC (remote procedure call) using shared…
32 * a client of the crypto service, which makes a RPC to the crypto service;
33 * in some scenarios, a client of the client, which makes a RPC to the crypto client which re-shares…
35 …pto service while it is processing an RPC. It is a security violation if the crypto service behave…
[all …]
Dtls13-support.md104 | MBEDTLS_SSL_ENCRYPT_THEN_MAC | n/a |
105 | MBEDTLS_SSL_EXTENDED_MASTER_SECRET | n/a |
107 | MBEDTLS_SSL_RENEGOTIATION | n/a |
117 | MBEDTLS_KEY_EXCHANGE_PSK_ENABLED | n/a (2) |
118 | MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED | n/a |
119 | MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED | n/a |
120 | MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED | n/a |
121 | MBEDTLS_KEY_EXCHANGE_RSA_ENABLED | n/a |
122 | MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED | n/a |
123 | MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED | n/a |
[all …]
/mbedtls-latest/3rdparty/everest/include/everest/kremlib/
DFStar_UInt128.h26 FStar_UInt128_uint128 FStar_UInt128_add(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b);
29 FStar_UInt128_add_underspec(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b);
31 FStar_UInt128_uint128 FStar_UInt128_add_mod(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b);
33 FStar_UInt128_uint128 FStar_UInt128_sub(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b);
36 FStar_UInt128_sub_underspec(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b);
38 FStar_UInt128_uint128 FStar_UInt128_sub_mod(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b);
40 FStar_UInt128_uint128 FStar_UInt128_logand(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b);
42 FStar_UInt128_uint128 FStar_UInt128_logxor(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b);
44 FStar_UInt128_uint128 FStar_UInt128_logor(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b);
46 FStar_UInt128_uint128 FStar_UInt128_lognot(FStar_UInt128_uint128 a);
[all …]
/mbedtls-latest/docs/proposed/
Dpsa-driver-interface.md4 …/#application-programming-interface), which describes the interface between a PSA Cryptography imp…
6 This specification is work in progress and should be considered to be in a beta stage. There is ong…
8 For a practical guide, with a description of the current state of drivers Mbed TLS, see our [PSA Cr…
14 …n interface that allows applications to perform cryptographic operations in a uniform way regardle…
16 …mpositionally. An implementation of the PSA Cryptography API is composed of a **core** and zero or…
24a transparent driver is available for a particular combination of parameters (cryptographic algori…
25 …hat can only be used inside a protected environment such as a **secure element**, a hardware secur…
35 …that operate on keys in cleartext; cryptoprocessors that can wrap keys with a built-in keys but no…
37 … with platform-specific hardware happen only inside the driver (and in fact a driver need not invo…
41 …erator drivers can specify that they do not fully support a cryptographic mechanism and that a fal…
[all …]
Dpsa-conditional-inclusion-c.md4 This document is a proposed interface for deciding at build time which cryptographic mechanisms to …
6 This is currently a proposal for Mbed TLS. It is not currently on track for standardization in PSA.
12a PSA Cryptography implementation and an application. The interface defines a number of categories…
14 The present document proposes a way for an application using the PSA cryptography interface to decl…
18 Mbed TLS offers a way to select which cryptographic mechanisms are included in a build through its …
22a cryptographic mechanism (or, with **fallback**, the built-in implementation is tried if the driv…
24a platform with ECC acceleration that can perform all ECDSA and ECDH operations in the accelerator…
30 [Req.inclusion] If the application does not require a mechanism, a suitably configured Mbed TLS bui…
32 …vers] If a PSA driver is available in the build, a suitably configured Mbed TLS build must not inc…
34 …C preprocessor definitions, and the build does not require tools other than a C compiler. This is …
[all …]
Dpsa-driver-developer-guide.md4 **This is a specification of work in progress. The implementation is not yet merged into Mbed TLS.**
5 For a description of the current state of drivers Mbed TLS, see our [PSA Cryptoprocessor driver dev…
9 This document focuses on behavior that is specific to Mbed TLS. For a reference of the interface be…
17 The PSA cryptography driver interface provides a way to build Mbed TLS with additional code that im…
21a transparent driver is available for a particular combination of parameters (cryptographic algori…
22 …hat can only be used inside a protected environment such as a **secure element**, a hardware secur…
24 ### Deliverables for a driver
26a driver, you need to implement some functions with C linkage, and to declare these functions in a
28 The concrete syntax for a driver description file is JSON. The structure of this JSON file is speci…
43 …include complex preprocessor definitions to conditionally include header files for a given driver.
[all …]
/mbedtls-latest/
D.uncrustify.cfg82 # No space after a unary negation '-'
107 # No spaces inside the first parentheses in a function type
127 # At least 1 space before a '*' pointer star
133 # No space after a pointer star
136 # But allow a space in the case of e.g. char * const x;
139 # Remove space after star in a function return type
142 # At least 1 space after a type in variable definition etc
145 # Force exactly 1 space between a statement keyword (e.g. 'if') and an opening parenthesis
148 # Remove a space before a ';'
150 # (Uncrustify >= 0.73.0) Remove space before a semi in a non-empty for
[all …]
DCONTRIBUTING.md12 - [Changelog](#documentation): if needed, please provide a changelog entry.
13 - [Backports](#long-term-support-branches): provide a backport if needed (it's fine to wait until t…
17 …ibution passes basic tests before submission, and check the CI results after making a pull request.
18 - The code should be written in a clean and readable style, and must follow [our coding standards](…
19 - The code should be written in a portable generic way, that will benefit the whole community, and …
20 - The code should be secure, and will be reviewed from a security point of view as well.
22 Making a Contribution
24 …es) or [start a discussion](https://lists.trustedfirmware.org/mailman3/lists/mbed-tls.lists.truste…
25 … your changes. As a general rule, you should use the ["development" branch](https://github.com/Mbe…
26 1. Write a test which shows that the bug was fixed or that the feature works as expected.
[all …]
/mbedtls-latest/docs/architecture/psa-migration/
Dpsa-legacy-bridges.md10a 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…
[all …]
Dmd-cipher-dispatch.md6a migration strategy for code that is not subject to `MBEDTLS_USE_PSA_CRYPTO`, is currently using …
10 This is complementary to the main [strategy document](strategy.html) and is intended as a refinemen…
12 …rategy and the current one is that in this work, we are not treating PSA as a black box. We can ch…
20 As a developer of an application that uses Mbed TLS's interfaces (including legacy crypto),
26 As a developer of library code that uses Mbed TLS to perform cryptographic operations,
34 As a vendor of a platform with hardware acceleration for some crypto,
35 I want to build Mbed TLS in a way that uses my hardware wherever relevant,
38 As a vendor of a platform with hardware acceleration for some crypto,
44 As a maintainer of Mbed TLS,
48 As a maintainer of Mbed TLS,
[all …]
/mbedtls-latest/library/
Daesce.c410 #define vreinterpretq_u64_p64(a) ((uint64x2_t) a) argument
414 static inline poly128_t vmull_p64(poly64_t a, poly64_t b) in vmull_p64() argument
417 asm ("vmull.p64 %[r], %[a], %[b]" : [r] "=w" (r) : [a] "w" (a), [b] "w" (b) :); in vmull_p64()
424 static inline poly128_t vmull_high_p64(poly64x2_t a, poly64x2_t b) in vmull_high_p64() argument
426 return vmull_p64((poly64_t) (vget_high_u64((uint64x2_t) a)), in vmull_high_p64()
470 #define vreinterpretq_p64_u8(a) ((poly64x2_t) a) argument
471 #define vreinterpretq_u8_p128(a) ((uint8x16_t) a) argument
473 static inline poly64x1_t vget_low_p64(poly64x2_t a) in vget_low_p64() argument
475 uint64x1_t r = vget_low_u64(vreinterpretq_u64_p64(a)); in vget_low_p64()
490 #define MBEDTLS_VMULL_P64(a, b) vmull_p64((poly64_t) a, (poly64_t) b) argument
[all …]
Daria.c109 static inline void aria_a(uint32_t *a, uint32_t *b, in aria_a() argument
114 *b = *a; // 0123 in aria_a()
115 *a = ARIA_P2(ta); // 6745 in aria_a()
123 tc ^= ARIA_P1(*a); // 2301+7654 in aria_a()
126 *a ^= ARIA_P1(tb); // 3210+4567+6745+89ab+98ba+dcfe+efcd OUT in aria_a()
141 static inline void aria_sl(uint32_t *a, uint32_t *b, in aria_sl() argument
146 *a = ((uint32_t) sa[MBEDTLS_BYTE_0(*a)]) ^ in aria_sl()
147 (((uint32_t) sb[MBEDTLS_BYTE_1(*a)]) << 8) ^ in aria_sl()
148 (((uint32_t) sc[MBEDTLS_BYTE_2(*a)]) << 16) ^ in aria_sl()
149 (((uint32_t) sd[MBEDTLS_BYTE_3(*a)]) << 24); in aria_sl()
[all …]
/mbedtls-latest/docs/architecture/testing/
Ddriver-interface-test-strategy.md21a driver usable by Mbed TLS, the initialization code must call `psa_register_se_driver` with a str…
25 …the secure element driver interface. Note that a test case may cover multiple requirements; for ex…
27 …rface unit tests could be covered by running the existing API tests with a key in a secure element.
34 * Make at least one failing call to `psa_register_se_driver` followed by a successful call.
39 For each API function that can lead to a driver call (more precisely, for each driver method call s…
41 * Make at least one test with a key in a secure element that checks that the driver method is calle…
42 * Make at least one test with a key that is not in a secure element that checks that the driver met…
43 * Make at least one test with a key in a secure element with a driver that does not have the requis…
44 * Make at least one test with a key in a secure element with a driver that does not have the substr…
45 …e drivers with a key in each driver and check that the expected driver is called. This does not ne…
[all …]
Dpsa-storage-format-testing.md5 The PSA crypto subsystem includes a persistent key store. It is possible to create a persistent key…
7a test strategy for the key store that not only validates that it's possible to load a key that wa…
9 Interoperability is not a goal: PSA crypto implementations are not intended to have compatible stor…
13 ### Limitations of a direct approach
15 The goal of storage format stability testing is: as a user of Mbed TLS, I want to store a key under…
19 …d reading it back under version W. Done naively, this would require keeping a large amount of test…
23a key is deterministic. Therefore we can ensure the stability of the storage format by creating te…
27 …es. When the test later runs under version W ≥ V, it creates and reads back a storage state which …
29 … that version W can read back what version V wrote. From the perspective of a particular version o…
31 Use a similar approach for files other than keys where possible and relevant.
[all …]
/mbedtls-latest/docs/architecture/psa-thread-safety/
Dpsa-thread-safety.md5 …s been implemented. Implementations which only ever call PSA functions from a single thread are no…
11 …- Key slots are protected by a global mutex, as described in [Key store consistency and abstractio…
37a system is thread-safe if any valid set of concurrent calls is handled as if the effect and retur…
47 There is no busy-waiting in our implementation, every API call completes in a finite number of step…
59 > * A call to `psa_destroy_key()` must not overlap with a concurrent call to any of the following f…
60 > - Any call where the same key identifier is a parameter to the call.
61 > - Any call in a multi-part operation, where the same key identifier was used as a parameter t…
69 …e: suppose two calls are executed concurrently which both attempt to create a new key with the sam…
74 > If the application concurrently modifies an input parameter while a function call is in progress,…
78 …from a single thread, or which protect all PSA calls using a mutex, are not affected by this new f…
[all …]
/mbedtls-latest/docs/
Dpsa-transition.md18 Then use the [summary of API modules](#summary-of-api-modules), the table of contents or a text sea…
24 …oftware.github.io/psa-api/crypto/) is available online. Mbed TLS implements a large subset of the …
36 …n the selected algorithm, whereas in the PSA API, all buffer arguments have a well-defined size an…
37a random generator argument where needed. This has historically been problematic with functions th…
41 * Mbed TLS 2.15.0 (Nov 2018): first release with a draft implementation of the PSA API.
55 By default, the PSA crypto API offers a similar set of cryptographic mechanisms as those offered by…
59 Applications only need to include a single header file:
70 The PSA subsystem has an internal random generator. As a consequence, you do not need to instantiat…
74 …ed TLS functions return a status of type `int`: 0 for success (or occasionally a positive value wh…
76a status of type [`psa_status_t`](https://mbed-tls.readthedocs.io/projects/api/en/development/api/…
[all …]
Dpsa-driver-example-and-guide.md3 …only been partially implemented. As a result, the deliverables for writing a driver and the method…
6a driver that can be used with Mbed TLS, and the PSA Driver [Integration](https://github.com/Mbed-…
12 [Example: Manually integrating a software accelerator alongside Mbed TLS](#example-manually-integra…
16a signature, are called *Single-Part Operations*. On the other hand, operations that consist of mu…
19a transparent driver is available for a particular combination of parameters (cryptographic algori…
20 …hat can only be used inside a protected environment such as a **secure element**, a hardware secur…
22a **driver dispatch layer** (also called a driver wrapper layer). For each cryptographic operation…
24 The long-term goal is for the driver dispatch layer to be auto-generated using a JSON driver descri…
41 There are three deliverables for creating such a driver. These are:
50a different process is followed where the developer manually edits the driver dispatch layer. The …
[all …]

123456789