mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-03 16:30:29 +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
5
third_party/mbedtls/platform.h
vendored
5
third_party/mbedtls/platform.h
vendored
|
@ -1,6 +1,7 @@
|
|||
#ifndef COSMOPOLITAN_THIRD_PARTY_MBEDTLS_PLATFORM_H_
|
||||
#define COSMOPOLITAN_THIRD_PARTY_MBEDTLS_PLATFORM_H_
|
||||
#include "libc/assert.h"
|
||||
#include "libc/bits/likely.h"
|
||||
#include "libc/calls/weirdtypes.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/mem/mem.h"
|
||||
|
@ -34,7 +35,7 @@ COSMOPOLITAN_C_START_
|
|||
|
||||
#define MBEDTLS_INTERNAL_VALIDATE_RET(cond, ret) \
|
||||
do { \
|
||||
if (!(cond)) { \
|
||||
if (UNLIKELY(!(cond))) { \
|
||||
MBEDTLS_PARAM_FAILED(cond); \
|
||||
return ret; \
|
||||
} \
|
||||
|
@ -42,7 +43,7 @@ COSMOPOLITAN_C_START_
|
|||
|
||||
#define MBEDTLS_INTERNAL_VALIDATE(cond) \
|
||||
do { \
|
||||
if (!(cond)) { \
|
||||
if (UNLIKELY(!(cond))) { \
|
||||
MBEDTLS_PARAM_FAILED(cond); \
|
||||
return; \
|
||||
} \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue