Home
last modified time | relevance | path

Searched refs:val (Results 1 – 25 of 42) sorted by relevance

12

/mbedtls-3.7.0/programs/util/
Dstrerror.c33 long int val; in main() local
41 val = strtol(argv[1], &end, 10); in main()
43 val = strtol(argv[1], &end, 16); in main()
49 if (val > 0) { in main()
50 val = -val; in main()
53 if (val != 0) { in main()
55 mbedtls_strerror(val, error_buf, 200); in main()
56 mbedtls_printf("Last error was: -0x%04x - %s\n\n", (unsigned int) -val, error_buf); in main()
59 mbedtls_exit(val); in main()
/mbedtls-3.7.0/library/
Dasn1write.c200 static int asn1_write_tagged_int(unsigned char **p, const unsigned char *start, int val, int tag) in asn1_write_tagged_int() argument
209 *--(*p) = val & 0xff; in asn1_write_tagged_int()
210 val >>= 8; in asn1_write_tagged_int()
211 } while (val > 0); in asn1_write_tagged_int()
224 int mbedtls_asn1_write_int(unsigned char **p, const unsigned char *start, int val) in mbedtls_asn1_write_int() argument
226 return asn1_write_tagged_int(p, start, val, MBEDTLS_ASN1_INTEGER); in mbedtls_asn1_write_int()
229 int mbedtls_asn1_write_enum(unsigned char **p, const unsigned char *start, int val) in mbedtls_asn1_write_enum() argument
231 return asn1_write_tagged_int(p, start, val, MBEDTLS_ASN1_ENUMERATED); in mbedtls_asn1_write_enum()
377 const unsigned char *val, in mbedtls_asn1_store_named_data() argument
400 cur->val.len = val_len; in mbedtls_asn1_store_named_data()
[all …]
Dmps_trace.h127 #define MBEDTLS_MPS_TRACE_END(val) \ argument
132 (int) (val), -((unsigned) (val))); \
136 #define MBEDTLS_MPS_TRACE_RETURN(val) \ argument
139 int ret__ = val; \
150 #define MBEDTLS_MPS_TRACE_RETURN(val) return val; argument
Dasn1parse.c82 int *val) in mbedtls_asn1_get_bool() argument
95 *val = (**p != 0) ? 1 : 0; in mbedtls_asn1_get_bool()
103 int tag, int *val) in asn1_get_tagged_int() argument
139 *val = 0; in asn1_get_tagged_int()
141 *val = (*val << 8) | **p; in asn1_get_tagged_int()
150 int *val) in mbedtls_asn1_get_int() argument
152 return asn1_get_tagged_int(p, end, MBEDTLS_ASN1_INTEGER, val); in mbedtls_asn1_get_int()
157 int *val) in mbedtls_asn1_get_enum() argument
159 return asn1_get_tagged_int(p, end, MBEDTLS_ASN1_ENUMERATED, val); in mbedtls_asn1_get_enum()
427 mbedtls_free(cur->val.p); in mbedtls_asn1_free_named_data()
[all …]
Dbase64.c43 unsigned char val = 0; in mbedtls_ct_base64_dec_value() local
48 val |= mbedtls_ct_uchar_in_range_if('A', 'Z', c, c - 'A' + 0 + 1); in mbedtls_ct_base64_dec_value()
49 val |= mbedtls_ct_uchar_in_range_if('a', 'z', c, c - 'a' + 26 + 1); in mbedtls_ct_base64_dec_value()
50 val |= mbedtls_ct_uchar_in_range_if('0', '9', c, c - '0' + 52 + 1); in mbedtls_ct_base64_dec_value()
51 val |= mbedtls_ct_uchar_in_range_if('+', '+', c, c - '+' + 62 + 1); in mbedtls_ct_base64_dec_value()
52 val |= mbedtls_ct_uchar_in_range_if('/', '/', c, c - '/' + 63 + 1); in mbedtls_ct_base64_dec_value()
55 return val - 1; in mbedtls_ct_base64_dec_value()
Dx509_create.c357 cur->val.tag = tag; in mbedtls_x509_string_to_names()
381 int critical, const unsigned char *val, size_t val_len) in mbedtls_x509_set_extension() argument
394 cur->val.p[0] = critical; in mbedtls_x509_set_extension()
395 memcpy(cur->val.p + 1, val, val_len); in mbedtls_x509_set_extension()
420 const unsigned char *name = cur_name->val.p; in x509_write_name()
421 size_t name_len = cur_name->val.len; in x509_write_name()
425 cur_name->val.tag, in x509_write_name()
517 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_raw_buffer(p, start, ext->val.p + 1, in x509_write_extension()
518 ext->val.len - 1)); in x509_write_extension()
519 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_len(p, start, ext->val.len - 1)); in x509_write_extension()
[all …]
Dx509.c53 #define CHECK_RANGE(min, max, val) \ argument
55 if ((val) < (min) || (val) > (max)) { \
413 mbedtls_x509_buf *val; in x509_get_attr_type_value() local
450 val = &cur->val; in x509_get_attr_type_value()
451 val->tag = *(*p)++; in x509_get_attr_type_value()
453 if ((ret = mbedtls_asn1_get_len(p, end, &val->len)) != 0) { in x509_get_attr_type_value()
457 val->p = *p; in x509_get_attr_type_value()
458 *p += val->len; in x509_get_attr_type_value()
843 print_hexstring = (name->val.tag != MBEDTLS_ASN1_UTF8_STRING) && in mbedtls_x509_dn_gets()
844 (name->val.tag != MBEDTLS_ASN1_PRINTABLE_STRING) && in mbedtls_x509_dn_gets()
[all …]
Dtiming.c66 unsigned long mbedtls_timing_get_timer(struct mbedtls_timing_hr_time *val, int reset) in mbedtls_timing_get_timer() argument
68 struct _hr_time *t = (struct _hr_time *) val; in mbedtls_timing_get_timer()
86 unsigned long mbedtls_timing_get_timer(struct mbedtls_timing_hr_time *val, int reset) in mbedtls_timing_get_timer() argument
88 struct _hr_time *t = (struct _hr_time *) val; in mbedtls_timing_get_timer()
Daesce.c544 ret.val[0] = h; in poly_mult_128()
545 ret.val[1] = m; in poly_mult_128()
546 ret.val[2] = l; in poly_mult_128()
578 h = input.val[0]; /* h3:h2:00:00 */ in poly_mult_reduce()
579 m = input.val[1]; /* :m2:m1:00 */ in poly_mult_reduce()
580 l = input.val[2]; /* : :l1:l0 */ in poly_mult_reduce()
Dx509write_csr.c71 const unsigned char *val, size_t val_len) in mbedtls_x509write_csr_set_extension() argument
74 critical, val, val_len); in mbedtls_x509write_csr_set_extension()
/mbedtls-3.7.0/tests/scripts/
Dgen_gcm_decrypt.pl18 my $val = "";
23 ($val) = ($line =~ /\[$name\s\=\s(\w+)\]/);
27 return $val;
33 my $val = "";
42 ($val) = ($line =~ /^$name = (\w+)/);
44 return $val;
50 my $val = "FAIL";
59 ($val) = ($line =~ /^$name = (\w+)/) if ($line =~ /=/);
61 return $val;
Dgenerate_bignum_tests.py100 def value_description(val) -> str: argument
106 if val == "":
108 if val == "-":
110 if val == "0":
113 if val[0] == "-":
115 val = val[1:]
118 if val[0] == "0":
120 elif len(val) > 10:
Dgen_gcm_encrypt.pl18 my $val = "";
23 ($val) = ($line =~ /\[$name\s\=\s(\w+)\]/);
27 return $val;
33 my $val = "";
42 ($val) = ($line =~ /^$name = (\w+)/);
44 return $val;
Dgen_ctr_drbg.pl19 my $val = "";
22 ($val) = ($line =~ /\[$name\s\=\s(\w+)\]/);
24 return $val;
30 my $val = "";
39 ($val) = ($line =~ /^$name = (\w+)/);
41 return $val;
Dgen_pkcs1_v21_sign_verify.pl16 my $val = "";
27 $val .= $line;
30 $val =~ s/[ \r\n]//g;
32 return $val;
Dgenerate_test_code.py903 def val_is_int(val: str) -> bool:
905 if not INT_VAL_REGEX.match(val):
908 return abs(int(val, 0)) <= 0x7fffffff
926 val = test_args[i]
930 if typ == 'int' and not val_is_int(val):
932 if val not in unique_expressions:
933 unique_expressions.append(val)
937 exp_id = unique_expressions.index(val)
938 expression_code += gen_expression_check(exp_id, val)
939 val = exp_id
[all …]
/mbedtls-3.7.0/scripts/mbedtls_dev/
Dbignum_common.py39 def hex_to_int(val: str) -> int:
44 if val in ['', '-']:
46 return int(val, 16)
48 def quote_str(val: str) -> str:
49 return "\"{}\"".format(val)
51 def bound_mpi(val: int, bits_in_limb: int) -> int:
53 return bound_mpi_limbs(limbs_mpi(val, bits_in_limb), bits_in_limb)
60 def limbs_mpi(val: int, bits_in_limb: int) -> int:
62 bit_length = max(val.bit_length(), 1)
78 def hex_digits_max_int(val: str, bits_in_limb: int) -> int:
[all …]
/mbedtls-3.7.0/tests/suites/
Dtest_suite_asn1write.function79 void mbedtls_asn1_write_bool(int val, data_t *expected)
88 ret = mbedtls_asn1_write_bool(&data.p, data.start, val);
96 TEST_EQUAL(val, read);
107 void mbedtls_asn1_write_int(int val, data_t *expected)
116 ret = mbedtls_asn1_write_int(&data.p, data.start, val);
124 TEST_EQUAL(val, read);
136 void mbedtls_asn1_write_enum(int val, data_t *expected)
145 ret = mbedtls_asn1_write_enum(&data.p, data.start, val);
153 TEST_EQUAL(val, read);
164 void mbedtls_asn1_write_mpi(data_t *val, data_t *expected)
[all …]
Dtest_suite_asn1parse.function51 int val = -257;
53 ret = mbedtls_asn1_get_bool(p, end, &val);
55 TEST_ASSERT(val == 0 || val == 1);
76 int val = -257;
78 ret = mbedtls_asn1_get_int(&q, end, &val);
311 int val;
313 ret = mbedtls_asn1_get_bool(&p, input->x + input->len, &val);
316 TEST_EQUAL(val, expected_value);
329 int val;
337 TEST_EQUAL(mbedtls_asn1_get_int(&p, input->x + input->len, &val),
[all …]
Dtest_suite_debug.function212 mbedtls_mpi val;
218 mbedtls_mpi_init(&val);
232 TEST_ASSERT(mbedtls_test_read_mpi(&val, value) == 0);
234 mbedtls_debug_print_mpi(&ssl, 0, file, line, prefix, &val);
239 mbedtls_mpi_free(&val);
Dhost_test.function213 char *val = *cur++;
216 if (verify_string(&val) == 0) {
217 *out++ = val;
223 if (verify_int(val, &int_params_store->sint) == 0) {
230 if (verify_string(&val) == 0) {
234 mbedtls_test_unhexify((unsigned char *) val, strlen(val),
235 val, &len) == 0);
238 *out++ = val;
245 int exp_id = strtol(val, NULL, 10);
/mbedtls-3.7.0/include/mbedtls/
Dasn1.h180 mbedtls_asn1_buf val; /**< The named value. */ member
268 int *val);
289 int *val);
310 int *val);
Dasn1write.h209 int mbedtls_asn1_write_int(unsigned char **p, const unsigned char *start, int val);
224 int mbedtls_asn1_write_enum(unsigned char **p, const unsigned char *start, int val);
381 const unsigned char *val,
Dtiming.h47 unsigned long mbedtls_timing_get_timer(struct mbedtls_timing_hr_time *val, int reset);
/mbedtls-3.7.0/programs/x509/
Dcert_write.c258 unsigned char val; in parse_serial_decimal_format() local
275 val = (dec >> ((remaining_bytes - 1) * 8)) & 0xFF; in parse_serial_decimal_format()
278 if ((val != 0) || (*len != 0)) { in parse_serial_decimal_format()
279 *p = val; in parse_serial_decimal_format()

12