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_pstm.h | |
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_pstm.h')
-rw-r--r-- | networking/tls_pstm.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/networking/tls_pstm.h b/networking/tls_pstm.h index 3a0fd8ce6..df705adce 100644 --- a/networking/tls_pstm.h +++ b/networking/tls_pstm.h | |||
@@ -122,7 +122,7 @@ | |||
122 | #define PSTM_MAX_SIZE 4096 | 122 | #define PSTM_MAX_SIZE 4096 |
123 | 123 | ||
124 | typedef struct { | 124 | typedef struct { |
125 | int16 used, alloc, sign; | 125 | int used, alloc, sign; //bbox: was int16 |
126 | pstm_digit *dp; | 126 | pstm_digit *dp; |
127 | //bbox psPool_t *pool; | 127 | //bbox psPool_t *pool; |
128 | } pstm_int; | 128 | } pstm_int; |
@@ -154,9 +154,9 @@ extern int32 pstm_init_size(psPool_t *pool, pstm_int * a, uint32 size); | |||
154 | #define pstm_init_copy(pool, a, b, toSqr) \ | 154 | #define pstm_init_copy(pool, a, b, toSqr) \ |
155 | pstm_init_copy( a, b, toSqr) | 155 | pstm_init_copy( a, b, toSqr) |
156 | extern int32 pstm_init_copy(psPool_t *pool, pstm_int * a, pstm_int * b, | 156 | extern int32 pstm_init_copy(psPool_t *pool, pstm_int * a, pstm_int * b, |
157 | int16 toSqr); | 157 | int toSqr); //bbox: was int16 toSqr |
158 | 158 | ||
159 | extern int16 pstm_count_bits (pstm_int * a); | 159 | extern int pstm_count_bits (pstm_int * a); //bbox: was returning int16 |
160 | 160 | ||
161 | //bbox: pool unused | 161 | //bbox: pool unused |
162 | #define pstm_init_for_read_unsigned_bin(pool, a, len) \ | 162 | #define pstm_init_for_read_unsigned_bin(pool, a, len) \ |
@@ -178,7 +178,7 @@ extern void pstm_clear_multi(pstm_int *mp0, pstm_int *mp1, pstm_int *mp2, | |||
178 | pstm_int *mp3, pstm_int *mp4, pstm_int *mp5, pstm_int *mp6, | 178 | pstm_int *mp3, pstm_int *mp4, pstm_int *mp5, pstm_int *mp6, |
179 | pstm_int *mp7); | 179 | pstm_int *mp7); |
180 | 180 | ||
181 | extern int32 pstm_grow(pstm_int * a, int16 size); | 181 | extern int32 pstm_grow(pstm_int * a, int size); //bbox: was int16 size |
182 | 182 | ||
183 | extern void pstm_clamp(pstm_int * a); | 183 | extern void pstm_clamp(pstm_int * a); |
184 | 184 | ||
@@ -186,9 +186,9 @@ extern int32 pstm_cmp(pstm_int * a, pstm_int * b); | |||
186 | 186 | ||
187 | extern int32 pstm_cmp_mag(pstm_int * a, pstm_int * b); | 187 | extern int32 pstm_cmp_mag(pstm_int * a, pstm_int * b); |
188 | 188 | ||
189 | extern void pstm_rshd(pstm_int *a, int16 x); | 189 | extern void pstm_rshd(pstm_int *a, int x); //bbox: was int16 x |
190 | 190 | ||
191 | extern int32 pstm_lshd(pstm_int * a, int16 b); | 191 | extern int32 pstm_lshd(pstm_int * a, int b); //bbox: was int16 b |
192 | 192 | ||
193 | //bbox: pool unused | 193 | //bbox: pool unused |
194 | #define pstm_div(pool, a, b, c, d) \ | 194 | #define pstm_div(pool, a, b, c, d) \ |
@@ -199,8 +199,8 @@ extern int32 pstm_div(psPool_t *pool, pstm_int *a, pstm_int *b, pstm_int *c, | |||
199 | //bbox: pool unused | 199 | //bbox: pool unused |
200 | #define pstm_div_2d(pool, a, b, c, d) \ | 200 | #define pstm_div_2d(pool, a, b, c, d) \ |
201 | pstm_div_2d( a, b, c, d) | 201 | pstm_div_2d( a, b, c, d) |
202 | extern int32 pstm_div_2d(psPool_t *pool, pstm_int *a, int16 b, pstm_int *c, | 202 | extern int32 pstm_div_2d(psPool_t *pool, pstm_int *a, int b, pstm_int *c, |
203 | pstm_int *d); | 203 | pstm_int *d); //bbox: was int16 b |
204 | 204 | ||
205 | extern int32 pstm_div_2(pstm_int * a, pstm_int * b); | 205 | extern int32 pstm_div_2(pstm_int * a, pstm_int * b); |
206 | 206 | ||
@@ -232,7 +232,7 @@ extern int32 pstm_mulmod(psPool_t *pool, pstm_int *a, pstm_int *b, pstm_int *c, | |||
232 | extern int32 pstm_exptmod(psPool_t *pool, pstm_int *G, pstm_int *X, pstm_int *P, | 232 | extern int32 pstm_exptmod(psPool_t *pool, pstm_int *G, pstm_int *X, pstm_int *P, |
233 | pstm_int *Y); | 233 | pstm_int *Y); |
234 | 234 | ||
235 | extern int32 pstm_2expt(pstm_int *a, int16 b); | 235 | extern int32 pstm_2expt(pstm_int *a, int b); //bbox: was int16 b |
236 | 236 | ||
237 | extern int32 pstm_add(pstm_int *a, pstm_int *b, pstm_int *c); | 237 | extern int32 pstm_add(pstm_int *a, pstm_int *b, pstm_int *c); |
238 | 238 | ||