aboutsummaryrefslogtreecommitdiff
path: root/networking/tls_pstm.c
diff options
context:
space:
mode:
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 @@
5 */ 5 */
6#include "tls.h" 6#include "tls.h"
7 7
8/* The file is taken almost verbatim from matrixssl-3-7-2b-open/crypto/math/.
9 * Changes are flagged with ///bbox
10 */
11
8/** 12/**
9 * @file pstm.c 13 * @file pstm.c
10 * @version 33ef80f (HEAD, tag: MATRIXSSL-3-7-2-OPEN, tag: MATRIXSSL-3-7-2-COMM, origin/master, origin/HEAD, master) 14 * @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);
51 */ 55 */
52int32 pstm_init_size(psPool_t *pool, pstm_int * a, uint32 size) 56int32 pstm_init_size(psPool_t *pool, pstm_int * a, uint32 size)
53{ 57{
58///bbox
54// uint16 x; 59// uint16 x;
55 60
56/* 61/*
57 alloc mem 62 alloc mem
58 */ 63 */
59 a->dp = xzalloc(sizeof (pstm_digit) * size); 64 a->dp = xzalloc(sizeof (pstm_digit) * size);///bbox
60 a->pool = pool; 65 a->pool = pool;
61 a->used = 0; 66 a->used = 0;
62 a->alloc = (int16)size; 67 a->alloc = (int16)size;
@@ -77,11 +82,12 @@ int32 pstm_init_size(psPool_t *pool, pstm_int * a, uint32 size)
77*/ 82*/
78int32 pstm_init(psPool_t *pool, pstm_int * a) 83int32 pstm_init(psPool_t *pool, pstm_int * a)
79{ 84{
85///bbox
80// int32 i; 86// int32 i;
81/* 87/*
82 allocate memory required and clear it 88 allocate memory required and clear it
83 */ 89 */
84 a->dp = xzalloc(sizeof (pstm_digit) * PSTM_DEFAULT_INIT); 90 a->dp = xzalloc(sizeof (pstm_digit) * PSTM_DEFAULT_INIT);///bbox
85/* 91/*
86 set the digits to zero 92 set the digits to zero
87 */ 93 */
@@ -120,7 +126,7 @@ int32 pstm_grow(pstm_int * a, int16 size)
120 We store the return in a temporary variable in case the operation 126 We store the return in a temporary variable in case the operation
121 failed we don't want to overwrite the dp member of a. 127 failed we don't want to overwrite the dp member of a.
122*/ 128*/
123 tmp = xrealloc(a->dp, sizeof (pstm_digit) * size); 129 tmp = xrealloc(a->dp, sizeof (pstm_digit) * size);///bbox
124/* 130/*
125 reallocation succeeded so set a->dp 131 reallocation succeeded so set a->dp
126 */ 132 */
@@ -1616,7 +1622,7 @@ int32 pstm_exptmod(psPool_t *pool, pstm_int *G, pstm_int *X, pstm_int *P,
1616 Pre-allocated digit. Used for mul, sqr, AND reduce 1622 Pre-allocated digit. Used for mul, sqr, AND reduce
1617*/ 1623*/
1618 paDlen = ((M[1].used + 3) * 2) * sizeof(pstm_digit); 1624 paDlen = ((M[1].used + 3) * 2) * sizeof(pstm_digit);
1619 paD = xzalloc(paDlen); 1625 paD = xzalloc(paDlen);///bbox
1620/* 1626/*
1621 compute the value at M[1<<(winsize-1)] by squaring M[1] (winsize-1) times 1627 compute the value at M[1<<(winsize-1)] by squaring M[1] (winsize-1) times
1622 */ 1628 */