summaryrefslogtreecommitdiffhomepage
path: root/networking/tls.h
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2021-04-26 13:25:56 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2021-04-26 13:30:09 +0200
commitf18a1fd6f368ada05b33cf36483304a5e3c4945d (patch)
tree433a988ac92ba89af647eb168c6c781c6d05cc03 /networking/tls.h
parent121b02d6b6c9f276e7f8da560e5996d3e389cd63 (diff)
tls: implement secp256r1 elliptic curve (aka P256)
function old new delta sp_256_mod_mul_norm_10 - 1439 +1439 sp_256_ecc_mulmod_10 - 1363 +1363 sp_256_proj_point_dbl_10 - 490 +490 p256_base - 244 +244 static.sp_256_mont_sqr_10 - 234 +234 static.sp_256_mont_mul_10 - 214 +214 curve_P256_compute_pubkey_and_premaster - 197 +197 static.sp_256_mont_reduce_10 - 176 +176 static.sp_256_from_bin - 149 +149 sp_256_to_bin - 148 +148 tls_handshake 2046 2146 +100 static.sp_256_mul_add_10 - 82 +82 .rodata 103275 103336 +61 static.sp_256_mont_sub_10 - 52 +52 static.sp_256_mont_dbl_10 - 52 +52 static.sp_256_cmp_10 - 43 +43 p256_mod - 40 +40 static.sp_256_cond_sub_10 - 32 +32 p256_mod_2 - 32 +32 sp_256_norm_10 - 31 +31 sp_256_cmp_equal_10 - 30 +30 sp_256_add_10 - 22 +22 addr_mask - 8 +8 ------------------------------------------------------------------------------ (add/remove: 22/0 grow/shrink: 2/0 up/down: 5239/0) Total: 5239 bytes text data bss dec hex filename 1018192 559 5020 1023771 f9f1b busybox_old 1023431 559 5020 1029010 fb392 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/tls.h')
-rw-r--r--networking/tls.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/networking/tls.h b/networking/tls.h
index d4ac1bef8..e1afb7ea8 100644
--- a/networking/tls.h
+++ b/networking/tls.h
@@ -106,3 +106,11 @@ void xorbuf_aligned_AES_BLOCK_SIZE(void* buf, const void* mask) FAST_FUNC;
#include "tls_aesgcm.h"
#include "tls_rsa.h"
#include "tls_fe.h"
+
+#define EC_CURVE_KEYSIZE 32
+#define P256_KEYSIZE 32
+#define CURVE25519_KEYSIZE 32
+
+void curve_P256_compute_pubkey_and_premaster(
+ uint8_t *pubkey, uint8_t *premaster,
+ const uint8_t *peerkey32) FAST_FUNC;