summaryrefslogtreecommitdiff
path: root/networking/tls_pstm.h
diff options
context:
space:
mode:
authorDenys Vlasenko2017-04-03 21:53:29 +0200
committerDenys Vlasenko2017-04-03 21:53:29 +0200
commit229d3c467d20bb776edbbb29517df84f09e1e46f (patch)
tree59809f057cc9c018109a26cab3dae3fbc20986bd /networking/tls_pstm.h
parent636c3b627cc964f65e5b38bb005d50f2841d6966 (diff)
downloadbusybox-229d3c467d20bb776edbbb29517df84f09e1e46f.zip
busybox-229d3c467d20bb776edbbb29517df84f09e1e46f.tar.gz
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.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/networking/tls_pstm.h b/networking/tls_pstm.h
index 3a0fd8c..df705ad 100644
--- a/networking/tls_pstm.h
+++ b/networking/tls_pstm.h
@@ -122,7 +122,7 @@
#define PSTM_MAX_SIZE 4096
typedef struct {
- int16 used, alloc, sign;
+ int used, alloc, sign; //bbox: was int16
pstm_digit *dp;
//bbox psPool_t *pool;
} pstm_int;
@@ -154,9 +154,9 @@ extern int32 pstm_init_size(psPool_t *pool, pstm_int * a, uint32 size);
#define pstm_init_copy(pool, a, b, toSqr) \
pstm_init_copy( a, b, toSqr)
extern int32 pstm_init_copy(psPool_t *pool, pstm_int * a, pstm_int * b,
- int16 toSqr);
+ int toSqr); //bbox: was int16 toSqr
-extern int16 pstm_count_bits (pstm_int * a);
+extern int pstm_count_bits (pstm_int * a); //bbox: was returning int16
//bbox: pool unused
#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,
pstm_int *mp3, pstm_int *mp4, pstm_int *mp5, pstm_int *mp6,
pstm_int *mp7);
-extern int32 pstm_grow(pstm_int * a, int16 size);
+extern int32 pstm_grow(pstm_int * a, int size); //bbox: was int16 size
extern void pstm_clamp(pstm_int * a);
@@ -186,9 +186,9 @@ extern int32 pstm_cmp(pstm_int * a, pstm_int * b);
extern int32 pstm_cmp_mag(pstm_int * a, pstm_int * b);
-extern void pstm_rshd(pstm_int *a, int16 x);
+extern void pstm_rshd(pstm_int *a, int x); //bbox: was int16 x
-extern int32 pstm_lshd(pstm_int * a, int16 b);
+extern int32 pstm_lshd(pstm_int * a, int b); //bbox: was int16 b
//bbox: pool unused
#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,
//bbox: pool unused
#define pstm_div_2d(pool, a, b, c, d) \
pstm_div_2d( a, b, c, d)
-extern int32 pstm_div_2d(psPool_t *pool, pstm_int *a, int16 b, pstm_int *c,
- pstm_int *d);
+extern int32 pstm_div_2d(psPool_t *pool, pstm_int *a, int b, pstm_int *c,
+ pstm_int *d); //bbox: was int16 b
extern int32 pstm_div_2(pstm_int * a, pstm_int * b);
@@ -232,7 +232,7 @@ extern int32 pstm_mulmod(psPool_t *pool, pstm_int *a, pstm_int *b, pstm_int *c,
extern int32 pstm_exptmod(psPool_t *pool, pstm_int *G, pstm_int *X, pstm_int *P,
pstm_int *Y);
-extern int32 pstm_2expt(pstm_int *a, int16 b);
+extern int32 pstm_2expt(pstm_int *a, int b); //bbox: was int16 b
extern int32 pstm_add(pstm_int *a, pstm_int *b, pstm_int *c);