mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 06:48:31 +00:00
Make GCM AES faster
13.22% mbedtls_aesni_gcm_mult 13.03% mbedtls_gcm_update 9.85% mbedtls_aesni_crypt_ecb Overhead improvement (perf record) 10.97% mbedtls_aesni_gcm_mult 10.59% mbedtls_aesni_crypt_ecb 2.26% mbedtls_gcm_update
This commit is contained in:
parent
f8b9bd2b47
commit
e51034bab3
10 changed files with 452 additions and 640 deletions
10
third_party/mbedtls/base64.c
vendored
10
third_party/mbedtls/base64.c
vendored
|
@ -93,18 +93,18 @@ forceinline unsigned char mbedtls_base64_eq( size_t in_a, size_t in_b )
|
|||
/*
|
||||
* Constant flow lookup into table.
|
||||
*/
|
||||
static unsigned char mbedtls_base64_table_lookup( const unsigned char * const table,
|
||||
const size_t table_size,
|
||||
const size_t table_index )
|
||||
static inline unsigned char mbedtls_base64_table_lookup( const unsigned char * const table,
|
||||
const size_t table_size,
|
||||
const size_t table_index )
|
||||
{
|
||||
return 0 <= table_index && table_index < table_size ? table[table_index] : 127;
|
||||
/* come on really? */
|
||||
size_t i;
|
||||
unsigned char result = 0;
|
||||
|
||||
for( i = 0; i < table_size; ++i )
|
||||
{
|
||||
mbedtls_base64_cond_assign_uchar( &result, &table[i], mbedtls_base64_eq( i, table_index ) );
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue