/optee_os/core/lib/libtomcrypt/src/encauth/gcm/ |
A D | gcm_add_aad.c | 40 if (gcm->buflen > 16 || gcm->buflen < 0) { in gcm_add_aad() 53 if (gcm->ivmode || gcm->buflen != 12) { in gcm_add_aad() 54 for (x = 0; x < (unsigned long)gcm->buflen; x++) { in gcm_add_aad() 57 if (gcm->buflen) { in gcm_add_aad() 58 gcm->totlen += gcm->buflen * CONST64(8); in gcm_add_aad() 82 gcm->buflen = 0; in gcm_add_aad() 87 if (gcm->mode != LTC_GCM_MODE_AAD || gcm->buflen >= 16) { in gcm_add_aad() 93 if (gcm->buflen == 0) { in gcm_add_aad() 108 gcm->X[gcm->buflen++] ^= *adata++; in gcm_add_aad() 110 if (gcm->buflen == 16) { in gcm_add_aad() [all …]
|
A D | gcm_process.c | 43 if (gcm->buflen > 16 || gcm->buflen < 0) { in gcm_process() 52 if (gcm->pttotlen / 8 + (ulong64)gcm->buflen + (ulong64)ptlen >= CONST64(0xFFFFFFFE0)) { in gcm_process() 64 if (gcm->buflen) { in gcm_process() 65 gcm->totlen += gcm->buflen * CONST64(8); in gcm_process() 78 gcm->buflen = 0; in gcm_process() 88 if (gcm->buflen == 0) { in gcm_process() 131 if (gcm->buflen == 16) { in gcm_process() 142 gcm->buflen = 0; in gcm_process() 146 b = ct[x] = pt[x] ^ gcm->buf[gcm->buflen]; in gcm_process() 149 pt[x] = ct[x] ^ gcm->buf[gcm->buflen]; in gcm_process() [all …]
|
A D | gcm_add_iv.c | 42 if (gcm->buflen >= 16 || gcm->buflen < 0) { in gcm_add_iv() 52 if (IVlen + gcm->buflen > 12) { in gcm_add_iv() 58 if (gcm->buflen == 0) { in gcm_add_iv() 72 gcm->buf[gcm->buflen++] = *IV++; in gcm_add_iv() 74 if (gcm->buflen == 16) { in gcm_add_iv() 80 gcm->buflen = 0; in gcm_add_iv()
|
A D | gcm_done.c | 36 if (gcm->buflen > 16 || gcm->buflen < 0) { in gcm_done() 59 if (gcm->buflen) { in gcm_done() 60 gcm->pttotlen += gcm->buflen * CONST64(8); in gcm_done()
|
A D | gcm_memory.c | 104 unsigned long buflen = sizeof(buf); in gcm_memory() local 105 if ((err = gcm_done(gcm, buf, &buflen)) != CRYPT_OK) { in gcm_memory() 108 if (buflen != *taglen || XMEM_NEQ(buf, tag, buflen) != 0) { in gcm_memory()
|
/optee_os/core/lib/libtomcrypt/src/pk/ecc/ |
A D | ecc_ssh_ecdsa_encode_name.c | 25 int ecc_ssh_ecdsa_encode_name(char *buffer, unsigned long *buflen, const ecc_key *key) in ecc_ssh_ecdsa_encode_name() argument 33 LTC_ARGCHK(buflen != NULL); in ecc_ssh_ecdsa_encode_name() 42 size = snprintf(buffer, *buflen, "ecdsa-sha2-nistp256"); in ecc_ssh_ecdsa_encode_name() 46 size = snprintf(buffer, *buflen, "ecdsa-sha2-nistp384"); in ecc_ssh_ecdsa_encode_name() 50 size = snprintf(buffer, *buflen, "ecdsa-sha2-nistp521"); in ecc_ssh_ecdsa_encode_name() 53 size = snprintf(buffer, *buflen, "ecdsa-sha2-%s", oidstr); in ecc_ssh_ecdsa_encode_name() 57 if (size >= *buflen) { in ecc_ssh_ecdsa_encode_name() 62 *buflen = size + 1; /* the string length + NUL byte */ in ecc_ssh_ecdsa_encode_name()
|
/optee_os/core/lib/libtomcrypt/src/mac/pelican/ |
A D | pelican.c | 50 pelmac->buflen = 0; in pelican_init() 107 if (pelmac->buflen < 0 || pelmac->buflen > 15) { in pelican_process() 112 if (pelmac->buflen == 0) { in pelican_process() 126 pelmac->state[pelmac->buflen++] ^= *in++; in pelican_process() 127 if (pelmac->buflen == 16) { in pelican_process() 129 pelmac->buflen = 0; in pelican_process() 147 if (pelmac->buflen < 0 || pelmac->buflen > 16) { in pelican_done() 151 if (pelmac->buflen == 16) { in pelican_done() 153 pelmac->buflen = 0; in pelican_done() 155 pelmac->state[pelmac->buflen++] ^= 0x80; in pelican_done()
|
/optee_os/core/lib/libtomcrypt/src/mac/omac/ |
A D | omac_process.c | 38 if ((omac->buflen > (int)sizeof(omac->block)) || (omac->buflen < 0) || in omac_process() 39 (omac->blklen > (int)sizeof(omac->block)) || (omac->buflen > omac->blklen)) { in omac_process() 47 if (omac->buflen == 0 && inlen > blklen) { in omac_process() 65 if (omac->buflen == omac->blklen) { in omac_process() 72 omac->buflen = 0; in omac_process() 76 n = MIN(inlen, (unsigned long)(omac->blklen - omac->buflen)); in omac_process() 77 XMEMCPY(omac->block + omac->buflen, in, n); in omac_process() 78 omac->buflen += n; in omac_process()
|
A D | omac_done.c | 38 if ((omac->buflen > (int)sizeof(omac->block)) || (omac->buflen < 0) || in omac_done() 39 (omac->blklen > (int)sizeof(omac->block)) || (omac->buflen > omac->blklen)) { in omac_done() 44 if (omac->buflen != omac->blklen) { in omac_done() 46 omac->block[omac->buflen++] = 0x80; in omac_done() 49 while (omac->buflen < omac->blklen) { in omac_done() 50 omac->block[omac->buflen++] = 0x00; in omac_done()
|
/optee_os/core/lib/libtomcrypt/src/mac/pmac/ |
A D | pmac_process.c | 39 if ((pmac->buflen > (int)sizeof(pmac->block)) || (pmac->buflen < 0) || in pmac_process() 40 (pmac->block_len > (int)sizeof(pmac->block)) || (pmac->buflen > pmac->block_len)) { in pmac_process() 45 if (pmac->buflen == 0 && inlen > 16) { in pmac_process() 66 if (pmac->buflen == pmac->block_len) { in pmac_process() 77 pmac->buflen = 0; in pmac_process() 81 n = MIN(inlen, (unsigned long)(pmac->block_len - pmac->buflen)); in pmac_process() 82 XMEMCPY(pmac->block + pmac->buflen, in, n); in pmac_process() 83 pmac->buflen += n; in pmac_process()
|
A D | pmac_done.c | 29 if ((pmac->buflen > (int)sizeof(pmac->block)) || (pmac->buflen < 0) || in pmac_done() 30 (pmac->block_len > (int)sizeof(pmac->block)) || (pmac->buflen > pmac->block_len)) { in pmac_done() 37 if (pmac->buflen == pmac->block_len) { in pmac_done() 44 for (x = 0; x < pmac->buflen; x++) { in pmac_done()
|
/optee_os/lib/libmbedtls/mbedtls/library/ |
A D | entropy_poll.c | 99 static int getrandom_wrapper( void *buf, size_t buflen, unsigned int flags ) in getrandom_wrapper() argument 104 memset( buf, 0, buflen ); in getrandom_wrapper() 107 return( syscall( SYS_getrandom, buf, buflen, flags ) ); in getrandom_wrapper() 119 static int getrandom_wrapper( void *buf, size_t buflen, unsigned int flags ) in getrandom_wrapper() argument 121 return getrandom( buf, buflen, flags ); in getrandom_wrapper() 141 static int sysctl_arnd_wrapper( unsigned char *buf, size_t buflen ) in sysctl_arnd_wrapper() argument 149 while( buflen > 0 ) in sysctl_arnd_wrapper() 151 len = buflen > 256 ? 256 : buflen; in sysctl_arnd_wrapper() 154 buflen -= len; in sysctl_arnd_wrapper()
|
A D | error.c | 896 void mbedtls_strerror( int ret, char *buf, size_t buflen ) in mbedtls_strerror() argument 903 if( buflen == 0 ) in mbedtls_strerror() 906 memset( buf, 0x00, buflen ); in mbedtls_strerror() 921 mbedtls_snprintf( buf, buflen, "%s", high_level_error_description ); in mbedtls_strerror() 943 if( buflen - len < 5 ) in mbedtls_strerror() 946 mbedtls_snprintf( buf + len, buflen - len, " : " ); in mbedtls_strerror() 949 buflen -= len + 3; in mbedtls_strerror() 956 mbedtls_snprintf( buf, buflen, "UNKNOWN ERROR CODE (%04X)", (unsigned int) use_ret ); in mbedtls_strerror() 958 mbedtls_snprintf( buf, buflen, "%s", low_level_error_description ); in mbedtls_strerror() 966 void mbedtls_strerror( int ret, char *buf, size_t buflen ) in mbedtls_strerror() argument [all …]
|
A D | x509_csr.c | 86 const unsigned char *buf, size_t buflen ) in mbedtls_x509_csr_parse_der() argument 98 if( csr == NULL || buf == NULL || buflen == 0 ) in mbedtls_x509_csr_parse_der() 106 p = mbedtls_calloc( 1, len = buflen ); in mbedtls_x509_csr_parse_der() 111 memcpy( p, buf, buflen ); in mbedtls_x509_csr_parse_der() 257 int mbedtls_x509_csr_parse( mbedtls_x509_csr *csr, const unsigned char *buf, size_t buflen ) in mbedtls_x509_csr_parse() argument 268 if( csr == NULL || buf == NULL || buflen == 0 ) in mbedtls_x509_csr_parse() 273 if( buf[buflen - 1] == '\0' ) in mbedtls_x509_csr_parse() 293 ret = mbedtls_x509_csr_parse_der( csr, pem.buf, pem.buflen ); in mbedtls_x509_csr_parse() 301 return( mbedtls_x509_csr_parse_der( csr, buf, buflen ) ); in mbedtls_x509_csr_parse()
|
A D | x509_crl.c | 296 const unsigned char *buf, size_t buflen ) in mbedtls_x509_crl_parse_der() argument 337 if( buflen == 0 ) in mbedtls_x509_crl_parse_der() 340 p = mbedtls_calloc( 1, buflen ); in mbedtls_x509_crl_parse_der() 344 memcpy( p, buf, buflen ); in mbedtls_x509_crl_parse_der() 347 crl->raw.len = buflen; in mbedtls_x509_crl_parse_der() 349 end = p + buflen; in mbedtls_x509_crl_parse_der() 551 if( buflen == 0 || buf[buflen - 1] != '\0' ) in mbedtls_x509_crl_parse() 566 buflen -= use_len; in mbedtls_x509_crl_parse() 570 pem.buf, pem.buflen ) ) != 0 ) in mbedtls_x509_crl_parse() 586 while( is_pem && buflen > 1 ); in mbedtls_x509_crl_parse() [all …]
|
A D | pem.c | 139 unsigned char *buf, size_t buflen, in pem_des_decrypt() argument 153 ret = mbedtls_des_crypt_cbc( &des_ctx, MBEDTLS_DES_DECRYPT, buflen, in pem_des_decrypt() 167 unsigned char *buf, size_t buflen, in pem_des3_decrypt() argument 181 ret = mbedtls_des3_crypt_cbc( &des3_ctx, MBEDTLS_DES_DECRYPT, buflen, in pem_des3_decrypt() 197 unsigned char *buf, size_t buflen, in pem_aes_decrypt() argument 211 ret = mbedtls_aes_crypt_cbc( &aes_ctx, MBEDTLS_AES_DECRYPT, buflen, in pem_aes_decrypt() 414 ctx->buflen = len; in mbedtls_pem_read_buffer() 423 mbedtls_platform_zeroize( ctx->buf, ctx->buflen ); in mbedtls_pem_free()
|
/optee_os/core/lib/libtomcrypt/src/mac/xcbc/ |
A D | xcbc_process.c | 41 (xcbc->buflen > xcbc->blocksize) || (xcbc->buflen < 0)) { in xcbc_process() 46 if (xcbc->buflen == 0) { in xcbc_process() 59 if (xcbc->buflen == xcbc->blocksize) { in xcbc_process() 61 xcbc->buflen = 0; in xcbc_process() 63 xcbc->IV[xcbc->buflen++] ^= *in++; in xcbc_process()
|
A D | xcbc_done.c | 37 (xcbc->buflen > xcbc->blocksize) || (xcbc->buflen < 0)) { in xcbc_done() 42 if (xcbc->buflen == xcbc->blocksize) { in xcbc_done() 48 xcbc->IV[xcbc->buflen] ^= 0x80; in xcbc_done()
|
/optee_os/core/lib/libtomcrypt/src/mac/f9/ |
A D | f9_process.c | 38 (f9->buflen > f9->blocksize) || (f9->buflen < 0)) { in f9_process() 43 if (f9->buflen == 0) { in f9_process() 59 if (f9->buflen == f9->blocksize) { in f9_process() 64 f9->buflen = 0; in f9_process() 66 f9->IV[f9->buflen++] ^= *in++; in f9_process()
|
A D | f9_done.c | 37 (f9->buflen > f9->blocksize) || (f9->buflen < 0)) { in f9_done() 41 if (f9->buflen != 0) { in f9_done() 44 f9->buflen = 0; in f9_done()
|
/optee_os/core/lib/libtomcrypt/src/encauth/eax/ |
A D | eax_decrypt_verify_memory.c | 48 unsigned long buflen; in eax_decrypt_verify_memory() local 83 buflen = taglen; in eax_decrypt_verify_memory() 84 if ((err = eax_done(eax, buf, &buflen)) != CRYPT_OK) { in eax_decrypt_verify_memory() 89 if (buflen >= taglen && XMEM_NEQ(buf, tag, taglen) == 0) { in eax_decrypt_verify_memory()
|
/optee_os/core/lib/libtomcrypt/src/encauth/ocb3/ |
A D | ocb3_decrypt_verify_memory.c | 48 unsigned long buflen; in ocb3_decrypt_verify_memory() local 85 buflen = taglen; in ocb3_decrypt_verify_memory() 86 if ((err = ocb3_done(ocb, buf, &buflen)) != CRYPT_OK) { in ocb3_decrypt_verify_memory() 91 if (buflen >= taglen && XMEM_NEQ(buf, tag, taglen) == 0) { in ocb3_decrypt_verify_memory()
|
/optee_os/core/lib/libtomcrypt/src/encauth/chachapoly/ |
A D | chacha20poly1305_memory.c | 60 unsigned long buflen = sizeof(buf); in chacha20poly1305_memory() local 62 if ((err = chacha20poly1305_done(&st, buf, &buflen)) != CRYPT_OK) { goto LBL_ERR; } in chacha20poly1305_memory() 63 if (buflen != *taglen || XMEM_NEQ(buf, tag, buflen) != 0) { in chacha20poly1305_memory()
|
/optee_os/out/arm/export-ta_arm32/host_include/mbedtls/ |
A D | bignum.h | 440 char *buf, size_t buflen, size_t *olen ); 498 size_t buflen ); 513 const unsigned char *buf, size_t buflen ); 531 size_t buflen ); 549 unsigned char *buf, size_t buflen );
|
/optee_os/out/arm/export-ta_arm32/include/mbedtls/ |
A D | bignum.h | 440 char *buf, size_t buflen, size_t *olen ); 498 size_t buflen ); 513 const unsigned char *buf, size_t buflen ); 531 size_t buflen ); 549 unsigned char *buf, size_t buflen );
|