/optee_os-3.20.0/core/lib/libtomcrypt/src/pk/ecc/ |
A D | ecc_ssh_ecdsa_encode_name.c | 20 int ecc_ssh_ecdsa_encode_name(char *buffer, unsigned long *buflen, const ecc_key *key) in ecc_ssh_ecdsa_encode_name() argument 27 LTC_ARGCHK(buflen != NULL); in ecc_ssh_ecdsa_encode_name() 36 size = snprintf(buffer, *buflen, "ecdsa-sha2-nistp256"); in ecc_ssh_ecdsa_encode_name() 40 size = snprintf(buffer, *buflen, "ecdsa-sha2-nistp384"); in ecc_ssh_ecdsa_encode_name() 44 size = snprintf(buffer, *buflen, "ecdsa-sha2-nistp521"); in ecc_ssh_ecdsa_encode_name() 47 size = snprintf(buffer, *buflen, "ecdsa-sha2-%s", oidstr); in ecc_ssh_ecdsa_encode_name() 54 } else if ((unsigned)size >= *buflen) { in ecc_ssh_ecdsa_encode_name() 59 *buflen = size + 1; /* the string length + NUL byte */ in ecc_ssh_ecdsa_encode_name()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/encauth/gcm/ |
A D | gcm_add_aad.c | 33 if (gcm->buflen > 16 || gcm->buflen < 0) { in gcm_add_aad() 46 if (gcm->ivmode || gcm->buflen != 12) { in gcm_add_aad() 47 for (x = 0; x < (unsigned long)gcm->buflen; x++) { in gcm_add_aad() 50 if (gcm->buflen) { in gcm_add_aad() 51 gcm->totlen += gcm->buflen * CONST64(8); in gcm_add_aad() 75 gcm->buflen = 0; in gcm_add_aad() 80 if (gcm->mode != LTC_GCM_MODE_AAD || gcm->buflen >= 16) { in gcm_add_aad() 86 if (gcm->buflen == 0 && adatalen > 15) { in gcm_add_aad() 101 gcm->X[gcm->buflen++] ^= *adata++; in gcm_add_aad() 103 if (gcm->buflen == 16) { in gcm_add_aad() [all …]
|
A D | gcm_add_iv.c | 35 if (gcm->buflen >= 16 || gcm->buflen < 0) { in gcm_add_iv() 45 if (IVlen + gcm->buflen > 12) { in gcm_add_iv() 51 if (gcm->buflen == 0) { in gcm_add_iv() 65 gcm->buf[gcm->buflen++] = *IV++; in gcm_add_iv() 67 if (gcm->buflen == 16) { in gcm_add_iv() 73 gcm->buflen = 0; in gcm_add_iv()
|
A D | gcm_process.c | 36 if (gcm->buflen > 16 || gcm->buflen < 0) { in gcm_process() 45 if (gcm->pttotlen / 8 + (ulong64)gcm->buflen + (ulong64)ptlen >= CONST64(0xFFFFFFFE0)) { in gcm_process() 57 if (gcm->buflen) { in gcm_process() 58 gcm->totlen += gcm->buflen * CONST64(8); in gcm_process() 71 gcm->buflen = 0; in gcm_process() 81 if (gcm->buflen == 0) { in gcm_process() 124 if (gcm->buflen == 16) { in gcm_process() 135 gcm->buflen = 0; in gcm_process() 139 b = ct[x] = pt[x] ^ gcm->buf[gcm->buflen]; in gcm_process() 142 pt[x] = ct[x] ^ gcm->buf[gcm->buflen]; in gcm_process() [all …]
|
A D | gcm_done.c | 29 if (gcm->buflen > 16 || gcm->buflen < 0) { in gcm_done() 52 if (gcm->buflen) { in gcm_done() 53 gcm->pttotlen += gcm->buflen * CONST64(8); in gcm_done()
|
A D | gcm_memory.c | 97 unsigned long buflen = sizeof(buf); in gcm_memory() local 98 if ((err = gcm_done(gcm, buf, &buflen)) != CRYPT_OK) { in gcm_memory() 101 if (buflen != *taglen || XMEM_NEQ(buf, tag, buflen) != 0) { in gcm_memory()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/mac/omac/ |
A D | omac_process.c | 31 if ((omac->buflen > (int)sizeof(omac->block)) || (omac->buflen < 0) || in omac_process() 32 (omac->blklen > (int)sizeof(omac->block)) || (omac->buflen > omac->blklen)) { in omac_process() 40 if (omac->buflen == 0 && inlen > blklen) { in omac_process() 58 if (omac->buflen == omac->blklen) { in omac_process() 65 omac->buflen = 0; in omac_process() 69 n = MIN(inlen, (unsigned long)(omac->blklen - omac->buflen)); in omac_process() 70 XMEMCPY(omac->block + omac->buflen, in, n); in omac_process() 71 omac->buflen += n; in omac_process()
|
A D | omac_done.c | 31 if ((omac->buflen > (int)sizeof(omac->block)) || (omac->buflen < 0) || in omac_done() 32 (omac->blklen > (int)sizeof(omac->block)) || (omac->buflen > omac->blklen)) { in omac_done() 37 if (omac->buflen != omac->blklen) { in omac_done() 39 omac->block[omac->buflen++] = 0x80; in omac_done() 42 while (omac->buflen < omac->blklen) { in omac_done() 43 omac->block[omac->buflen++] = 0x00; in omac_done()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/mac/pelican/ |
A D | pelican.c | 43 pelmac->buflen = 0; in pelican_init() 100 if (pelmac->buflen < 0 || pelmac->buflen > 15) { in pelican_process() 105 if (pelmac->buflen == 0) { in pelican_process() 119 pelmac->state[pelmac->buflen++] ^= *in++; in pelican_process() 120 if (pelmac->buflen == 16) { in pelican_process() 122 pelmac->buflen = 0; in pelican_process() 140 if (pelmac->buflen < 0 || pelmac->buflen > 16) { in pelican_done() 144 if (pelmac->buflen == 16) { in pelican_done() 146 pelmac->buflen = 0; in pelican_done() 148 pelmac->state[pelmac->buflen++] ^= 0x80; in pelican_done()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/mac/pmac/ |
A D | pmac_process.c | 32 if ((pmac->buflen > (int)sizeof(pmac->block)) || (pmac->buflen < 0) || in pmac_process() 33 (pmac->block_len > (int)sizeof(pmac->block)) || (pmac->buflen > pmac->block_len)) { in pmac_process() 38 if (pmac->buflen == 0 && inlen > 16) { in pmac_process() 59 if (pmac->buflen == pmac->block_len) { in pmac_process() 70 pmac->buflen = 0; in pmac_process() 74 n = MIN(inlen, (unsigned long)(pmac->block_len - pmac->buflen)); in pmac_process() 75 XMEMCPY(pmac->block + pmac->buflen, in, n); in pmac_process() 76 pmac->buflen += n; in pmac_process()
|
A D | pmac_done.c | 22 if ((pmac->buflen > (int)sizeof(pmac->block)) || (pmac->buflen < 0) || in pmac_done() 23 (pmac->block_len > (int)sizeof(pmac->block)) || (pmac->buflen > pmac->block_len)) { in pmac_done() 30 if (pmac->buflen == pmac->block_len) { in pmac_done() 37 for (x = 0; x < pmac->buflen; x++) { in pmac_done()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/mac/xcbc/ |
A D | xcbc_process.c | 34 (xcbc->buflen > xcbc->blocksize) || (xcbc->buflen < 0)) { in xcbc_process() 39 if (xcbc->buflen == 0) { in xcbc_process() 52 if (xcbc->buflen == xcbc->blocksize) { in xcbc_process() 54 xcbc->buflen = 0; in xcbc_process() 56 xcbc->IV[xcbc->buflen++] ^= *in++; in xcbc_process()
|
A D | xcbc_done.c | 30 (xcbc->buflen > xcbc->blocksize) || (xcbc->buflen < 0)) { in xcbc_done() 35 if (xcbc->buflen == xcbc->blocksize) { in xcbc_done() 41 xcbc->IV[xcbc->buflen] ^= 0x80; in xcbc_done()
|
/optee_os-3.20.0/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 | 298 const unsigned char *buf, size_t buflen ) in mbedtls_x509_crl_parse_der() argument 339 if( buflen == 0 ) in mbedtls_x509_crl_parse_der() 342 p = mbedtls_calloc( 1, buflen ); in mbedtls_x509_crl_parse_der() 346 memcpy( p, buf, buflen ); in mbedtls_x509_crl_parse_der() 349 crl->raw.len = buflen; in mbedtls_x509_crl_parse_der() 351 end = p + buflen; in mbedtls_x509_crl_parse_der() 553 if( buflen == 0 || buf[buflen - 1] != '\0' ) in mbedtls_x509_crl_parse() 568 buflen -= use_len; in mbedtls_x509_crl_parse() 572 pem.buf, pem.buflen ) ) != 0 ) in mbedtls_x509_crl_parse() 588 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-3.20.0/core/lib/libtomcrypt/src/mac/f9/ |
A D | f9_process.c | 31 (f9->buflen > f9->blocksize) || (f9->buflen < 0)) { in f9_process() 36 if (f9->buflen == 0) { in f9_process() 52 if (f9->buflen == f9->blocksize) { in f9_process() 57 f9->buflen = 0; in f9_process() 59 f9->IV[f9->buflen++] ^= *in++; in f9_process()
|
A D | f9_done.c | 30 (f9->buflen > f9->blocksize) || (f9->buflen < 0)) { in f9_done() 34 if (f9->buflen != 0) { in f9_done() 37 f9->buflen = 0; in f9_done()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/encauth/eax/ |
A D | eax_decrypt_verify_memory.c | 41 unsigned long buflen; in eax_decrypt_verify_memory() local 76 buflen = taglen; in eax_decrypt_verify_memory() 77 if ((err = eax_done(eax, buf, &buflen)) != CRYPT_OK) { in eax_decrypt_verify_memory() 82 if (buflen >= taglen && XMEM_NEQ(buf, tag, taglen) == 0) { in eax_decrypt_verify_memory()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/encauth/ocb3/ |
A D | ocb3_decrypt_verify_memory.c | 41 unsigned long buflen; in ocb3_decrypt_verify_memory() local 78 buflen = taglen; in ocb3_decrypt_verify_memory() 79 if ((err = ocb3_done(ocb, buf, &buflen)) != CRYPT_OK) { in ocb3_decrypt_verify_memory() 84 if (buflen >= taglen && XMEM_NEQ(buf, tag, taglen) == 0) { in ocb3_decrypt_verify_memory()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/encauth/chachapoly/ |
A D | chacha20poly1305_memory.c | 53 unsigned long buflen = sizeof(buf); in chacha20poly1305_memory() local 55 if ((err = chacha20poly1305_done(&st, buf, &buflen)) != CRYPT_OK) { goto LBL_ERR; } in chacha20poly1305_memory() 56 if (buflen != *taglen || XMEM_NEQ(buf, tag, buflen) != 0) { in chacha20poly1305_memory()
|
/optee_os-3.20.0/lib/libmbedtls/mbedtls/include/mbedtls/ |
A D | x509_crl.h | 108 const unsigned char *buf, size_t buflen ); 121 int mbedtls_x509_crl_parse( mbedtls_x509_crl *chain, const unsigned char *buf, size_t buflen );
|
A D | x509_csr.h | 94 const unsigned char *buf, size_t buflen ); 108 int mbedtls_x509_csr_parse( mbedtls_x509_csr *csr, const unsigned char *buf, size_t buflen );
|