diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-04-03 21:53:29 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-04-03 21:53:29 +0200 |
commit | 229d3c467d20bb776edbbb29517df84f09e1e46f (patch) | |
tree | 59809f057cc9c018109a26cab3dae3fbc20986bd /networking/tls.c | |
parent | 636c3b627cc964f65e5b38bb005d50f2841d6966 (diff) | |
download | busybox-w32-229d3c467d20bb776edbbb29517df84f09e1e46f.tar.gz busybox-w32-229d3c467d20bb776edbbb29517df84f09e1e46f.tar.bz2 busybox-w32-229d3c467d20bb776edbbb29517df84f09e1e46f.zip |
tls: avoid using int16 in pstm code
function old new delta
pstm_div 1472 1522 +50
psRsaEncryptPub 403 413 +10
pstm_2expt 91 96 +5
pstm_clear 68 72 +4
pstm_init 39 42 +3
pstm_unsigned_bin_size 36 37 +1
pstm_montgomery_reduce 398 399 +1
pstm_init_size 45 46 +1
pstm_zero 39 38 -1
pstm_set 35 34 -1
pstm_read_unsigned_bin 112 109 -3
pstm_mulmod 123 120 -3
pstm_mod 116 113 -3
pstm_cmp 57 54 -3
pstm_sub 107 102 -5
pstm_to_unsigned_bin 157 151 -6
pstm_clamp 63 57 -6
pstm_add 116 108 -8
pstm_grow 81 72 -9
pstm_count_bits 57 48 -9
pstm_init_copy 84 72 -12
pstm_cmp_mag 93 78 -15
pstm_sqr_comba 567 551 -16
pstm_montgomery_calc_normalization 158 140 -18
pstm_copy 115 92 -23
pstm_lshd 133 109 -24
pstm_mul_comba 525 500 -25
pstm_mul_d 251 224 -27
s_pstm_sub 256 228 -28
s_pstm_add 370 337 -33
pstm_div_2d 444 409 -35
pstm_mul_2 195 156 -39
pstm_rshd 154 104 -50
pstm_mul_2d 247 186 -61
pstm_exptmod 1524 1463 -61
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 8/27 up/down: 75/-524) Total: -449 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/tls.c')
-rw-r--r-- | networking/tls.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/networking/tls.c b/networking/tls.c index bbf2b158f..590c04ad9 100644 --- a/networking/tls.c +++ b/networking/tls.c | |||
@@ -475,7 +475,7 @@ static void prf_hmac_sha256(/*tls_state_t *tls,*/ | |||
475 | uint8_t a[TLS_MAX_MAC_SIZE]; | 475 | uint8_t a[TLS_MAX_MAC_SIZE]; |
476 | uint8_t *out_p = outbuf; | 476 | uint8_t *out_p = outbuf; |
477 | unsigned label_size = strlen(label); | 477 | unsigned label_size = strlen(label); |
478 | unsigned MAC_size = SHA256_OUTSIZE;///tls->MAC_size; | 478 | unsigned MAC_size = SHA256_OUTSIZE; |
479 | 479 | ||
480 | /* In P_hash() calculation, "seed" is "label + seed": */ | 480 | /* In P_hash() calculation, "seed" is "label + seed": */ |
481 | #define SEED label, label_size, seed, seed_size | 481 | #define SEED label, label_size, seed, seed_size |
@@ -486,7 +486,7 @@ static void prf_hmac_sha256(/*tls_state_t *tls,*/ | |||
486 | hmac_sha256(/*tls,*/ a, SECRET, SEED, NULL); | 486 | hmac_sha256(/*tls,*/ a, SECRET, SEED, NULL); |
487 | //TODO: convert hmac to precomputed | 487 | //TODO: convert hmac to precomputed |
488 | 488 | ||
489 | for(;;) { | 489 | for (;;) { |
490 | /* HMAC_hash(secret, A(1) + seed) */ | 490 | /* HMAC_hash(secret, A(1) + seed) */ |
491 | if (outbuf_size <= MAC_size) { | 491 | if (outbuf_size <= MAC_size) { |
492 | /* Last, possibly incomplete, block */ | 492 | /* Last, possibly incomplete, block */ |