aboutsummaryrefslogtreecommitdiff
path: root/networking/tls_pstm.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2017-01-15 14:16:51 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2017-01-15 14:16:51 +0100
commit3f8ecd933a610c6f3b5d02e184c7faf205ad95d3 (patch)
treeae7a778a4a8dbbfc255b9a9f527179bfa9cc865c /networking/tls_pstm.c
parentc5540d61f6b411967fc3e30f1eb1e8af5077c2e5 (diff)
downloadbusybox-3f8ecd933a610c6f3b5d02e184c7faf205ad95d3.tar.gz
tls: rearrange code, add/improve comments, fix whitespace, no real changes here
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/tls_pstm.c')
-rw-r--r--networking/tls_pstm.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/networking/tls_pstm.c b/networking/tls_pstm.c
index 0d797f87f..f802baa15 100644
--- a/networking/tls_pstm.c
+++ b/networking/tls_pstm.c
@@ -5,6 +5,10 @@
*/
#include "tls.h"
+/* The file is taken almost verbatim from matrixssl-3-7-2b-open/crypto/math/.
+ * Changes are flagged with ///bbox
+ */
+
/**
* @file pstm.c
* @version 33ef80f (HEAD, tag: MATRIXSSL-3-7-2-OPEN, tag: MATRIXSSL-3-7-2-COMM, origin/master, origin/HEAD, master)
@@ -51,12 +55,13 @@ static int32 pstm_mul_2d(pstm_int *a, int16 b, pstm_int *c);
*/
int32 pstm_init_size(psPool_t *pool, pstm_int * a, uint32 size)
{
+///bbox
// uint16 x;
/*
alloc mem
*/
- a->dp = xzalloc(sizeof (pstm_digit) * size);
+ a->dp = xzalloc(sizeof (pstm_digit) * size);///bbox
a->pool = pool;
a->used = 0;
a->alloc = (int16)size;
@@ -77,11 +82,12 @@ int32 pstm_init_size(psPool_t *pool, pstm_int * a, uint32 size)
*/
int32 pstm_init(psPool_t *pool, pstm_int * a)
{
+///bbox
// int32 i;
/*
allocate memory required and clear it
*/
- a->dp = xzalloc(sizeof (pstm_digit) * PSTM_DEFAULT_INIT);
+ a->dp = xzalloc(sizeof (pstm_digit) * PSTM_DEFAULT_INIT);///bbox
/*
set the digits to zero
*/
@@ -120,7 +126,7 @@ int32 pstm_grow(pstm_int * a, int16 size)
We store the return in a temporary variable in case the operation
failed we don't want to overwrite the dp member of a.
*/
- tmp = xrealloc(a->dp, sizeof (pstm_digit) * size);
+ tmp = xrealloc(a->dp, sizeof (pstm_digit) * size);///bbox
/*
reallocation succeeded so set a->dp
*/
@@ -1616,7 +1622,7 @@ int32 pstm_exptmod(psPool_t *pool, pstm_int *G, pstm_int *X, pstm_int *P,
Pre-allocated digit. Used for mul, sqr, AND reduce
*/
paDlen = ((M[1].used + 3) * 2) * sizeof(pstm_digit);
- paD = xzalloc(paDlen);
+ paD = xzalloc(paDlen);///bbox
/*
compute the value at M[1<<(winsize-1)] by squaring M[1] (winsize-1) times
*/