Home
last modified time | relevance | path

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

1234

/optee_os/core/lib/libtomcrypt/src/encauth/gcm/
A Dgcm_add_aad.c40 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 Dgcm_process.c43 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 Dgcm_add_iv.c42 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 Dgcm_done.c36 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 Dgcm_memory.c104 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 Decc_ssh_ecdsa_encode_name.c25 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 Dpelican.c50 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 Domac_process.c38 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 Domac_done.c38 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 Dpmac_process.c39 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 Dpmac_done.c29 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 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.c296 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 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/core/lib/libtomcrypt/src/mac/xcbc/
A Dxcbc_process.c41 (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 Dxcbc_done.c37 (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 Df9_process.c38 (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 Df9_done.c37 (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 Deax_decrypt_verify_memory.c48 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 Docb3_decrypt_verify_memory.c48 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 Dchacha20poly1305_memory.c60 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 Dbignum.h440 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 Dbignum.h440 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 );

Completed in 33 milliseconds

1234