Home
last modified time | relevance | path

Searched refs:state (Results 1 – 25 of 78) sorted by relevance

1234

/mbedtls-latest/library/
Dchacha20.c49 static inline void chacha20_quarter_round(uint32_t state[16], in chacha20_quarter_round()
56 state[a] += state[b]; in chacha20_quarter_round()
57 state[d] ^= state[a]; in chacha20_quarter_round()
58 state[d] = ROTL32(state[d], 16); in chacha20_quarter_round()
61 state[c] += state[d]; in chacha20_quarter_round()
62 state[b] ^= state[c]; in chacha20_quarter_round()
63 state[b] = ROTL32(state[b], 12); in chacha20_quarter_round()
66 state[a] += state[b]; in chacha20_quarter_round()
67 state[d] ^= state[a]; in chacha20_quarter_round()
68 state[d] = ROTL32(state[d], 8); in chacha20_quarter_round()
[all …]
Daesni.c91 __m128i state; in mbedtls_aesni_crypt_ecb() local
92 memcpy(&state, input, 16); in mbedtls_aesni_crypt_ecb()
93 state = _mm_xor_si128(state, rk[0]); // state ^= *rk; in mbedtls_aesni_crypt_ecb()
100 state = _mm_aesdec_si128(state, *rk); in mbedtls_aesni_crypt_ecb()
104 state = _mm_aesdeclast_si128(state, *rk); in mbedtls_aesni_crypt_ecb()
111 state = _mm_aesenc_si128(state, *rk); in mbedtls_aesni_crypt_ecb()
115 state = _mm_aesenclast_si128(state, *rk); in mbedtls_aesni_crypt_ecb()
118 memcpy(output, &state, 16); in mbedtls_aesni_crypt_ecb()
244 static __m128i aesni_set_rk_128(__m128i state, __m128i xword) in aesni_set_rk_128() argument
257 xword = _mm_xor_si128(xword, state); // X+r3:X+r2:X+r1:r4 in aesni_set_rk_128()
[all …]
Dcmac.c193 mbedtls_platform_zeroize(cmac_ctx->state, sizeof(cmac_ctx->state)); in mbedtls_cipher_cmac_starts()
202 unsigned char *state; in mbedtls_cipher_cmac_update() local
213 state = ctx->cmac_ctx->state; in mbedtls_cipher_cmac_update()
227 mbedtls_xor_no_simd(state, cmac_ctx->unprocessed_block, state, block_size); in mbedtls_cipher_cmac_update()
229 if ((ret = mbedtls_cipher_update(ctx, state, block_size, state, in mbedtls_cipher_cmac_update()
245 mbedtls_xor_no_simd(state, input, state, block_size); in mbedtls_cipher_cmac_update()
247 if ((ret = mbedtls_cipher_update(ctx, state, block_size, state, in mbedtls_cipher_cmac_update()
272 unsigned char *state, *last_block; in mbedtls_cipher_cmac_finish() local
287 state = cmac_ctx->state; in mbedtls_cipher_cmac_finish()
305 mbedtls_xor(state, M_last, state, block_size); in mbedtls_cipher_cmac_finish()
[all …]
Dsha256.c269 ctx->state[0] = 0x6A09E667; in mbedtls_sha256_starts()
270 ctx->state[1] = 0xBB67AE85; in mbedtls_sha256_starts()
271 ctx->state[2] = 0x3C6EF372; in mbedtls_sha256_starts()
272 ctx->state[3] = 0xA54FF53A; in mbedtls_sha256_starts()
273 ctx->state[4] = 0x510E527F; in mbedtls_sha256_starts()
274 ctx->state[5] = 0x9B05688C; in mbedtls_sha256_starts()
275 ctx->state[6] = 0x1F83D9AB; in mbedtls_sha256_starts()
276 ctx->state[7] = 0x5BE0CD19; in mbedtls_sha256_starts()
280 ctx->state[0] = 0xC1059ED8; in mbedtls_sha256_starts()
281 ctx->state[1] = 0x367CD507; in mbedtls_sha256_starts()
[all …]
Dsha512.c265 ctx->state[0] = UL64(0x6A09E667F3BCC908); in mbedtls_sha512_starts()
266 ctx->state[1] = UL64(0xBB67AE8584CAA73B); in mbedtls_sha512_starts()
267 ctx->state[2] = UL64(0x3C6EF372FE94F82B); in mbedtls_sha512_starts()
268 ctx->state[3] = UL64(0xA54FF53A5F1D36F1); in mbedtls_sha512_starts()
269 ctx->state[4] = UL64(0x510E527FADE682D1); in mbedtls_sha512_starts()
270 ctx->state[5] = UL64(0x9B05688C2B3E6C1F); in mbedtls_sha512_starts()
271 ctx->state[6] = UL64(0x1F83D9ABFB41BD6B); in mbedtls_sha512_starts()
272 ctx->state[7] = UL64(0x5BE0CD19137E2179); in mbedtls_sha512_starts()
276 ctx->state[0] = UL64(0xCBBB9D5DC1059ED8); in mbedtls_sha512_starts()
277 ctx->state[1] = UL64(0x629A292A367CD507); in mbedtls_sha512_starts()
[all …]
Dripemd160.c56 ctx->state[0] = 0x67452301; in mbedtls_ripemd160_starts()
57 ctx->state[1] = 0xEFCDAB89; in mbedtls_ripemd160_starts()
58 ctx->state[2] = 0x98BADCFE; in mbedtls_ripemd160_starts()
59 ctx->state[3] = 0x10325476; in mbedtls_ripemd160_starts()
60 ctx->state[4] = 0xC3D2E1F0; in mbedtls_ripemd160_starts()
93 local.A = local.Ap = ctx->state[0]; in mbedtls_internal_ripemd160_process()
94 local.B = local.Bp = ctx->state[1]; in mbedtls_internal_ripemd160_process()
95 local.C = local.Cp = ctx->state[2]; in mbedtls_internal_ripemd160_process()
96 local.D = local.Dp = ctx->state[3]; in mbedtls_internal_ripemd160_process()
97 local.E = local.Ep = ctx->state[4]; in mbedtls_internal_ripemd160_process()
[all …]
Dccm.c138 ctx->state |= CCM_STATE__ERROR; in mbedtls_ccm_crypt()
151 ctx->state = CCM_STATE__CLEAR; in mbedtls_ccm_clear_state()
168 if (!(ctx->state & CCM_STATE__STARTED) || !(ctx->state & CCM_STATE__LENGTHS_SET)) { in ccm_calculate_first_block_if_ready()
204 ctx->state |= CCM_STATE__ERROR; in ccm_calculate_first_block_if_ready()
215 ctx->state |= CCM_STATE__ERROR; in ccm_calculate_first_block_if_ready()
256 ctx->state |= CCM_STATE__STARTED; in mbedtls_ccm_starts()
285 ctx->state |= CCM_STATE__LENGTHS_SET; in mbedtls_ccm_set_lengths()
299 if (ctx->state & CCM_STATE__ERROR) { in mbedtls_ccm_update_ad()
304 if (ctx->state & CCM_STATE__AUTH_DATA_FINISHED) { in mbedtls_ccm_update_ad()
308 if (!(ctx->state & CCM_STATE__AUTH_DATA_STARTED)) { in mbedtls_ccm_update_ad()
[all …]
Dchachapoly.c76 ctx->state = CHACHAPOLY_STATE_INIT; in mbedtls_chachapoly_init()
90 ctx->state = CHACHAPOLY_STATE_INIT; in mbedtls_chachapoly_free()
134 ctx->state = CHACHAPOLY_STATE_AAD; in mbedtls_chachapoly_starts()
147 if (ctx->state != CHACHAPOLY_STATE_AAD) { in mbedtls_chachapoly_update_aad()
163 if ((ctx->state != CHACHAPOLY_STATE_AAD) && in mbedtls_chachapoly_update()
164 (ctx->state != CHACHAPOLY_STATE_CIPHERTEXT)) { in mbedtls_chachapoly_update()
168 if (ctx->state == CHACHAPOLY_STATE_AAD) { in mbedtls_chachapoly_update()
169 ctx->state = CHACHAPOLY_STATE_CIPHERTEXT; in mbedtls_chachapoly_update()
210 if (ctx->state == CHACHAPOLY_STATE_INIT) { in mbedtls_chachapoly_finish()
214 if (ctx->state == CHACHAPOLY_STATE_AAD) { in mbedtls_chachapoly_finish()
[all …]
Dmd5.c55 ctx->state[0] = 0x67452301; in mbedtls_md5_starts()
56 ctx->state[1] = 0xEFCDAB89; in mbedtls_md5_starts()
57 ctx->state[2] = 0x98BADCFE; in mbedtls_md5_starts()
58 ctx->state[3] = 0x10325476; in mbedtls_md5_starts()
98 local.A = ctx->state[0]; in mbedtls_internal_md5_process()
99 local.B = ctx->state[1]; in mbedtls_internal_md5_process()
100 local.C = ctx->state[2]; in mbedtls_internal_md5_process()
101 local.D = ctx->state[3]; in mbedtls_internal_md5_process()
187 ctx->state[0] += local.A; in mbedtls_internal_md5_process()
188 ctx->state[1] += local.B; in mbedtls_internal_md5_process()
[all …]
Dsha1.c55 ctx->state[0] = 0x67452301; in mbedtls_sha1_starts()
56 ctx->state[1] = 0xEFCDAB89; in mbedtls_sha1_starts()
57 ctx->state[2] = 0x98BADCFE; in mbedtls_sha1_starts()
58 ctx->state[3] = 0x10325476; in mbedtls_sha1_starts()
59 ctx->state[4] = 0xC3D2E1F0; in mbedtls_sha1_starts()
107 local.A = ctx->state[0]; in mbedtls_internal_sha1_process()
108 local.B = ctx->state[1]; in mbedtls_internal_sha1_process()
109 local.C = ctx->state[2]; in mbedtls_internal_sha1_process()
110 local.D = ctx->state[3]; in mbedtls_internal_sha1_process()
111 local.E = ctx->state[4]; in mbedtls_internal_sha1_process()
[all …]
Decdsa.c42 } state; member
52 ctx->state = ecdsa_ver_init; in ecdsa_restart_ver_init()
82 } state; member
94 ctx->state = ecdsa_sig_init; in ecdsa_restart_sig_init()
119 } state; member
128 ctx->state = ecdsa_det_init; in ecdsa_restart_det_init()
281 if (rs_ctx->sig->state == ecdsa_sig_mul) { in mbedtls_ecdsa_sign_restartable()
284 if (rs_ctx->sig->state == ecdsa_sig_modn) { in mbedtls_ecdsa_sign_restartable()
312 rs_ctx->sig->state = ecdsa_sig_mul; in mbedtls_ecdsa_sign_restartable()
326 rs_ctx->sig->state = ecdsa_sig_modn; in mbedtls_ecdsa_sign_restartable()
[all …]
Dssl_ticket.c312 unsigned char *state = state_len_bytes + TICKET_CRYPT_LEN_BYTES; in mbedtls_ssl_ticket_write() local
351 state, (size_t) (end - state), in mbedtls_ssl_ticket_write()
362 state, clear_len, in mbedtls_ssl_ticket_write()
363 state, end - state, in mbedtls_ssl_ticket_write()
373 state, clear_len, in mbedtls_ssl_ticket_write()
374 state, (size_t) (end - state), &ciph_len, in mbedtls_ssl_ticket_write()
Decp.c137 } state; member
149 ctx->state = ecp_rsm_init; in ecp_restart_rsm_init()
186 } state; member
196 ctx->state = ecp_rsma_mul1; in ecp_restart_ma_init()
1866 if (rs_ctx->rsm->state == ecp_rsm_pre_dbl) { in ecp_precompute_comb()
1869 if (rs_ctx->rsm->state == ecp_rsm_pre_norm_dbl) { in ecp_precompute_comb()
1872 if (rs_ctx->rsm->state == ecp_rsm_pre_add) { in ecp_precompute_comb()
1875 if (rs_ctx->rsm->state == ecp_rsm_pre_norm_add) { in ecp_precompute_comb()
1885 rs_ctx->rsm->state = ecp_rsm_pre_dbl; in ecp_precompute_comb()
1921 rs_ctx->rsm->state = ecp_rsm_pre_norm_dbl; in ecp_precompute_comb()
[all …]
Dpsa_crypto_slot_management.c397 slot->state == PSA_SLOT_FULL && in psa_get_and_lock_key_slot_in_memory()
411 if ((slot->state == PSA_SLOT_FULL) && in psa_get_and_lock_key_slot_in_memory()
475 if (slot->state == PSA_SLOT_EMPTY) { in psa_wipe_all_key_slots()
480 slot->state = PSA_SLOT_PENDING_DELETION; in psa_wipe_all_key_slots()
620 if (slot->state == PSA_SLOT_EMPTY) { in psa_reserve_free_key_slot()
626 (slot->state == PSA_SLOT_FULL) && in psa_reserve_free_key_slot()
896 if ((slot->state != PSA_SLOT_FULL) && in psa_unregister_read()
897 (slot->state != PSA_SLOT_PENDING_DELETION)) { in psa_unregister_read()
903 if ((slot->state == PSA_SLOT_PENDING_DELETION) && in psa_unregister_read()
1103 if (slot->state == PSA_SLOT_EMPTY) { in mbedtls_psa_get_stats()
Dpsa_crypto_slot_management.h209 if (slot->state != expected_state) { in psa_key_slot_state_transition()
212 slot->state = new_state; in psa_key_slot_state_transition()
232 if ((slot->state != PSA_SLOT_FULL) || in psa_register_read()
Dssl_tls12_client.c1166 ssl->state = MBEDTLS_SSL_CLIENT_HELLO; in ssl_parse_hello_verify_request()
1375 ssl->state++; in ssl_parse_server_hello()
1384 ssl->state = MBEDTLS_SSL_SERVER_CHANGE_CIPHER_SPEC; in ssl_parse_server_hello()
2094 ssl->state++; in ssl_parse_server_key_exchange()
2115 ssl->state++; in ssl_parse_server_key_exchange()
2457 ssl->state++; in ssl_parse_server_key_exchange()
2475 ssl->state++; in ssl_parse_certificate_request()
2502 ssl->state++; in ssl_parse_certificate_request()
2520 ssl->state++; in ssl_parse_certificate_request()
2691 ssl->state++; in ssl_parse_server_hello_done()
[all …]
/mbedtls-latest/tests/src/
Dthreading_helpers.c207 mutex->state = MUTEX_IDLE; in mbedtls_test_wrap_mutex_init()
220 switch (mutex->state) { in mbedtls_test_wrap_mutex_free()
225 mutex->state = MUTEX_FREED; in mbedtls_test_wrap_mutex_free()
252 switch (mutex->state) { in mbedtls_test_wrap_mutex_lock()
258 mutex->state = MUTEX_LOCKED; in mbedtls_test_wrap_mutex_lock()
283 switch (mutex->state) { in mbedtls_test_wrap_mutex_unlock()
291 mutex->state = MUTEX_IDLE; in mbedtls_test_wrap_mutex_unlock()
/mbedtls-latest/docs/architecture/
Dpsa-storage-resilience.md15state where the function has not started yet, or in a state where the function has returned. The a…
74 …fier _A_ used by the application interface. This step must not modify the state of the secure elem…
75 …t key identifier _A_ has the identifier _D_ in the driver, and that _A_ is in a half-created state.
78 6. The core updates the storage to indicate that _A_ is now in a fully created state. This conclude…
82 * Before step 3: the system state has not changed at all. As far as the world is concerned, the key…
83 … secure element completed step 5 or not, and reconcile the state of the storage with the state of …
95 * Before step 1: the system state has not changed at all. As far as the world is concerned, the key…
96 … secure element completed step 3 or not, and reconcile the state of the storage with the state of …
101 Note that the analysis in this section assumes that the driver does not update its persistent state
117state where file `id` does not exist, to a state where file `id` exists and has its desired final …
[all …]
Dtls13-support.md132 (1) These options must remain in their default state of enabled.
343 The TLS 1.3 handshake protocol is implemented as a state machine. The
346 possible states of the state machine.
353 given state to be duplicated across several state handlers. For example, on
360 and outbound keys are updated. The `MBEDTLS_SSL_CLIENT_CERTIFICATE` state on
377 * coordination stage: check if the state should be bypassed. This stage is
390 `MBEDTLS_ERR_SSL_WANT_READ` without changing the current state and it will be
409 * state change: the state change is done in the main state handler to ease the
410 navigation of the state machine transitions.
416 * coordination stage: check if the state should be bypassed. This stage is
[all …]
/mbedtls-latest/docs/architecture/testing/
Dpsa-storage-format-testing.md23state of the storage after the key is created. The test case creates a key as indicated by the par…
27 … version W ≥ V, it creates and reads back a storage state which is known to be identical to the st…
43 The PSA subsystem provides storage on top of the PSA trusted storage interface. The state of the st…
46 * The [random generator injected seed or state file](#random-generator-state) (`PSA_CRYPTO_ITS_RAND…
48 * [Driver state files](#driver-state-files).
109 ## Random generator state
113 ## Driver state files
/mbedtls-latest/tests/scripts/
Dcheck_names.py460 state = states.OUTSIDE_KEYWORD
467 if (state == states.OUTSIDE_KEYWORD and
471 state = states.IN_BRACES
472 elif (state == states.OUTSIDE_KEYWORD and
474 state = states.IN_BETWEEN
475 elif (state == states.IN_BETWEEN and
477 state = states.IN_BRACES
478 elif (state == states.IN_BRACES and
480 state = states.OUTSIDE_KEYWORD
481 elif (state == states.IN_BRACES and
/mbedtls-latest/docs/architecture/psa-thread-safety/
Dpsa-thread-safety.md26 * The [Testing and analysis](#testing-and-analysis) section discusses the state of our testing, as …
159 Each key slot has a state variable and a `registered_readers` counter. These two variables dictate …
163 …nformation is stored in the slot. Any thread is able to change the slot's state to `PSA_SLOT_FILLI…
164 …ead is responsible for the next state transition. Other threads cannot read the contents of a slot…
166 …e last unregister that the contents of the slot are wiped, and the slot's state is set to `PSA_SLO…
168 ###### Key slot state transition diagram
169 ![](key-slot-state-transitions.png)
171 In the state transition diagram above, an arrow between two states `q1` and `q2` with label `f` ind…
173 The state transition diagram can be generated in https://app.diagrams.net/ via this [url](https://v…
176state of a key slot is updated via the internal function `psa_key_slot_state_transition`. To chang…
[all …]
/mbedtls-latest/tests/suites/
Dtest_suite_psa_crypto_init.function59 fake_entropy_state_t *state = state_arg;
62 if (state->step >= state->max_steps) {
66 *olen = MIN(len, state->length_sequence[state->step]);
70 ++state->step;
168 /* Bad state due to entropy sources already being setup in
Dtest_suite_ssl.function991 /* Return to a valid state */
2530 void move_handshake_to_state(int endpoint_type, int tls_version, int state, int need_pass)
2581 state);
2586 TEST_ASSERT(base_ep.ssl.state == state);
2591 TEST_ASSERT(base_ep.ssl.state != state);
3996 * Go through the handshake sequence, state by state, checking the early
4000 int state = client_ep.ssl.state;
4002 /* Progress the handshake from at least one state */
4003 while (client_ep.ssl.state == state) {
4008 if (client_ep.ssl.state != state) {
[all …]
/mbedtls-latest/include/psa/
Dcrypto_builtin_key_derivation.h38 unsigned int MBEDTLS_PRIVATE(state) : 2;
76 psa_tls12_prf_key_derivation_state_t MBEDTLS_PRIVATE(state);
106 psa_pbkdf2_key_derivation_state_t MBEDTLS_PRIVATE(state);

1234