summaryrefslogtreecommitdiff
path: root/networking/tls_sp_c32.c
AgeCommit message (Collapse)Author
2021-04-27tls: tweak sp_256_ecc_gen_k_10 for smaller codeDenys Vlasenko
function old new delta curve_P256_compute_pubkey_and_premaster 194 191 -3 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-04-27tls: shrink sp_256_mod_mul_norm_10 moreDenys Vlasenko
function old new delta sp_256_mod_mul_norm_10 1439 1305 -134 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-04-27tls: shrink sp_256_mod_mul_norm_10Denys Vlasenko
function old new delta sp_256_mod_mul_norm_10 1439 1405 -34 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-04-27tls: shrink p256_base moreDenys Vlasenko
function old new delta static.p256_base_bin - 64 +64 sp_256_point_from_bin2x32 - 62 +62 static.base_y 40 - -40 static.base_x 40 - -40 curve_P256_compute_pubkey_and_premaster 291 194 -97 ------------------------------------------------------------------------------ (add/remove: 2/2 grow/shrink: 0/1 up/down: 126/-177) Total: -51 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-04-27tls: shrink p256_baseDenys Vlasenko
function old new delta curve_P256_compute_pubkey_and_premaster 196 291 +95 static.base_y - 40 +40 static.base_x - 40 +40 p256_base 244 - -244 ------------------------------------------------------------------------------ (add/remove: 2/1 grow/shrink: 1/0 up/down: 175/-244) Total: -69 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-04-27tls: reorder P256 functions to make more senseDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-04-27tls: whitespace fixesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-04-26tls: get rid of constant-time add/sub operationsDenys Vlasenko
function old new delta sp_256_sub_10 - 22 +22 static.sp_256_mont_reduce_10 176 178 +2 sp_256_mod_mul_norm_10 1440 1439 -1 sp_256_proj_point_dbl_10 453 446 -7 sp_256_ecc_mulmod_10 1229 1216 -13 static.sp_256_mont_sub_10 52 30 -22 static.sp_256_cond_sub_10 32 - -32 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 1/4 up/down: 24/-75) Total: -51 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-04-26tls: fix whitespace in P256 codeDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-04-26tls: shrink sp_256_mont_inv_10Denys Vlasenko
function old new delta sp_256_ecc_mulmod_10 1237 1251 +14 p256_mod_2 32 - -32 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 1/0 up/down: 14/-32) Total: -18 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-04-26tls: stop passing temporary buffer address in P256 codeDenys Vlasenko
function old new delta sp_256_proj_point_dbl_10 435 453 +18 sp_256_ecc_mulmod_10 1300 1237 -63 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 18/-63) Total: -45 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-04-26tls: shrink sp_256_proj_point_dbl_10Denys Vlasenko
function old new delta sp_256_ecc_mulmod_10 1329 1300 -29 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-04-26tls: in P256 replace constant-time compares with usual onesDenys Vlasenko
function old new delta sp_256_cmp_10 - 24 +24 sp_256_ecc_mulmod_10 1332 1329 -3 sp_256_cmp_equal_10 30 - -30 static.sp_256_cmp_10 43 - -43 ------------------------------------------------------------------------------ (add/remove: 1/2 grow/shrink: 0/1 up/down: 24/-76) Total: -52 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-04-26tls: simplify sp_256_proj_point_dbl_10Denys Vlasenko
function old new delta sp_256_proj_point_dbl_10 490 435 -55 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-04-26tls: simplify array manipulations in sp_256_ecc_mulmod_10Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-04-26tls: get rid of address obfuscation trick in P256Denys Vlasenko
function old new delta addr_mask 8 - -8 sp_256_ecc_mulmod_10 1363 1330 -33 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 0/1 up/down: 0/-41) Total: -41 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-04-26tls: simplify sp_256_ecc_gen_k_10, cosmetic changesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-04-26tls: implement secp256r1 elliptic curve (aka P256)Denys Vlasenko
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>