Home
last modified time | relevance | path

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

12345

/mbedtls-latest/programs/psa/
Dpsa_constant_names_generated.c90 static int psa_snprint_key_type(char *buffer, size_t buffer_size, in psa_snprint_key_type() argument
95 …case PSA_KEY_TYPE_AES: append(&buffer, buffer_size, &required_size, "PSA_KEY_TYPE_AES", 16); break; in psa_snprint_key_type()
96 …case PSA_KEY_TYPE_ARIA: append(&buffer, buffer_size, &required_size, "PSA_KEY_TYPE_ARIA", 17); bre… in psa_snprint_key_type()
97 …case PSA_KEY_TYPE_CAMELLIA: append(&buffer, buffer_size, &required_size, "PSA_KEY_TYPE_CAMELLIA", … in psa_snprint_key_type()
98 …case PSA_KEY_TYPE_CATEGORY_FLAG_PAIR: append(&buffer, buffer_size, &required_size, "PSA_KEY_TYPE_C… in psa_snprint_key_type()
99 …case PSA_KEY_TYPE_CATEGORY_KEY_PAIR: append(&buffer, buffer_size, &required_size, "PSA_KEY_TYPE_CA… in psa_snprint_key_type()
100 …case PSA_KEY_TYPE_CATEGORY_PUBLIC_KEY: append(&buffer, buffer_size, &required_size, "PSA_KEY_TYPE_… in psa_snprint_key_type()
101 …case PSA_KEY_TYPE_CATEGORY_RAW: append(&buffer, buffer_size, &required_size, "PSA_KEY_TYPE_CATEGOR… in psa_snprint_key_type()
102 …case PSA_KEY_TYPE_CATEGORY_SYMMETRIC: append(&buffer, buffer_size, &required_size, "PSA_KEY_TYPE_C… in psa_snprint_key_type()
103 …case PSA_KEY_TYPE_CHACHA20: append(&buffer, buffer_size, &required_size, "PSA_KEY_TYPE_CHACHA20", … in psa_snprint_key_type()
[all …]
Dpsa_constant_names.c43 static void append(char **buffer, size_t buffer_size, in append() argument
49 memcpy(*buffer, string, length); in append()
50 *buffer += length; in append()
54 static void append_integer(char **buffer, size_t buffer_size, in append_integer() argument
59 size_t n = snprintf(*buffer, buffer_size - *required_size, format, value); in append_integer()
61 *buffer += n; in append_integer()
71 static void append_with_curve(char **buffer, size_t buffer_size, in append_with_curve() argument
77 append(buffer, buffer_size, required_size, string, length); in append_with_curve()
78 append(buffer, buffer_size, required_size, "(", 1); in append_with_curve()
80 append(buffer, buffer_size, required_size, in append_with_curve()
[all …]
Dkey_ladder_demo.c358 unsigned char *buffer = NULL; in wrap_data() local
389 SYS_CHECK((buffer = calloc(1, buffer_size)) != NULL); in wrap_data()
390 SYS_CHECK(fread(buffer, 1, input_size, input_file) == input_size); in wrap_data()
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()
427 mbedtls_platform_zeroize(buffer, buffer_size); in wrap_data()
429 free(buffer); in wrap_data()
442 unsigned char *buffer = NULL; in unwrap_data() local
[all …]
/mbedtls-latest/tests/suites/
Dtest_suite_debug.function14 struct buffer_data *buffer = (struct buffer_data *) data;
15 char *p = buffer->ptr;
45 buffer->ptr = p;
60 struct buffer_data buffer;
66 memset(buffer.buf, 0, 2000);
67 buffer.ptr = buffer.buf;
75 mbedtls_ssl_conf_dbg(&conf, string_debug, &buffer);
84 TEST_ASSERT(strcmp(buffer.buf, result_str) == 0);
99 struct buffer_data buffer;
105 memset(buffer.buf, 0, 2000);
[all …]
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
13 PSA input buffer copy: zero-length both buffers
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
28 PSA output buffer copy: zero-length both buffers
[all …]
Dtest_suite_psa_crypto_memory.function14 /* Helper to fill a buffer with a data pattern. The pattern is not
17 static void fill_buffer_pattern(uint8_t *buffer, size_t len)
20 buffer[i] = (uint8_t) (i % 256);
47 /* Note: We compare the first src_len bytes of each buffer, as this is what was copied. */
74 /* Note: We compare the first src_len bytes of each buffer, as this is what was copied. */
91 local_input.buffer = NULL;
102 TEST_ASSERT(local_input.buffer != input);
105 local_input.buffer, local_input.length);
109 mbedtls_free(local_input.buffer);
119 local_input.buffer = NULL;
[all …]
Dtest_suite_psa_its.function92 unsigned char *buffer = NULL;
95 TEST_CALLOC(buffer, data->len);
102 PSA_ASSERT(psa_its_get(uid, 0, data->len, buffer, &ret_len));
103 TEST_MEMORY_COMPARE(data->x, data->len, buffer, ret_len);
108 mbedtls_free(buffer);
122 unsigned char *buffer = NULL;
125 TEST_CALLOC(buffer, MAX(data1->len, data2->len));
131 PSA_ASSERT(psa_its_get(uid, 0, data1->len, buffer, &ret_len));
132 TEST_MEMORY_COMPARE(data1->x, data1->len, buffer, ret_len);
139 PSA_ASSERT(psa_its_get(uid, 0, data2->len, buffer, &ret_len));
[all …]
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
28 Test case mbedtls_base64_encode #5 buffer just right
31 Test case mbedtls_base64_encode #5 buffer too small
34 Test case mbedtls_base64_encode #6 buffer just right
[all …]
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
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
Dtest_suite_psa_crypto_se_driver_hal.function682 uint8_t buffer[80]; /* large enough for a public key for ECDH */
689 buffer, sizeof(buffer), &length));
691 buffer, sizeof(buffer), &length));
712 buffer, sizeof(buffer),
714 buffer, sizeof(buffer),
715 buffer, sizeof(buffer), &length));
717 buffer, sizeof(buffer),
719 buffer, sizeof(buffer),
720 buffer, sizeof(buffer), &length));
723 buffer, 32,
[all …]
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)
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
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. */
Dtest_suite_psa_crypto_util.data5 ECDSA Raw -> DER, 256bit, DER buffer too small
67 ECDSA DER -> Raw, 256bit, Raw buffer too small
173 ECDSA Raw -> DER, 256bit, Incremental DER buffer sizes
177 ECDSA Raw -> DER, 512bit, Incremental DER buffer sizes
181 ECDSA Raw -> DER, 521bit, Incremental DER buffer sizes
185 ECDSA Raw -> DER, 256bit, DER buffer of minimal length (1 byte per integer)
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)
/mbedtls-latest/library/
Dpsa_crypto_pake.c312 operation->buffer, in mbedtls_psa_pake_output_internal()
313 sizeof(operation->buffer), in mbedtls_psa_pake_output_internal()
324 operation->buffer, in mbedtls_psa_pake_output_internal()
325 sizeof(operation->buffer), in mbedtls_psa_pake_output_internal()
354 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()
462 if (operation->buffer_length + input_length + 1 > sizeof(operation->buffer)) { in mbedtls_psa_pake_input_internal()
[all …]
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()
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 …]
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 …]
Dsha256.c668 memcpy((void *) (ctx->buffer + left), input, fill); in mbedtls_sha256_update()
670 if ((ret = mbedtls_internal_sha256_process(ctx, ctx->buffer)) != 0) { in mbedtls_sha256_update()
691 memcpy((void *) (ctx->buffer + left), input, ilen); in mbedtls_sha256_update()
713 ctx->buffer[used++] = 0x80; in mbedtls_sha256_finish()
717 memset(ctx->buffer + used, 0, 56 - used); in mbedtls_sha256_finish()
720 memset(ctx->buffer + used, 0, SHA256_BLOCK_SIZE - used); in mbedtls_sha256_finish()
722 if ((ret = mbedtls_internal_sha256_process(ctx, ctx->buffer)) != 0) { in mbedtls_sha256_finish()
726 memset(ctx->buffer, 0, 56); in mbedtls_sha256_finish()
736 MBEDTLS_PUT_UINT32_BE(high, ctx->buffer, 56); in mbedtls_sha256_finish()
737 MBEDTLS_PUT_UINT32_BE(low, ctx->buffer, 60); in mbedtls_sha256_finish()
[all …]
Dsha512.c782 memcpy((void *) (ctx->buffer + left), input, fill); in mbedtls_sha512_update()
784 if ((ret = mbedtls_internal_sha512_process(ctx, ctx->buffer)) != 0) { in mbedtls_sha512_update()
805 memcpy((void *) (ctx->buffer + left), input, ilen); in mbedtls_sha512_update()
827 ctx->buffer[used++] = 0x80; in mbedtls_sha512_finish()
831 memset(ctx->buffer + used, 0, 112 - used); in mbedtls_sha512_finish()
834 memset(ctx->buffer + used, 0, SHA512_BLOCK_SIZE - used); in mbedtls_sha512_finish()
836 if ((ret = mbedtls_internal_sha512_process(ctx, ctx->buffer)) != 0) { in mbedtls_sha512_finish()
840 memset(ctx->buffer, 0, 112); in mbedtls_sha512_finish()
850 sha512_put_uint64_be(high, ctx->buffer, 112); in mbedtls_sha512_finish()
851 sha512_put_uint64_be(low, ctx->buffer, 120); in mbedtls_sha512_finish()
[all …]
/mbedtls-latest/programs/aes/
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()
339 if (mbedtls_cipher_update(&cipher_ctx, buffer, ilen, output, &olen) != 0) { 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()
498 if (mbedtls_cipher_update(&cipher_ctx, buffer, ilen, output, in main()
[all …]
/mbedtls-latest/docs/architecture/
Dpsa-shared-memory.md6 …ess. On such systems, the untrusted process might access a shared memory buffer while the cryptogr…
13 …ns.html#input-buffer-sizes) and [output buffers](https://arm-software.github.io/psa-api/crypto/1.1…
25 …uted. A behavior that is only possible if an untrusted entity accesses a buffer while the crypto s…
45buffer. (This could be the length of the overall data, or the length of an embedded field) Later, …
47 …text input to `"PPPP"`, then starts the RPC call, then changes the input buffer to `"QQQQ"` while …
50 …xt before the client changes the output buffer and calculates the MAC after that change, reading t…
56 1. The crypto code writes some intermediate data into the output buffer.
60buffer, then applying the RSA private-key operation in place. (This is how `mbedtls_rsa_pkcs1_sign…
62 …nt shares an output buffer for the signature with the attestation application, and the attestation…
68 1. The crypto code writes some intermediate data into the output buffer. This intermediate data mus…
[all …]
/mbedtls-latest/docs/
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);

12345