Home
last modified time | relevance | path

Searched refs:buflen (Results 1 – 25 of 53) sorted by relevance

123

/optee_os-3.20.0/core/lib/libtomcrypt/src/pk/ecc/
A Decc_ssh_ecdsa_encode_name.c20 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 Dgcm_add_aad.c33 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 Dgcm_add_iv.c35 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 Dgcm_process.c36 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 Dgcm_done.c29 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 Dgcm_memory.c97 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 Domac_process.c31 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 Domac_done.c31 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 Dpelican.c43 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 Dpmac_process.c32 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 Dpmac_done.c22 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 Dxcbc_process.c34 (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 Dxcbc_done.c30 (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 Dentropy_poll.c99 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 Derror.c896 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 Dx509_csr.c86 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 Dx509_crl.c298 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 Dpem.c139 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 Df9_process.c31 (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 Df9_done.c30 (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 Deax_decrypt_verify_memory.c41 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 Docb3_decrypt_verify_memory.c41 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 Dchacha20poly1305_memory.c53 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 Dx509_crl.h108 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 Dx509_csr.h94 const unsigned char *buf, size_t buflen );
108 int mbedtls_x509_csr_parse( mbedtls_x509_csr *csr, const unsigned char *buf, size_t buflen );

Completed in 32 milliseconds

123