mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-28 15:28:30 +00:00
Make redbean ssl handshake go a little faster
This commit is contained in:
parent
87222aad35
commit
74200a0ea0
6 changed files with 33 additions and 18 deletions
12
third_party/mbedtls/base64.c
vendored
12
third_party/mbedtls/base64.c
vendored
|
@ -54,9 +54,9 @@ static const unsigned char base64_dec_map[128] =
|
|||
/*
|
||||
* Constant flow conditional assignment to unsigned char
|
||||
*/
|
||||
static void mbedtls_base64_cond_assign_uchar( unsigned char * dest,
|
||||
const unsigned char * const src,
|
||||
unsigned char condition )
|
||||
forceinline void mbedtls_base64_cond_assign_uchar( unsigned char * dest,
|
||||
const unsigned char * const src,
|
||||
unsigned char condition )
|
||||
{
|
||||
/* Generate bitmask from condition, mask will either be 0xFF or 0 */
|
||||
unsigned char mask = ( condition | -condition );
|
||||
|
@ -68,8 +68,8 @@ static void mbedtls_base64_cond_assign_uchar( unsigned char * dest,
|
|||
/*
|
||||
* Constant flow conditional assignment to uint_32
|
||||
*/
|
||||
static void mbedtls_base64_cond_assign_uint32( uint32_t * dest, const uint32_t src,
|
||||
uint32_t condition )
|
||||
forceinline void mbedtls_base64_cond_assign_uint32( uint32_t * dest, const uint32_t src,
|
||||
uint32_t condition )
|
||||
{
|
||||
/* Generate bitmask from condition, mask will either be 0xFFFFFFFF or 0 */
|
||||
uint32_t mask = ( condition | -condition );
|
||||
|
@ -81,7 +81,7 @@ static void mbedtls_base64_cond_assign_uint32( uint32_t * dest, const uint32_t s
|
|||
/*
|
||||
* Constant flow check for equality
|
||||
*/
|
||||
static unsigned char mbedtls_base64_eq( size_t in_a, size_t in_b )
|
||||
forceinline unsigned char mbedtls_base64_eq( size_t in_a, size_t in_b )
|
||||
{
|
||||
size_t difference = in_a ^ in_b;
|
||||
difference |= -difference;
|
||||
|
|
5
third_party/mbedtls/everest.c
vendored
5
third_party/mbedtls/everest.c
vendored
|
@ -36,6 +36,11 @@ asm(".include \"libc/disclaimer.inc\"");
|
|||
|
||||
#if defined(MBEDTLS_ECDH_C) && defined(MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED)
|
||||
|
||||
#ifdef memcpy
|
||||
#undef memcpy
|
||||
#endif
|
||||
#define memcpy(x,y,z) __builtin_memcpy(x,y,z)
|
||||
|
||||
#define load64_le(b) READ64LE(b)
|
||||
#define store64_le(b, i) WRITE64LE(b, i)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue