From 83e5c627e1b2c7f34d694696d0c3d5a3ce25dc59 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 23 Nov 2018 17:21:38 +0100 Subject: tls: add support for TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 cipher function old new delta xwrite_encrypted 209 605 +396 GHASH - 395 +395 aes_encrypt_1 - 382 +382 GMULT - 192 +192 tls_xread_record 489 659 +170 aes_encrypt_one_block - 65 +65 aesgcm_setkey - 58 +58 FlattenSzInBits - 52 +52 tls_handshake 1890 1941 +51 xwrite_and_update_handshake_hash 46 81 +35 xorbuf - 24 +24 aes_setkey - 16 +16 psRsaEncryptPub 413 421 +8 stty_main 1221 1227 +6 ssl_client_main 138 143 +5 next_token 841 845 +4 spawn_ssl_client 218 219 +1 volume_id_probe_hfs_hfsplus 564 563 -1 read_package_field 232 230 -2 i2cdetect_main 674 672 -2 fail_hunk 139 136 -3 parse_expr 891 883 -8 curve25519 802 793 -9 aes_cbc_decrypt 971 958 -13 xwrite_handshake_record 43 - -43 aes_cbc_encrypt 644 172 -472 ------------------------------------------------------------------------------ (add/remove: 9/1 grow/shrink: 9/8 up/down: 1860/-553) Total: 1307 bytes Signed-off-by: Denys Vlasenko --- networking/tls_aesgcm.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 networking/tls_aesgcm.h (limited to 'networking/tls_aesgcm.h') diff --git a/networking/tls_aesgcm.h b/networking/tls_aesgcm.h new file mode 100644 index 000000000..d4cde01f9 --- /dev/null +++ b/networking/tls_aesgcm.h @@ -0,0 +1,15 @@ +/* + * Copyright (C) 2018 Denys Vlasenko + * + * Licensed under GPLv2, see file LICENSE in this source tree. + */ + +void xorbuf(void* buf, const void* mask, unsigned count) FAST_FUNC; + +void aesgcm_GHASH(uint8_t* h, + const uint8_t* a, unsigned aSz, + const uint8_t* c, unsigned cSz, + uint8_t* s, unsigned sSz +) FAST_FUNC; + +void aesgcm_setkey(uint8_t H[16], struct tls_aes *aes, const uint8_t* key, unsigned len) FAST_FUNC; -- cgit v1.2.3