Home
last modified time | relevance | path

Searched refs:buffer (Results 1 – 25 of 116) sorted by relevance

12345

/mbedtls/programs/psa/
A Dpsa_constant_names_generated.c138 return snprintf(buffer, buffer_size, in psa_snprint_key_type()
143 buffer[0] = 0; in psa_snprint_key_type()
157 append(&buffer, buffer_size, &required_size, in psa_snprint_algorithm()
161 append(&buffer, buffer_size, &required_size, in psa_snprint_algorithm()
171 append(&buffer, buffer_size, &required_size, in psa_snprint_algorithm()
182 append(&buffer, buffer_size, &required_size, in psa_snprint_algorithm()
375 buffer[0] = 0; in psa_snprint_algorithm()
385 buffer[0] = '0'; in psa_snprint_key_usage()
386 buffer[1] = 0; in psa_snprint_key_usage()
388 buffer[0] = 0; in psa_snprint_key_usage()
[all …]
A Dpsa_constant_names.c50 *buffer += length; in append()
61 *buffer += n; in append_integer()
198 char buffer[200]; in process_signed() local
216 psa_snprint_status(buffer, sizeof(buffer), in process_signed()
220 puts(buffer); in process_signed()
251 psa_snprint_algorithm(buffer, sizeof(buffer), in process_unsigned()
255 psa_snprint_ecc_curve(buffer, sizeof(buffer), in process_unsigned()
259 psa_snprint_dh_group(buffer, sizeof(buffer), in process_unsigned()
263 psa_snprint_key_type(buffer, sizeof(buffer), in process_unsigned()
267 psa_snprint_key_usage(buffer, sizeof(buffer), in process_unsigned()
[all …]
A Dkey_ladder_demo.c358 unsigned char *buffer = NULL; in wrap_data() local
404 buffer, input_size, in wrap_data()
405 buffer, buffer_size, in wrap_data()
414 SYS_CHECK(fwrite(buffer, 1, ciphertext_size, in wrap_data()
426 if (buffer != NULL) { in wrap_data()
429 free(buffer); in wrap_data()
442 unsigned char *buffer = NULL; in unwrap_data() local
478 SYS_CHECK(fread(buffer, 1, ciphertext_size, in unwrap_data()
505 SYS_CHECK(fwrite(buffer, 1, plaintext_size, in unwrap_data()
517 if (buffer != NULL) { in unwrap_data()
[all …]
/mbedtls/tests/suites/
A Dtest_suite_psa_crypto_memory.data1 PSA input buffer copy: straightforward copy
4 PSA input buffer copy: copy buffer larger than required
7 PSA input buffer copy: copy buffer too small
10 PSA input buffer copy: zero-length source buffer
16 PSA output buffer copy: straightforward copy
19 PSA output buffer copy: output buffer larger than required
22 PSA output buffer copy: output buffer too small
25 PSA output buffer copy: zero-length source buffer
34 PSA crypto local input alloc, NULL buffer
40 PSA crypto local input free, NULL buffer
[all …]
A Dtest_suite_debug.function15 char *p = buffer->ptr;
45 buffer->ptr = p;
60 struct buffer_data buffer;
66 memset(buffer.buf, 0, 2000);
67 buffer.ptr = buffer.buf;
99 struct buffer_data buffer;
106 buffer.ptr = buffer.buf;
135 struct buffer_data buffer;
142 buffer.ptr = buffer.buf;
180 buffer.ptr = buffer.buf;
[all …]
A Dtest_suite_psa_crypto_memory.function20 buffer[i] = (uint8_t) (i % 256);
91 local_input.buffer = NULL;
109 mbedtls_free(local_input.buffer);
119 local_input.buffer = NULL;
125 TEST_ASSERT(local_input.buffer == NULL);
129 mbedtls_free(local_input.buffer);
130 local_input.buffer = NULL;
165 local_output.buffer = NULL;
178 mbedtls_free(local_output.buffer);
180 local_output.buffer = NULL;
[all …]
A Dtest_suite_memory_buffer_alloc.data1 Memory buffer alloc self test
4 Memory buffer alloc - free in middle, alloc at end
7 Memory buffer alloc - free in middle, realloc
10 Memory buffer alloc - free in middle, merge, realloc
13 Memory buffer alloc - free at end, merge, realloc
16 Memory buffer alloc - Out of Memory test
19 Memory buffer: heap too small (header verification should fail)
22 Memory buffer: attempt to allocate SIZE_MAX
A Dtest_suite_psa_its.function92 unsigned char *buffer = NULL;
95 TEST_CALLOC(buffer, data->len);
108 mbedtls_free(buffer);
122 unsigned char *buffer = NULL;
145 mbedtls_free(buffer);
210 unsigned char *buffer = NULL;
217 TEST_CALLOC(buffer, length + 16);
218 trailer = buffer + length;
235 mbedtls_free(buffer);
246 unsigned char *buffer = NULL;
[all …]
A Dtest_suite_base64.data7 Test case mbedtls_base64_encode #1 buffer just right
10 Test case mbedtls_base64_encode #2 buffer just right
13 Test case mbedtls_base64_encode #2 buffer too small
16 Test case mbedtls_base64_encode #3 buffer just right
19 Test case mbedtls_base64_encode #3 buffer too small
22 Test case mbedtls_base64_encode #4 buffer just right
25 Test case mbedtls_base64_encode #4 buffer too small
31 Test case mbedtls_base64_encode #5 buffer too small
151 Base64 encode hex #2 (buffer too small)
177 Base64 decode hex #2 (buffer too small)
[all …]
A Dtest_suite_hmac_drbg.misc.data109 HMAC_DRBG from buffer SHA-1
113 HMAC_DRBG from buffer SHA-224
117 HMAC_DRBG from buffer SHA-256
121 HMAC_DRBG from buffer SHA-384
125 HMAC_DRBG from buffer SHA-512
129 HMAC_DRBG from buffer SHA3-224
133 HMAC_DRBG from buffer SHA3-256
137 HMAC_DRBG from buffer SHA3-384
141 HMAC_DRBG from buffer SHA3-512
A Dtest_suite_psa_crypto_se_driver_hal.function676 buffer, sizeof(buffer), &length));
699 buffer, sizeof(buffer),
701 buffer, sizeof(buffer),
702 buffer, sizeof(buffer), &length));
704 buffer, sizeof(buffer),
706 buffer, sizeof(buffer),
707 buffer, sizeof(buffer), &length));
711 buffer, sizeof(buffer), &length));
714 buffer, sizeof(buffer)));
737 if (psa_export_public_key(key, buffer, sizeof(buffer), &length) ==
[all …]
A Dtest_suite_bignum_mod_raw.data25 Test mbedtls_mpi_mod_raw_io #5 BE (Extra limbs, buffer aligned to extra limbs, input limb-aligned)
28 Test mbedtls_mpi_mod_raw_io #5 LE (Extra limbs, buffer aligned to extra limbs, input limb-aligned)
31 Test mbedtls_mpi_mod_raw_io #6 BE (Extra limbs, buffer aligned to extra limbs, input unaligned)
34 Test mbedtls_mpi_mod_raw_io #6 LE (Extra limbs, buffer aligned to extra limbs, input unaligned)
119 Test mbedtls_mpi_mod_raw_io #19 BE (buffer too small, input limb-aligned)
122 Test mbedtls_mpi_mod_raw_io #19 LE (buffer too small, input limb-aligned)
125 Test mbedtls_mpi_mod_raw_io #20 BE (buffer too small, input unaligned)
128 Test mbedtls_mpi_mod_raw_io #20 LE (buffer too small, input unaligned)
A Dtest_suite_pkcs1_v15.data4 RSAES-V15 Decryption empty output with NULL buffer
55 RSAES-V15 decoding: good, payload=max, tight output buffer
58 RSAES-V15 decoding: good, payload=max, larger output buffer
61 RSAES-V15 decoding: good, payload=max-1, tight output buffer
64 RSAES-V15 decoding: good, payload=max-1, larger output buffer
A Dtest_suite_psa_crypto_util.data5 ECDSA Raw -> DER, 256bit, DER buffer too small
57 ECDSA DER -> Raw, 256bit, Raw buffer too small
153 ECDSA Raw -> DER, 256bit, Incremental DER buffer sizes
157 ECDSA Raw -> DER, 512bit, Incremental DER buffer sizes
161 ECDSA Raw -> DER, 521bit, Incremental DER buffer sizes
165 ECDSA Raw -> DER, 256bit, DER buffer of minimal length (1 byte per integer)
A Dtest_suite_psa_crypto_low_hash.function43 /* Larger output buffer */
53 /* We don't test with a smaller output buffer because this isn't
55 * output buffer to the driver. */
130 /* Larger output buffer */
142 /* We don't test with a smaller output buffer because this isn't
144 * output buffer to the driver. */
A Dtest_suite_bignum_core.misc.data16 Test mbedtls_mpi_core_io_be #5 (Extra limbs, buffer aligned to extra limbs, input limb-aligned)
19 Test mbedtls_mpi_core_io_be #6 (Extra limbs, buffer aligned to extra limbs, input unaligned)
60 Test mbedtls_mpi_core_io_be #19 (buffer too small, input limb-aligned)
63 Test mbedtls_mpi_core_io_be #20 (buffer too small, input unaligned)
81 Test mbedtls_mpi_core_io_le #5 (Extra limbs, buffer aligned to extra limbs, input limb-aligned)
84 Test mbedtls_mpi_core_io_le #6 (Extra limbs, buffer aligned to extra limbs, input unaligned)
125 Test mbedtls_mpi_core_io_le #19 (buffer too small, input limb-aligned)
128 Test mbedtls_mpi_core_io_le #20 (buffer too small, input unaligned)
A Dtest_suite_psa_crypto_util.function34 /* Test with an output buffer smaller than required (expexted to fail). */
42 /* Test with an output buffer larger/equal than required (expexted to
70 /* We alloc a copy of input buffer with limited length so that sanitizers
/mbedtls/library/
A Dpsa_crypto_pake.c354 length = operation->buffer[operation->buffer_offset]; in mbedtls_psa_pake_output_internal()
366 operation->buffer + operation->buffer_offset, in mbedtls_psa_pake_output_internal()
375 mbedtls_platform_zeroize(operation->buffer, sizeof(operation->buffer)); in mbedtls_psa_pake_output_internal()
448 sizeof(operation->buffer)) { in mbedtls_psa_pake_input_internal()
452 memcpy(operation->buffer + operation->buffer_length, in mbedtls_psa_pake_input_internal()
471 memcpy(operation->buffer + operation->buffer_length, in mbedtls_psa_pake_input_internal()
478 operation->buffer, in mbedtls_psa_pake_input_internal()
481 mbedtls_platform_zeroize(operation->buffer, sizeof(operation->buffer)); in mbedtls_psa_pake_input_internal()
489 operation->buffer, in mbedtls_psa_pake_input_internal()
492 mbedtls_platform_zeroize(operation->buffer, sizeof(operation->buffer)); in mbedtls_psa_pake_input_internal()
[all …]
A Dbase64.c258 unsigned char buffer[128]; in mbedtls_base64_self_test() local
266 if (mbedtls_base64_encode(buffer, sizeof(buffer), &len, src, 64) != 0 || in mbedtls_base64_self_test()
267 memcmp(base64_test_enc, buffer, 88) != 0) { in mbedtls_base64_self_test()
281 if (mbedtls_base64_decode(buffer, sizeof(buffer), &len, src, 88) != 0 || in mbedtls_base64_self_test()
282 memcmp(base64_test_dec, buffer, 64) != 0) { in mbedtls_base64_self_test()
A Dmd5.c226 memcpy((void *) (ctx->buffer + left), input, fill); in mbedtls_md5_update()
227 if ((ret = mbedtls_internal_md5_process(ctx, ctx->buffer)) != 0) { in mbedtls_md5_update()
246 memcpy((void *) (ctx->buffer + left), input, ilen); in mbedtls_md5_update()
267 ctx->buffer[used++] = 0x80; in mbedtls_md5_finish()
271 memset(ctx->buffer + used, 0, 56 - used); in mbedtls_md5_finish()
274 memset(ctx->buffer + used, 0, 64 - used); in mbedtls_md5_finish()
276 if ((ret = mbedtls_internal_md5_process(ctx, ctx->buffer)) != 0) { in mbedtls_md5_finish()
280 memset(ctx->buffer, 0, 56); in mbedtls_md5_finish()
290 MBEDTLS_PUT_UINT32_LE(low, ctx->buffer, 56); in mbedtls_md5_finish()
291 MBEDTLS_PUT_UINT32_LE(high, ctx->buffer, 60); in mbedtls_md5_finish()
[all …]
A Dsha1.c261 memcpy((void *) (ctx->buffer + left), input, fill); in mbedtls_sha1_update()
263 if ((ret = mbedtls_internal_sha1_process(ctx, ctx->buffer)) != 0) { in mbedtls_sha1_update()
282 memcpy((void *) (ctx->buffer + left), input, ilen); in mbedtls_sha1_update()
303 ctx->buffer[used++] = 0x80; in mbedtls_sha1_finish()
307 memset(ctx->buffer + used, 0, 56 - used); in mbedtls_sha1_finish()
310 memset(ctx->buffer + used, 0, 64 - used); in mbedtls_sha1_finish()
312 if ((ret = mbedtls_internal_sha1_process(ctx, ctx->buffer)) != 0) { in mbedtls_sha1_finish()
316 memset(ctx->buffer, 0, 56); in mbedtls_sha1_finish()
326 MBEDTLS_PUT_UINT32_BE(high, ctx->buffer, 56); in mbedtls_sha1_finish()
327 MBEDTLS_PUT_UINT32_BE(low, ctx->buffer, 60); in mbedtls_sha1_finish()
[all …]
A Dsha256.c664 memcpy((void *) (ctx->buffer + left), input, fill); in mbedtls_sha256_update()
666 if ((ret = mbedtls_internal_sha256_process(ctx, ctx->buffer)) != 0) { in mbedtls_sha256_update()
687 memcpy((void *) (ctx->buffer + left), input, ilen); in mbedtls_sha256_update()
709 ctx->buffer[used++] = 0x80; in mbedtls_sha256_finish()
713 memset(ctx->buffer + used, 0, 56 - used); in mbedtls_sha256_finish()
716 memset(ctx->buffer + used, 0, SHA256_BLOCK_SIZE - used); in mbedtls_sha256_finish()
718 if ((ret = mbedtls_internal_sha256_process(ctx, ctx->buffer)) != 0) { in mbedtls_sha256_finish()
722 memset(ctx->buffer, 0, 56); in mbedtls_sha256_finish()
732 MBEDTLS_PUT_UINT32_BE(high, ctx->buffer, 56); in mbedtls_sha256_finish()
733 MBEDTLS_PUT_UINT32_BE(low, ctx->buffer, 60); in mbedtls_sha256_finish()
[all …]
/mbedtls/programs/aes/
A Dcrypt_and_hash.c71 unsigned char buffer[1024]; in main() local
242 buffer[i] = (unsigned char) (filesize >> (i << 3)); in main()
251 if (mbedtls_md_update(&md_ctx, buffer, 8) != 0) { in main()
334 if (fread(buffer, 1, ilen, fin) != ilen) { in main()
425 if (fread(buffer, 1, 16, fin) != 16) { in main()
430 memcpy(IV, buffer, 16); in main()
488 if (fread(buffer, 1, ilen, fin) != ilen) { in main()
494 if (mbedtls_md_hmac_update(&md_ctx, buffer, ilen) != 0) { in main()
518 if (fread(buffer, 1, md_size, fin) != md_size) { in main()
526 diff |= digest[i] ^ buffer[i]; in main()
[all …]
/mbedtls/docs/architecture/
A Dpsa-shared-memory.md56 1. The crypto code writes some intermediate data into the output buffer.
269 ##### 1. Allocate a buffer and copy input on each call to `update()`
435 2. Leak the start and end address of each buffer via `print()`.
436 3. Write data into the input buffer exactly once.
438 5. Read data from the output buffer exactly once.
531 uint8_t *buffer;
537 uint8_t *buffer;
566 …ntents of the output buffer `local_output->buffer` into the buffer `local_output->original`, calls…
629 This should poison or unpoison the given buffer, respectively.
680 * Read its input buffer and after calling the input-buffer-copying function to create a local copy …
[all …]
/mbedtls/docs/
A Dtls13-early-data.md5 An application function to write and send a buffer of data to a server through
34 buffer and data_to_write_len the number of data bytes. The handshake may
77 All together, code to write and send a buffer of data as long as possible as
103 code to write and send a buffer of data could plausibly look like:
177 buffer + data_read_len,
178 sizeof(buffer) - data_read_len);

Completed in 28 milliseconds

12345