Home
last modified time | relevance | path

Searched refs:offset (Results 1 – 25 of 34) sorted by relevance

12

/mbedtls-latest/library/
Dalignment.h412 #define MBEDTLS_GET_UINT32_BE(data, offset) \ argument
414 ? mbedtls_get_unaligned_uint32((data) + (offset)) \
415 : MBEDTLS_BSWAP32(mbedtls_get_unaligned_uint32((data) + (offset))) \
427 #define MBEDTLS_PUT_UINT32_BE(n, data, offset) \ argument
431 mbedtls_put_unaligned_uint32((data) + (offset), (uint32_t) (n)); \
435 mbedtls_put_unaligned_uint32((data) + (offset), MBEDTLS_BSWAP32((uint32_t) (n))); \
448 #define MBEDTLS_GET_UINT32_LE(data, offset) \ argument
450 ? MBEDTLS_BSWAP32(mbedtls_get_unaligned_uint32((data) + (offset))) \
451 : mbedtls_get_unaligned_uint32((data) + (offset)) \
464 #define MBEDTLS_PUT_UINT32_LE(n, data, offset) \ argument
[all …]
Dccm.c124 size_t offset, size_t use_len, in mbedtls_ccm_crypt() argument
143 mbedtls_xor(output, input, tmp_buf + offset, use_len); in mbedtls_ccm_crypt()
294 size_t use_len, offset; in mbedtls_ccm_update_ad() local
322 offset = (ctx->processed + 2) % 16; /* account for y[0] and y[1] in mbedtls_ccm_update_ad()
324 use_len = 16 - offset; in mbedtls_ccm_update_ad()
330 mbedtls_xor(ctx->y + offset, ctx->y + offset, add, use_len); in mbedtls_ccm_update_ad()
336 if (use_len + offset == 16 || ctx->processed == ctx->add_len) { in mbedtls_ccm_update_ad()
365 size_t use_len, offset; in mbedtls_ccm_update() local
391 offset = ctx->processed % 16; in mbedtls_ccm_update()
393 use_len = 16 - offset; in mbedtls_ccm_update()
[all …]
Dchacha20.c135 size_t offset = i * 4U; in chacha20_block() local
137 MBEDTLS_PUT_UINT32_LE(working_state[i], keystream, offset); in chacha20_block()
206 size_t offset = 0U; in mbedtls_chacha20_update() local
210 output[offset] = input[offset] in mbedtls_chacha20_update()
214 offset++; in mbedtls_chacha20_update()
224 mbedtls_xor(output + offset, input + offset, ctx->keystream8, 64U); in mbedtls_chacha20_update()
226 offset += CHACHA20_BLOCK_SIZE_BYTES; in mbedtls_chacha20_update()
236 mbedtls_xor(output + offset, input + offset, ctx->keystream8, size); in mbedtls_chacha20_update()
Dgcm.c471 size_t use_len, offset; in mbedtls_gcm_update_ad() local
486 offset = ctx->add_len % 16; in mbedtls_gcm_update_ad()
489 if (offset != 0) { in mbedtls_gcm_update_ad()
490 use_len = 16 - offset; in mbedtls_gcm_update_ad()
495 mbedtls_xor(ctx->buf + offset, ctx->buf + offset, p, use_len); in mbedtls_gcm_update_ad()
497 if (offset + use_len == 16) { in mbedtls_gcm_update_ad()
536 size_t offset, size_t use_len, in gcm_mask() argument
554 mbedtls_xor(ctx->buf + offset, ctx->buf + offset, input, use_len); in gcm_mask()
556 mbedtls_xor(output, ectr + offset, input, use_len); in gcm_mask()
558 mbedtls_xor(ctx->buf + offset, ctx->buf + offset, output, use_len); in gcm_mask()
[all …]
Dpoly1305.c73 size_t offset = 0U; in poly1305_process() local
94 d0 = MBEDTLS_GET_UINT32_LE(input, offset + 0); in poly1305_process()
95 d1 = MBEDTLS_GET_UINT32_LE(input, offset + 4); in poly1305_process()
96 d2 = MBEDTLS_GET_UINT32_LE(input, offset + 8); in poly1305_process()
97 d3 = MBEDTLS_GET_UINT32_LE(input, offset + 12); in poly1305_process()
154 offset += POLY1305_BLOCK_SIZE_BYTES; in poly1305_process()
274 size_t offset = 0U; in mbedtls_poly1305_update() local
303 offset += queue_free_len; in mbedtls_poly1305_update()
311 poly1305_process(ctx, nblocks, &input[offset], 1U); in mbedtls_poly1305_update()
313 offset += nblocks * POLY1305_BLOCK_SIZE_BYTES; in mbedtls_poly1305_update()
[all …]
Dssl_msg.c98 size_t offset; in mbedtls_ct_hmac() local
140 for (offset = min_data_len; offset <= max_data_len; offset++) { in mbedtls_ct_hmac()
145 mbedtls_ct_memcpy_if(mbedtls_ct_uint_eq(offset, data_len_secret), in mbedtls_ct_hmac()
148 if (offset < max_data_len) { in mbedtls_ct_hmac()
149 PSA_CHK(psa_hash_update(&operation, data + offset, 1)); in mbedtls_ct_hmac()
218 size_t offset; in mbedtls_ct_hmac() local
244 for (offset = min_data_len; offset <= max_data_len; offset++) { in mbedtls_ct_hmac()
248 mbedtls_ct_memcpy_if(mbedtls_ct_uint_eq(offset, data_len_secret), in mbedtls_ct_hmac()
251 if (offset < max_data_len) { in mbedtls_ct_hmac()
252 MD_CHK(mbedtls_md_update(ctx, data + offset, 1)); in mbedtls_ct_hmac()
[all …]
Dconstant_time.c151 void mbedtls_ct_memmove_left(void *start, size_t total, size_t offset) in mbedtls_ct_memmove_left() argument
155 mbedtls_ct_condition_t no_op = mbedtls_ct_uint_gt(total - offset, i); in mbedtls_ct_memmove_left()
217 size_t offset, in mbedtls_ct_memcpy_offset() argument
225 mbedtls_ct_memcpy_if(mbedtls_ct_uint_eq(offsetval, offset), dest, src + offsetval, NULL, in mbedtls_ct_memcpy_offset()
Dconstant_time_internal.h467 size_t offset);
533 size_t offset,
Daes.c1447 size_t offset = *nc_off; in mbedtls_aes_crypt_ctr() local
1449 if (offset > 0x0F) { in mbedtls_aes_crypt_ctr()
1455 if (offset == 0) { in mbedtls_aes_crypt_ctr()
1462 n -= offset; in mbedtls_aes_crypt_ctr()
1468 mbedtls_xor(&output[i], &input[i], &stream_block[offset], n); in mbedtls_aes_crypt_ctr()
1470 offset = 0; in mbedtls_aes_crypt_ctr()
1833 size_t offset; in mbedtls_aes_self_test() local
2048 offset = 0; in mbedtls_aes_self_test()
2070 ret = mbedtls_aes_crypt_cfb128(&ctx, mode, 64, &offset, iv, buf, buf); in mbedtls_aes_self_test()
2112 offset = 0; in mbedtls_aes_self_test()
[all …]
Dcamellia.c873 size_t offset, len; in mbedtls_camellia_self_test() local
1008 offset = 0; in mbedtls_camellia_self_test()
1015 mbedtls_camellia_crypt_ctr(&ctx, len, &offset, nonce_counter, stream_block, in mbedtls_camellia_self_test()
1028 mbedtls_camellia_crypt_ctr(&ctx, len, &offset, nonce_counter, stream_block, in mbedtls_camellia_self_test()
Dssl_tls12_client.c1913 size_t offset, size_t *olen, in ssl_write_encrypted_pms() argument
1921 if (offset + len_bytes > MBEDTLS_SSL_OUT_CONTENT_LEN) { in ssl_write_encrypted_pms()
1964 ssl->out_msg + offset + len_bytes, olen, in ssl_write_encrypted_pms()
1965 MBEDTLS_SSL_OUT_CONTENT_LEN - offset - len_bytes, in ssl_write_encrypted_pms()
1972 MBEDTLS_PUT_UINT16_BE(*olen, ssl->out_msg, offset); in ssl_write_encrypted_pms()
3245 size_t n = 0, offset = 0; in ssl_write_certificate_verify() local
3333 offset = 2; in ssl_write_certificate_verify()
3343 ssl->out_msg + 6 + offset, in ssl_write_certificate_verify()
3344 out_buf_len - 6 - offset, in ssl_write_certificate_verify()
3356 MBEDTLS_PUT_UINT16_BE(n, ssl->out_msg, offset + 4); in ssl_write_certificate_verify()
[all …]
/mbedtls-latest/tests/suites/
Dtest_suite_alignment.data10 Unaligned 16-bit access offset=1
13 Unaligned 32-bit access offset=1
16 Unaligned 64-bit access offset=1
19 Unaligned 16-bit access offset=4
22 Unaligned 32-bit access offset=4
25 Unaligned 64-bit access offset=4
28 Unaligned 16-bit access offset=7
31 Unaligned 32-bit access offset=7
34 Unaligned 64-bit access offset=7
37 Unaligned 16-bit access offset=8
[all …]
Dtest_suite_constant_time.function216 for (size_t offset = 0; offset < size; offset++) {
218 /* Set a single bit to be different at given offset, to test that we
220 a[offset] = 1 << bit_offset;
231 a[offset] = 0;
243 void mbedtls_ct_memcmp(int same, int size, int offset)
246 TEST_CALLOC(a, size + offset);
247 TEST_CALLOC(b, size + offset);
250 * same gives the number of bytes (after the initial offset)
253 for (int i = 0; i < size + offset; i++) {
255 if (same == -1 || (i - offset) < same) {
[all …]
Dtest_suite_alignment.function31 void mbedtls_unaligned_access(int size, int offset)
47 r = mbedtls_get_unaligned_uint16(x + offset);
50 r = mbedtls_get_unaligned_uint32(x + offset);
53 r = mbedtls_get_unaligned_uint64(x + offset);
62 memcpy(&raw_aligned_64, ((uint8_t *) &raw) + offset, size / 8);
81 x[i + offset] = 0xff;
89 mbedtls_put_unaligned_uint16(x + offset, r);
92 mbedtls_put_unaligned_uint32(x + offset, r);
95 mbedtls_put_unaligned_uint64(x + offset, r);
243 void unaligned_access_endian_aware(int size, int offset, int big_endian)
[all …]
Dtest_suite_constant_time.data2 Constant-flow memcpy from offset: small
6 Constant-flow memcpy from offset: medium
10 Constant-flow memcpy from offset: large
55 mbedtls_ct_memcmp len 1 offset 1 different
58 mbedtls_ct_memcmp len 17 offset 1 different
61 mbedtls_ct_memcmp len 17 offset 1 different 1
64 mbedtls_ct_memcmp len 17 offset 1 different 5
67 mbedtls_ct_memcmp len 1 offset 1
70 mbedtls_ct_memcmp len 1 offset 2
73 mbedtls_ct_memcmp len 1 offset 3
[all …]
Dtest_suite_test_helpers.data1 Memory poison+unpoison: offset=0 len=42
4 Memory poison+unpoison: offset=0 len=1
7 Memory poison+unpoison: offset=0 len=2
10 Memory poison+unpoison: offset=1 len=1
13 Memory poison+unpoison: offset=1 len=2
16 Memory poison+unpoison: offset=7 len=1
19 Memory poison+unpoison: offset=7 len=2
22 Memory poison+unpoison: offset=0 len=0
Dtest_suite_dhm.function27 size_t *offset)
36 TEST_ASSERT(size >= *offset + 2);
37 n = (buffer[*offset] << 8) | buffer[*offset + 1];
38 *offset += 2;
42 TEST_ASSERT(size >= *offset + n);
43 TEST_EQUAL(0, mbedtls_mpi_read_binary(&actual, buffer + *offset, n));
45 *offset += n;
59 size_t offset = 0;
70 if (!check_dhm_param_output(&ctx->P, ske, ske_len, &offset)) {
73 if (!check_dhm_param_output(&ctx->G, ske, ske_len, &offset)) {
[all …]
Dtest_suite_asn1parse.function186 size_t offset;
191 offset = content - state->input_start;
192 mbedtls_test_set_step(offset);
198 TEST_EQUAL(n, offset);
566 * two integers: the offset of the element (offset from the start
624 * three integers: the offset of the element's content (offset from
Dtest_suite_psa_its.function206 int offset, int length_arg,
223 status = psa_its_get(uid, offset, length_arg, buffer, &ret_len);
226 TEST_MEMORY_COMPARE(data->x + offset, (size_t) length_arg,
Dtest_suite_ssl.function1364 * to succeed starting from some offset. Always keep
1368 * to succeed starting from some offset. Always keep
1373 * some offset.
1388 size_t offset; /* Available space at beginning/end/both */
1389 size_t threshold = 96; /* Maximum offset to test against */
1413 for (offset = 0; offset <= threshold; offset++) {
1418 memset(rec.ctr, offset, sizeof(rec.ctr));
1420 rec.ver[0] = offset;
1421 rec.ver[1] = offset;
1430 rec.data_offset = offset;
[all …]
/mbedtls-latest/programs/aes/
Dcrypt_and_hash.c83 long filesize, offset; in main() local
86 __int64 filesize, offset; in main() local
88 off_t filesize, offset; in main() local
330 for (offset = 0; offset < filesize; offset += cipher_block_size) { in main()
331 ilen = ((unsigned int) filesize - offset > cipher_block_size) ? in main()
332 cipher_block_size : (unsigned int) (filesize - offset); in main()
484 for (offset = 0; offset < filesize; offset += cipher_block_size) { in main()
485 ilen = ((unsigned int) filesize - offset > cipher_block_size) ? in main()
486 cipher_block_size : (unsigned int) (filesize - offset); in main()
/mbedtls-latest/programs/test/
Dmetatest.c201 size_t start = 0, offset = 0, count = 0; in test_memory_poison() local
208 &start, &offset, &count, &direction) != 4) { in test_memory_poison()
233 if (offset >= count) { in test_memory_poison()
237 __func__, offset, count); in test_memory_poison()
244 aligned.buf[start + offset] = 'b'; in test_memory_poison()
248 mbedtls_printf("%u\n", (unsigned) aligned.buf[start + offset]); in test_memory_poison()
Dudp_proxy.c636 uint8_t offset; in send_delayed() local
638 for (offset = 0; offset < prev_len; offset++) { in send_delayed()
639 ret = send_packet(&prev[offset], "delayed"); in send_delayed()
Dbenchmark.c369 LARGE_INTEGER offset; in mbedtls_timing_hardclock() local
371 QueryPerformanceCounter(&offset); in mbedtls_timing_hardclock()
373 return (unsigned long) (offset.QuadPart); in mbedtls_timing_hardclock()
/mbedtls-latest/scripts/
Dassemble_changelog.py249 offset = (self.header + self.top_version_title).count('\n') + 1
251 self.add_categories_from_text(input_stream.name, offset,

12