| /optee_os/lib/libutils/ext/ |
| H A D | base64.c | 16 bool base64_enc(const void *data, size_t dlen, char *buf, size_t *blen) in base64_enc() argument 23 if (*blen < n) { in base64_enc() 24 *blen = n; in base64_enc() 56 *blen = boffs; in base64_enc() 73 bool base64_dec(const char *data, size_t size, void *buf, size_t *blen) in base64_dec() argument 96 if (b && m < *blen) in base64_dec() 103 if (b && m < *blen) in base64_dec() 110 if (b && m < *blen) in base64_dec() 124 ret = (!m && !*blen) || (b && (m <= *blen)); in base64_dec() 125 *blen = m; in base64_dec()
|
| /optee_os/ldelf/ |
| H A D | main.c | 63 size_t blen; member 72 size_t blen = 0; in print_to_pbuf() local 75 if (pbuf->buf && pbuf->blen > pbuf->ret) { in print_to_pbuf() 77 blen = pbuf->blen - pbuf->ret; in print_to_pbuf() 80 ret = vsnprintk(buf, blen, fmt, ap); in print_to_pbuf() 90 size_t blen = 0; in copy_to_pbuf() local 92 if (pbuf->buf && pbuf->blen > pbuf->ret) { in copy_to_pbuf() 94 blen = pbuf->blen - pbuf->ret; in copy_to_pbuf() 95 memcpy(buf, b, MIN(blen, bl)); in copy_to_pbuf() 102 static void __noreturn ftrace_dump(void *buf, size_t *blen) in ftrace_dump() argument [all …]
|
| /optee_os/core/lib/libtomcrypt/src/pk/asn1/der/bit/ |
| H A D | der_decode_bit_string.c | 24 unsigned long dlen, blen, x, y; in der_decode_bit_string() local 56 blen = ((dlen - 1) << 3) - (in[x++] & 7); in der_decode_bit_string() 59 if (blen > *outlen) { in der_decode_bit_string() 60 *outlen = blen; in der_decode_bit_string() 65 for (y = 0; y < blen; y++) { in der_decode_bit_string() 73 *outlen = blen; in der_decode_bit_string()
|
| H A D | der_decode_raw_bit_string.c | 27 unsigned long dlen, blen, x, y; in der_decode_raw_bit_string() local 59 blen = ((dlen - 1) << 3) - (in[x++] & 7); in der_decode_raw_bit_string() 62 if (blen > *outlen) { in der_decode_raw_bit_string() 63 *outlen = blen; in der_decode_raw_bit_string() 68 for (y = 0; y < blen; y++) { in der_decode_raw_bit_string() 80 *outlen = blen; in der_decode_raw_bit_string()
|
| /optee_os/lib/libmbedtls/mbedtls/library/ |
| H A D | ecdh.c | 275 unsigned char *buf, size_t blen, in ecdh_make_params_internal() argument 314 blen)) != 0) { in ecdh_make_params_internal() 319 blen -= grp_len; in ecdh_make_params_internal() 322 &pt_len, buf, blen)) != 0) { in ecdh_make_params_internal() 338 unsigned char *buf, size_t blen, in mbedtls_ecdh_make_params() argument 350 return ecdh_make_params_internal(ctx, olen, ctx->point_format, buf, blen, in mbedtls_ecdh_make_params() 357 buf, blen, f_rng, p_rng); in mbedtls_ecdh_make_params() 361 ctx->point_format, buf, blen, in mbedtls_ecdh_make_params() 494 unsigned char *buf, size_t blen, in ecdh_make_public_internal() argument 531 buf, blen); in ecdh_make_public_internal() [all …]
|
| H A D | ecdsa.c | 204 const unsigned char *buf, size_t blen) in derive_mpi() argument 208 size_t use_size = blen > n_size ? n_size : blen; in derive_mpi() 245 const mbedtls_mpi *d, const unsigned char *buf, size_t blen, in mbedtls_ecdsa_sign_restartable() argument 340 MBEDTLS_MPI_CHK(derive_mpi(grp, &e, buf, blen)); in mbedtls_ecdsa_sign_restartable() 381 const mbedtls_mpi *d, const unsigned char *buf, size_t blen, in mbedtls_ecdsa_sign() argument 385 return mbedtls_ecdsa_sign_restartable(grp, r, s, d, buf, blen, in mbedtls_ecdsa_sign() 399 const mbedtls_mpi *d, const unsigned char *buf, size_t blen, in mbedtls_ecdsa_sign_det_restartable() argument 436 MBEDTLS_MPI_CHK(derive_mpi(grp, &h, buf, blen)); in mbedtls_ecdsa_sign_det_restartable() 450 ret = mbedtls_ecdsa_sign(grp, r, s, d, buf, blen, in mbedtls_ecdsa_sign_det_restartable() 453 ret = mbedtls_ecdsa_sign_restartable(grp, r, s, d, buf, blen, in mbedtls_ecdsa_sign_det_restartable() [all …]
|
| /optee_os/core/pta/ |
| H A D | device.c | 25 uint32_t blen, uint32_t *pos, uint32_t rflags) in add_ta() argument 37 if (*pos + sizeof(*uuid) <= blen) in add_ta() 51 uint32_t blen = 0; in get_devices() local 64 blen = params[0].memref.size; in get_devices() 67 add_ta(ta->flags, &ta->uuid, buf, blen, &pos, rflags); in get_devices() 71 stmm_get_uuid(), buf, blen, &pos, rflags); in get_devices() 75 add_ta(eta->flags, &eta->uuid, buf, blen, &pos, in get_devices() 79 if (pos > blen) in get_devices()
|
| /optee_os/core/tee/ |
| H A D | tee_svc.c | 114 void *buf, size_t *blen) in get_prop_tee_dev_id() argument 122 if (*blen < sizeof(uuid)) { in get_prop_tee_dev_id() 123 *blen = sizeof(uuid); in get_prop_tee_dev_id() 126 *blen = sizeof(uuid); in get_prop_tee_dev_id() 157 void *buf, size_t *blen) in get_prop_tee_sys_time_prot_level() argument 161 if (*blen < sizeof(prot)) { in get_prop_tee_sys_time_prot_level() 162 *blen = sizeof(prot); in get_prop_tee_sys_time_prot_level() 165 *blen = sizeof(prot); in get_prop_tee_sys_time_prot_level() 171 void *buf, size_t *blen) in get_prop_client_id() argument 173 if (*blen < sizeof(TEE_Identity)) { in get_prop_client_id() [all …]
|
| H A D | tee_fs_rpc.c | 24 static TEE_Result create_filename(void *buf, size_t blen, in create_filename() argument 31 if (pos >= blen) in create_filename() 36 if (pos >= blen) in create_filename() 39 l = blen - pos; in create_filename()
|
| /optee_os/core/drivers/crypto/se050/core/ |
| H A D | rng.c | 12 static TEE_Result do_rng_read(void *buf, size_t blen) in do_rng_read() argument 18 status = sss_se05x_rng_get_random(&rng, buf, blen); in do_rng_read() 31 TEE_Result hw_get_random_bytes(void *buf, size_t blen) in hw_get_random_bytes() argument 36 return do_rng_read(buf, blen); in hw_get_random_bytes()
|
| H A D | rsa.c | 332 size_t blen = 0; in decrypt_nopad() local 348 blen = CFG_CORE_BIGNUM_MAX_BITS / 8; in decrypt_nopad() 349 buf = mempool_calloc(mempool_default, 1, blen); in decrypt_nopad() 358 st = sss_se05x_asymmetric_decrypt(&ctx, buf, rsa_len, buf, &blen); in decrypt_nopad() 366 while ((offset < blen - 1) && (buf[offset] == 0)) in decrypt_nopad() 369 if (*dst_len < blen - offset) { in decrypt_nopad() 370 *dst_len = blen - offset; in decrypt_nopad() 375 *dst_len = blen - offset; in decrypt_nopad() 396 size_t blen = 0; in encrypt_nopad() local 410 blen = CFG_CORE_BIGNUM_MAX_BITS / 8; in encrypt_nopad() [all …]
|
| /optee_os/core/kernel/ |
| H A D | tee_misc.c | 34 uint32_t tee_b2hs(uint8_t *b, uint8_t *hs, uint32_t blen, uint32_t hslen) in tee_b2hs() argument 38 if (blen * 2 + 1 > hslen) in tee_b2hs() 41 for (; i < blen; i++) { in tee_b2hs() 45 hs[blen * 2] = 0; in tee_b2hs() 47 return blen * 2; in tee_b2hs() 50 uint32_t tee_hs2b(uint8_t *hs, uint8_t *b, uint32_t hslen, uint32_t blen) in tee_hs2b() argument 57 if (len > blen) in tee_hs2b()
|
| /optee_os/core/arch/arm/plat-vexpress/ |
| H A D | vendor_props.c | 29 void *buf, size_t *blen) in get_prop_endorsement() argument 38 if (*blen < sizeof(bin)) { in get_prop_endorsement() 39 *blen = sizeof(bin); in get_prop_endorsement() 42 *blen = sizeof(bin); in get_prop_endorsement()
|
| /optee_os/lib/libmbedtls/mbedtls/include/mbedtls/ |
| H A D | ecdsa.h | 163 const mbedtls_mpi *d, const unsigned char *buf, size_t blen, 209 const unsigned char *buf, size_t blen, 275 const unsigned char *buf, size_t blen, 337 const mbedtls_mpi *d, const unsigned char *buf, size_t blen, 376 const unsigned char *buf, size_t blen, 417 const unsigned char *buf, size_t blen,
|
| H A D | ecdh.h | 292 unsigned char *buf, size_t blen, 374 unsigned char *buf, size_t blen, 398 const unsigned char *buf, size_t blen); 430 unsigned char *buf, size_t blen,
|
| /optee_os/core/lib/libtomcrypt/ |
| H A D | rsa.c | 218 unsigned long blen, offset; in rsadorep() local 226 blen = _CFG_CORE_LTC_BIGNUM_MAX_BITS / sizeof(uint8_t); in rsadorep() 227 buf = mempool_alloc(mempool_default, blen); in rsadorep() 233 ltc_res = rsa_exptmod(src, src_len, buf, &blen, ltc_key->type, in rsadorep() 254 while ((offset < blen - 1) && (buf[offset] == 0)) in rsadorep() 257 if (*dst_len < blen - offset) { in rsadorep() 258 *dst_len = blen - offset; in rsadorep() 264 *dst_len = blen - offset; in rsadorep() 346 unsigned long blen; in sw_crypto_acipher_rsaes_decrypt() local 387 blen = mod_size - 11; in sw_crypto_acipher_rsaes_decrypt() [all …]
|
| /optee_os/lib/libutils/ext/include/ |
| H A D | base64.h | 12 bool base64_enc(const void *data, size_t size, char *buf, size_t *blen); 13 bool base64_dec(const char *data, size_t size, void *buf, size_t *blen);
|
| /optee_os/core/crypto/ |
| H A D | rng_hw.c | 25 TEE_Result crypto_rng_read(void *buf, size_t blen) in crypto_rng_read() argument 30 return hw_get_random_bytes(buf, blen); in crypto_rng_read()
|
| H A D | rng_fortuna.c | 341 static TEE_Result generate_random_data(void *buf, size_t blen) in generate_random_data() argument 345 res = generate_blocks(buf, blen / BLOCK_SIZE); in generate_random_data() 348 if (blen % BLOCK_SIZE) { in generate_random_data() 350 uint8_t *b = (uint8_t *)buf + ROUNDDOWN(blen, BLOCK_SIZE); in generate_random_data() 355 memcpy(b, block, blen % BLOCK_SIZE); in generate_random_data() 476 static TEE_Result fortuna_read(void *buf, size_t blen) in fortuna_read() argument 489 if (blen) { in fortuna_read() 492 res = generate_random_data(buf, blen); in fortuna_read() 514 TEE_Result crypto_rng_read(void *buf, size_t blen) in crypto_rng_read() argument 523 n = MIN(blen - offs, SIZE_1M); in crypto_rng_read()
|
| /optee_os/lib/libmbedtls/core/ |
| H A D | rsa.c | 346 unsigned long blen = 0; in sw_crypto_acipher_rsanopad_encrypt() local 357 blen = CFG_CORE_BIGNUM_MAX_BITS / 8; in sw_crypto_acipher_rsanopad_encrypt() 358 buf = malloc(blen); in sw_crypto_acipher_rsanopad_encrypt() 364 memset(buf, 0, blen); in sw_crypto_acipher_rsanopad_encrypt() 411 unsigned long blen = 0; in sw_crypto_acipher_rsanopad_decrypt() local 418 blen = CFG_CORE_BIGNUM_MAX_BITS / 8; in sw_crypto_acipher_rsanopad_decrypt() 419 buf = malloc(blen); in sw_crypto_acipher_rsanopad_decrypt() 425 memset(buf, 0, blen); in sw_crypto_acipher_rsanopad_decrypt() 474 size_t blen = 0; in sw_crypto_acipher_rsaes_decrypt() local 505 blen = mod_size - 11; in sw_crypto_acipher_rsaes_decrypt() [all …]
|
| /optee_os/core/include/kernel/ |
| H A D | tee_misc.h | 21 uint32_t tee_b2hs(uint8_t *b, uint8_t *hs, uint32_t blen, uint32_t hslen); 27 uint32_t tee_hs2b(uint8_t *hs, uint8_t *b, uint32_t hslen, uint32_t blen);
|
| /optee_os/ta/pkcs11/src/ |
| H A D | serializer.c | 176 enum pkcs11_rc serialize(char **bstart, size_t *blen, void *data, size_t len) in serialize() argument 181 if (ADD_OVERFLOW(*blen, len, &nlen)) in serialize() 188 TEE_MemMove(buf + *blen, data, len); in serialize() 190 *blen = nlen; in serialize()
|
| /optee_os/core/arch/arm/include/kernel/ |
| H A D | spmc_sp_handler.h | 26 struct ffa_rxtx *rxtx, size_t blen, size_t flen, 39 struct ffa_rxtx *rxtx __unused, size_t blen __unused, in spmc_sp_add_share()
|
| /optee_os/core/include/tee/ |
| H A D | tee_svc.h | 25 void *buf, size_t *blen); 46 void *buf, uint32_t *blen,
|
| /optee_os/core/include/ |
| H A D | rng_support.h | 10 TEE_Result hw_get_random_bytes(void *buf, size_t blen);
|