/optee_os-3.20.0/core/drivers/ |
A D | versal_puf.c | 104 .buf = &req, in versal_puf_register() 116 versal_mbox_alloc(sizeof(buf->chash), &buf->chash, &hash_addr); in versal_puf_register() 117 versal_mbox_alloc(sizeof(buf->aux), &buf->aux, &aux_addr); in versal_puf_register() 154 memcpy(buf->puf_id, puf_id_addr.buf, sizeof(buf->puf_id)); in versal_puf_register() 155 memcpy(&buf->chash, hash_addr.buf, sizeof(buf->chash)); in versal_puf_register() 156 memcpy(&buf->aux, aux_addr.buf, sizeof(buf->aux)); in versal_puf_register() 157 memcpy(buf->efuse_syn_data, efuse_syn_data_addr.buf, in versal_puf_register() 159 memcpy(buf->syndrome_data, syndrome_data_addr.buf, in versal_puf_register() 184 .buf = &req, in versal_puf_regenerate() 197 versal_mbox_alloc(sizeof(buf->aux), &buf->aux, &aux_addr); in versal_puf_regenerate() [all …]
|
A D | versal_nvm.c | 92 void *buf; member 138 cmd->ibuf[i].mem.buf = ibufs[i].buf; in prepare_cmd() 679 memcpy(buf, versal_get_read_buffer(&req), sizeof(*buf)); in versal_efuse_read_misc_ctrl() 699 memcpy(buf, versal_get_read_buffer(&req), sizeof(*buf)); in versal_efuse_read_sec_ctrl() 719 memcpy(buf, versal_get_read_buffer(&req), sizeof(*buf)); in versal_efuse_read_sec_misc1() 740 memcpy(buf, versal_get_read_buffer(&req), sizeof(*buf)); in versal_efuse_read_boot_env_ctrl() 910 memcpy(&cfg, buf, sizeof(*buf)); in versal_efuse_write_puf() 933 if (!buf) in versal_bbram_write_aes_key() 938 req.ibuf[0].buf = buf; in versal_bbram_write_aes_key() 942 free(buf); in versal_bbram_write_aes_key() [all …]
|
/optee_os-3.20.0/lib/libmbedtls/mbedtls/library/ |
A D | x509write_crt.c | 140 unsigned char *c = buf + sizeof(buf); in mbedtls_x509write_crt_set_basic_constraints() 143 memset( buf, 0, sizeof(buf) ); in mbedtls_x509write_crt_set_basic_constraints() 174 unsigned char *c = buf + sizeof(buf); in mbedtls_x509write_crt_set_subject_key_identifier() 177 memset( buf, 0, sizeof(buf) ); in mbedtls_x509write_crt_set_subject_key_identifier() 182 buf + sizeof( buf ) - 20 ); in mbedtls_x509write_crt_set_subject_key_identifier() 185 c = buf + sizeof( buf ) - 20; in mbedtls_x509write_crt_set_subject_key_identifier() 195 0, buf + sizeof(buf) - len, len ); in mbedtls_x509write_crt_set_subject_key_identifier() 202 unsigned char *c = buf + sizeof( buf ); in mbedtls_x509write_crt_set_authority_key_identifier() 205 memset( buf, 0, sizeof(buf) ); in mbedtls_x509write_crt_set_authority_key_identifier() 213 c = buf + sizeof( buf ) - 20; in mbedtls_x509write_crt_set_authority_key_identifier() [all …]
|
A D | x509write_csr.c | 98 c = buf + 4; in mbedtls_x509write_csr_set_key_usage() 120 c = buf + 4; in mbedtls_x509write_csr_set_ns_cert_type() 157 c = buf + size; in x509write_csr_der_internal() 167 &c, buf, in x509write_csr_der_internal() 173 &c, buf, in x509write_csr_der_internal() 184 &c, buf, in x509write_csr_der_internal() 191 &c, buf, in x509write_csr_der_internal() 213 &c, buf, in x509write_csr_der_internal() 267 c2 = buf + size; in x509write_csr_der_internal() 284 &c2, buf, in x509write_csr_der_internal() [all …]
|
A D | pkwrite.c | 116 unsigned char buf[MBEDTLS_ECP_MAX_PT_LEN]; in pk_write_ec_pubkey() local 120 &len, buf, sizeof( buf ) ) ) != 0 ) in pk_write_ec_pubkey() 129 memcpy( *p, buf, len ); in pk_write_ec_pubkey() 236 PK_VALIDATE_RET( buf != NULL ); in mbedtls_pk_write_pubkey_der() 238 c = buf + size; in mbedtls_pk_write_pubkey_der() 242 if( c - buf < 1 ) in mbedtls_pk_write_pubkey_der() 322 PK_VALIDATE_RET( buf != NULL ); in mbedtls_pk_write_key_der() 324 c = buf + size; in mbedtls_pk_write_key_der() 425 if( c - buf < 1 ) in mbedtls_pk_write_key_der() 563 PK_VALIDATE_RET( buf != NULL || size == 0 ); in mbedtls_pk_write_pubkey_pem() [all …]
|
A D | entropy.c | 301 mbedtls_platform_zeroize( buf, sizeof( buf ) ); in entropy_gather_internal() 435 memcpy( output, buf, len ); in mbedtls_entropy_func() 440 mbedtls_platform_zeroize( buf, sizeof( buf ) ); in mbedtls_entropy_func() 499 mbedtls_platform_zeroize( buf, sizeof( buf ) ); in mbedtls_entropy_write_seed_file() 524 if( fread( buf, 1, n, f ) != n ) in mbedtls_entropy_update_seed_file() 531 mbedtls_platform_zeroize( buf, sizeof( buf ) ); in mbedtls_entropy_update_seed_file() 594 set &= buf[i]; in mbedtls_entropy_source_self_test_check_bits() 595 unset |= buf[i]; in mbedtls_entropy_source_self_test_check_bits() 685 if( ( ret = mbedtls_entropy_update_manual( &ctx, buf, sizeof buf ) ) != 0 ) in mbedtls_entropy_self_test() 698 if( ( ret = mbedtls_entropy_func( &ctx, buf, sizeof( buf ) ) ) != 0 ) in mbedtls_entropy_self_test() [all …]
|
/optee_os-3.20.0/core/drivers/tpm2/ |
A D | tpm2_cmd.c | 90 DHEXDUMP(buf, tpm2_cmd_len(buf)); in tpm2_transmit() 115 uint8_t buf[16] = { }; in tpm2_startup() local 124 ret = tpm2_transmit(buf, tpm2_cmd_len((struct tpm2_cmd *)buf), resp_buf, in tpm2_startup() 134 uint8_t buf[16] = { }; in tpm2_selftest() local 143 ret = tpm2_transmit(buf, tpm2_cmd_len((struct tpm2_cmd *)buf), resp_buf, in tpm2_selftest() 175 ret = tpm2_transmit(buf, tpm2_cmd_len((struct tpm2_cmd *)buf), resp_buf, in tpm2_get_capability() 287 ret = tpm2_transmit(buf, tpm2_cmd_len((struct tpm2_cmd *)buf), resp_buf, in tpm2_pcr_read() 359 void *buf = NULL; in tpm2_pcr_extend() local 384 if (!buf) in tpm2_pcr_extend() 389 free(buf); in tpm2_pcr_extend() [all …]
|
/optee_os-3.20.0/lib/libutils/ext/ |
A D | trace.c | 122 res = snprintk(buf, sizeof(buf), "%c/", in trace_vprintf() 129 res = snprintk(buf + boffs, sizeof(buf) - boffs, "%s:", in trace_vprintf() 137 res = print_core_id(buf + boffs, sizeof(buf) - boffs); in trace_vprintf() 143 res = print_thread_id(buf + boffs, sizeof(buf) - boffs); in trace_vprintf() 149 res = snprintk(buf + boffs, sizeof(buf) - boffs, "%s:%d ", in trace_vprintf() 160 buf[boffs] = 0; in trace_vprintf() 163 res = vsnprintk(buf + boffs, sizeof(buf) - boffs, fmt, ap); in trace_vprintf() 170 buf[boffs] = '\n'; in trace_vprintf() 218 left = sizeof(sbuf->buf) - (sbuf->ptr - sbuf->buf); in append() 260 sbuf.buf); in dhex_dump() [all …]
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/misc/pkcs5/ |
A D | pkcs_5_2.c | 31 unsigned char *buf[2]; in pkcs_5_alg2() local 48 buf[0] = XMALLOC(MAXBLOCKSIZE * 2); in pkcs_5_alg2() 54 if (buf[0] != NULL) { in pkcs_5_alg2() 55 XFREE(buf[0]); in pkcs_5_alg2() 60 buf[1] = buf[0] + MAXBLOCKSIZE; in pkcs_5_alg2() 70 STORE32H(blkno, buf[1]); in pkcs_5_alg2() 89 XMEMCPY(buf[1], buf[0], x); in pkcs_5_alg2() 95 buf[1][y] ^= buf[0][y]; in pkcs_5_alg2() 101 out[stored++] = buf[1][y]; in pkcs_5_alg2() 110 zeromem(buf[0], MAXBLOCKSIZE*2); in pkcs_5_alg2() [all …]
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/hashes/ |
A D | sha3_test.c | 34 XMEMSET(buf, c1, sizeof(buf)); in sha3_224_test() 46 sha3_process(&c, buf + sizeof(buf) / 2, sizeof(buf) / 2); in sha3_224_test() 90 XMEMSET(buf, c1, sizeof(buf)); in sha3_256_test() 101 sha3_process(&c, buf, sizeof(buf)); in sha3_256_test() 110 sha3_process(&c, buf + sizeof(buf) / 2, sizeof(buf) / 2); in sha3_256_test() 180 XMEMSET(buf, c1, sizeof(buf)); in sha3_384_test() 193 sha3_process(&c, buf + sizeof(buf) / 2, sizeof(buf) / 2); in sha3_384_test() 235 XMEMSET(buf, c1, sizeof(buf)); in sha3_512_test() 248 sha3_process(&c, buf + sizeof(buf) / 2, sizeof(buf) / 2); in sha3_512_test() 305 XMEMSET(buf, c1, sizeof(buf)); in sha3_shake_test() [all …]
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/pk/asn1/der/generalizedtime/ |
A D | der_decode_generalizedtime.c | 31 y = s_char_to_int(buf[x])*10 + s_char_to_int(buf[x+1]); \ 37 …y = s_char_to_int(buf[x])*1000 + s_char_to_int(buf[x+1])*100 + s_char_to_int(buf[x+2])*10 + s_cha… 52 unsigned char buf[32]; in der_decode_generalizedtime() local 76 buf[x] = y; in der_decode_generalizedtime() 107 if (buf[x] == 'Z') { in der_decode_generalizedtime() 110 if (buf[x] == '.') { in der_decode_generalizedtime() 112 while (buf[x] >= '0' && buf[x] <= '9') { in der_decode_generalizedtime() 116 out->fs += s_char_to_int(buf[x]); in der_decode_generalizedtime() 123 if (buf[x] == 'Z') { in der_decode_generalizedtime() 126 if (buf[x] == '+' || buf[x] == '-') { in der_decode_generalizedtime() [all …]
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/pk/ecc/ |
A D | ltc_ecc_export_point.c | 11 unsigned char buf[ECC_BUF_SIZE]; in ltc_ecc_export_point() local 14 if (size > sizeof(buf)) return CRYPT_BUFFER_OVERFLOW; in ltc_ecc_export_point() 26 zeromem(buf, sizeof(buf)); in ltc_ecc_export_point() 27 if ((err = mp_to_unsigned_bin(x, buf + (size - xsize))) != CRYPT_OK) return err; in ltc_ecc_export_point() 28 XMEMCPY(out+1, buf, size); in ltc_ecc_export_point() 40 zeromem(buf, sizeof(buf)); in ltc_ecc_export_point() 41 if ((err = mp_to_unsigned_bin(x, buf + (size - xsize))) != CRYPT_OK) return err; in ltc_ecc_export_point() 42 XMEMCPY(out+1, buf, size); in ltc_ecc_export_point() 44 zeromem(buf, sizeof(buf)); in ltc_ecc_export_point() 45 if ((err = mp_to_unsigned_bin(y, buf + (size - ysize))) != CRYPT_OK) return err; in ltc_ecc_export_point() [all …]
|
/optee_os-3.20.0/core/drivers/crypto/caam/utils/ |
A D | utils_mem.c | 98 if (!buf->data) in mem_alloc_buf() 101 buf->paddr = virt_to_phys(buf->data); in mem_alloc_buf() 102 if (!buf->paddr) { in mem_alloc_buf() 107 buf->length = size; in mem_alloc_buf() 108 buf->nocache = 0; in mem_alloc_buf() 166 if (buf) { in caam_free_buf() 167 if (buf->data) { in caam_free_buf() 169 buf->data = NULL; in caam_free_buf() 172 buf->length = 0; in caam_free_buf() 173 buf->paddr = 0; in caam_free_buf() [all …]
|
A D | utils_sgt.c | 41 op_size = MIN(rem_length, insgt->buf[idx].length); in caam_sgt_cache_op() 42 if (!insgt->buf[idx].nocache) in caam_sgt_cache_op() 57 sgt->buf[idx].length); in caam_sgt_fill_table() 62 sgt->buf[idx].length); in caam_sgt_fill_table() 85 off -= from->buf[idx].length; in caam_sgt_derive() 92 rlength -= MIN(rlength, from->buf[idx].length); in caam_sgt_derive() 105 memcpy(sgt->buf, &from->buf[st_idx], sgt->number * sizeof(*sgt->buf)); in caam_sgt_derive() 122 sgt->paddr = sgt->buf->paddr + off; in caam_sgt_derive() 135 caam_free(data->buf); in caam_sgtbuf_free() 138 data->buf = NULL; in caam_sgtbuf_free() [all …]
|
/optee_os-3.20.0/core/lib/zlib/ |
A D | adler32.c | 17 #define DO1(buf,i) {adler += (buf)[i]; sum2 += adler;} argument 18 #define DO2(buf,i) DO1(buf,i); DO1(buf,i+1); argument 19 #define DO4(buf,i) DO2(buf,i); DO2(buf,i+2); argument 20 #define DO8(buf,i) DO4(buf,i); DO4(buf,i+4); argument 21 #define DO16(buf) DO8(buf,0); DO8(buf,8); argument 66 const Bytef *buf; 88 if (buf == Z_NULL) 109 buf += 16; 119 DO16(buf); 120 buf += 16; [all …]
|
/optee_os-3.20.0/lib/libutee/ |
A D | tee_api_panic.c | 43 if (!buf) in check_access() 47 return TEE_CheckMemoryAccessRights(flags, buf, len); in check_access() 52 void __utee_check_outbuf_annotation(void *buf, uint32_t *len) in __utee_check_outbuf_annotation() argument 57 check_access(ACCESS_W_ANY, buf, *len)); in __utee_check_outbuf_annotation() 60 void __utee_check_instring_annotation(const char *buf) in __utee_check_instring_annotation() argument 63 check_access(ACCESS_R, (char *)buf, strlen(buf) + 1)); in __utee_check_instring_annotation() 71 check_access(ACCESS_W_ANY, buf, *len)); in __utee_check_outstring_annotation() 74 void __utee_check_out_annotation(void *buf, const size_t len) in __utee_check_out_annotation() argument 77 check_access(ACCESS_W, buf, len)); in __utee_check_out_annotation() 86 void __utee_check_inout_annotation(void *buf, const size_t len) in __utee_check_inout_annotation() argument [all …]
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/math/ |
A D | rand_prime.c | 17 unsigned char *buf; in rand_prime() local 40 buf = XCALLOC(1, len); in rand_prime() 41 if (buf == NULL) { in rand_prime() 48 XFREE(buf); in rand_prime() 53 buf[0] |= 0x80 | 0x40; in rand_prime() 54 buf[len-1] |= 0x01 | ((type & USE_BBS) ? 0x02 : 0x00); in rand_prime() 57 if ((err = mp_read_unsigned_bin(N, buf, len)) != CRYPT_OK) { in rand_prime() 58 XFREE(buf); in rand_prime() 64 XFREE(buf); in rand_prime() 70 zeromem(buf, len); in rand_prime() [all …]
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/pk/ec25519/ |
A D | ec25519_crypto_ctx.c | 14 unsigned char *buf = out; in ec25519_crypto_ctx() local 23 XMEMCPY(buf, prefix, prefix_len); in ec25519_crypto_ctx() 24 buf += prefix_len; in ec25519_crypto_ctx() 25 XMEMCPY(buf, &flag, 1); in ec25519_crypto_ctx() 26 buf++; in ec25519_crypto_ctx() 27 XMEMCPY(buf, &ctxlen8, 1); in ec25519_crypto_ctx() 28 buf++; in ec25519_crypto_ctx() 32 XMEMCPY(buf, ctx, ctxlen); in ec25519_crypto_ctx() 33 buf += ctxlen; in ec25519_crypto_ctx() 36 *outlen = buf-out; in ec25519_crypto_ctx()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/misc/bcrypt/ |
A D | bcrypt.c | 83 unsigned char *buf[3], blkbuf[4]; in bcrypt_pbkdf_openbsd() local 111 if (buf[0] != NULL) { in bcrypt_pbkdf_openbsd() 112 XFREE(buf[0]); in bcrypt_pbkdf_openbsd() 117 buf[1] = buf[0] + MAXBLOCKSIZE; in bcrypt_pbkdf_openbsd() 118 buf[2] = buf[1] + MAXBLOCKSIZE; in bcrypt_pbkdf_openbsd() 149 XMEMCPY(buf[2], buf[1], y); in bcrypt_pbkdf_openbsd() 154 if ((err = hash_memory(hash_idx, buf[1], y, buf[0], &x)) != CRYPT_OK) { in bcrypt_pbkdf_openbsd() 162 buf[2][x] ^= buf[1][x]; in bcrypt_pbkdf_openbsd() 172 out[dest] = buf[2][y]; in bcrypt_pbkdf_openbsd() 180 zeromem(buf[0], MAXBLOCKSIZE*3); in bcrypt_pbkdf_openbsd() [all …]
|
/optee_os-3.20.0/core/lib/libfdt/ |
A D | fdt_empty_tree.c | 13 int fdt_create_empty_tree(void *buf, int bufsize) in fdt_create_empty_tree() argument 17 err = fdt_create(buf, bufsize); in fdt_create_empty_tree() 21 err = fdt_finish_reservemap(buf); in fdt_create_empty_tree() 25 err = fdt_begin_node(buf, ""); in fdt_create_empty_tree() 29 err = fdt_end_node(buf); in fdt_create_empty_tree() 33 err = fdt_finish(buf); in fdt_create_empty_tree() 37 return fdt_open_into(buf, buf, bufsize); in fdt_create_empty_tree()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/pk/asn1/der/utctime/ |
A D | der_decode_utctime.c | 30 y = s_char_to_int(buf[x])*10 + s_char_to_int(buf[x+1]); \ 44 unsigned char buf[32] = { 0 }; /* initialize as all zeroes */ in der_decode_utctime() local 53 if (*inlen < 2UL || (in[1] >= sizeof(buf)) || ((in[1] + 2UL) > *inlen)) { in der_decode_utctime() 63 buf[x] = y; in der_decode_utctime() 90 if (buf[x] == 'Z') { in der_decode_utctime() 93 if (buf[x] == '+' || buf[x] == '-') { in der_decode_utctime() 94 out->off_dir = (buf[x++] == '+') ? 0 : 1; in der_decode_utctime() 104 if (buf[x] == 'Z') { in der_decode_utctime() 107 if (buf[x] == '+' || buf[x] == '-') { in der_decode_utctime() 108 out->off_dir = (buf[x++] == '+') ? 0 : 1; in der_decode_utctime()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/encauth/eax/ |
A D | eax_init.c | 29 unsigned char *buf; in eax_init() local 48 buf = XMALLOC(MAXBLOCKSIZE); in eax_init() 52 if (buf != NULL) { in eax_init() 53 XFREE(buf); in eax_init() 62 zeromem(buf, MAXBLOCKSIZE); in eax_init() 82 zeromem(buf, MAXBLOCKSIZE); in eax_init() 83 buf[blklen - 1] = 1; in eax_init() 113 zeromem(buf, MAXBLOCKSIZE); in eax_init() 114 buf[blklen-1] = 2; in eax_init() 122 zeromem(buf, MAXBLOCKSIZE); in eax_init() [all …]
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/pk/pkcs1/ |
A D | pkcs_1_mgf1.c | 29 unsigned char *buf; in pkcs_1_mgf1() local 44 buf = XMALLOC(hLen); in pkcs_1_mgf1() 45 if (md == NULL || buf == NULL) { in pkcs_1_mgf1() 49 if (buf != NULL) { in pkcs_1_mgf1() 50 XFREE(buf); in pkcs_1_mgf1() 60 STORE32H(counter, buf); in pkcs_1_mgf1() 70 if ((err = hash_descriptor[hash_idx]->process(md, buf, 4)) != CRYPT_OK) { in pkcs_1_mgf1() 73 if ((err = hash_descriptor[hash_idx]->done(md, buf)) != CRYPT_OK) { in pkcs_1_mgf1() 79 *mask++ = buf[x]; in pkcs_1_mgf1() 86 zeromem(buf, hLen); in pkcs_1_mgf1() [all …]
|
/optee_os-3.20.0/core/pta/stm32mp/ |
A D | bsec_pta.c | 45 if (pt != exp_pt || !buf || !size || in bsec_read_mem() 58 otp_id++, buf++) { in bsec_read_mem() 64 *buf = 0x0; in bsec_read_mem() 70 *buf); in bsec_read_mem() 83 *buf = PTA_BSEC_LOCK_ERROR; in bsec_read_mem() 86 *buf = 0; in bsec_read_mem() 93 *buf |= PTA_BSEC_LOCK_PERM; in bsec_read_mem() 100 *buf |= PTA_BSEC_LOCK_SHADOW_R; in bsec_read_mem() 171 otp_id++, buf++) { in bsec_write_mem() 176 otp_id, *buf); in bsec_write_mem() [all …]
|
/optee_os-3.20.0/core/drivers/crypto/caam/blob/ |
A D | caam_blob.c | 27 struct caambuf buf = { }; in caam_blob_mkvb_init() local 32 res = caam_calloc_align_buf(&buf, MKVB_SIZE); in caam_blob_mkvb_init() 45 caam_desc_add_ptr(desc, buf.paddr); in caam_blob_mkvb_init() 49 cache_operation(TEE_CACHEFLUSH, buf.data, buf.length); in caam_blob_mkvb_init() 58 cache_operation(TEE_CACHEINVALIDATE, buf.data, MKVB_SIZE); in caam_blob_mkvb_init() 59 BLOB_DUMPBUF("MKVB", buf.data, buf.length); in caam_blob_mkvb_init() 60 memcpy(&stored_key, buf.data, buf.length); in caam_blob_mkvb_init() 66 caam_free_buf(&buf); in caam_blob_mkvb_init()
|