tls: whitespace fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
d728a30c21
commit
e52e43c72f
@ -64,8 +64,8 @@ static void fprime_select(byte *dst, const byte *zero, const byte *one, byte con
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void fe_select(byte *dst,
|
static void fe_select(byte *dst,
|
||||||
const byte *zero, const byte *one,
|
const byte *zero, const byte *one,
|
||||||
byte condition)
|
byte condition)
|
||||||
{
|
{
|
||||||
const byte mask = -condition;
|
const byte mask = -condition;
|
||||||
int i;
|
int i;
|
||||||
@ -163,11 +163,11 @@ static void fprime_mul(byte *r, const byte *a, const byte *b,
|
|||||||
const byte bit = (b[i >> 3] >> (i & 7)) & 1;
|
const byte bit = (b[i >> 3] >> (i & 7)) & 1;
|
||||||
byte plusa[F25519_SIZE];
|
byte plusa[F25519_SIZE];
|
||||||
|
|
||||||
for (j = 0; j < F25519_SIZE; j++) {
|
for (j = 0; j < F25519_SIZE; j++) {
|
||||||
c |= ((word16)r[j]) << 1;
|
c |= ((word16)r[j]) << 1;
|
||||||
r[j] = (byte)c;
|
r[j] = (byte)c;
|
||||||
c >>= 8;
|
c >>= 8;
|
||||||
}
|
}
|
||||||
raw_try_sub(r, modulus);
|
raw_try_sub(r, modulus);
|
||||||
|
|
||||||
fprime_copy(plusa, r);
|
fprime_copy(plusa, r);
|
||||||
@ -315,7 +315,7 @@ static void fe_mul__distinct(byte *r, const byte *a, const byte *b)
|
|||||||
|
|
||||||
for (; j < F25519_SIZE; j++)
|
for (; j < F25519_SIZE; j++)
|
||||||
c += ((word32)a[j]) *
|
c += ((word32)a[j]) *
|
||||||
((word32)b[i + F25519_SIZE - j]) * 38;
|
((word32)b[i + F25519_SIZE - j]) * 38;
|
||||||
|
|
||||||
r[i] = c;
|
r[i] = c;
|
||||||
}
|
}
|
||||||
@ -474,9 +474,9 @@ static void fe_sqrt(byte *r, const byte *a)
|
|||||||
|
|
||||||
/* Differential addition */
|
/* Differential addition */
|
||||||
static void xc_diffadd(byte *x5, byte *z5,
|
static void xc_diffadd(byte *x5, byte *z5,
|
||||||
const byte *x1, const byte *z1,
|
const byte *x1, const byte *z1,
|
||||||
const byte *x2, const byte *z2,
|
const byte *x2, const byte *z2,
|
||||||
const byte *x3, const byte *z3)
|
const byte *x3, const byte *z3)
|
||||||
{
|
{
|
||||||
/* Explicit formulas database: dbl-1987-m3
|
/* Explicit formulas database: dbl-1987-m3
|
||||||
*
|
*
|
||||||
@ -516,7 +516,7 @@ static void xc_diffadd(byte *x5, byte *z5,
|
|||||||
|
|
||||||
/* Double an X-coordinate */
|
/* Double an X-coordinate */
|
||||||
static void xc_double(byte *x3, byte *z3,
|
static void xc_double(byte *x3, byte *z3,
|
||||||
const byte *x1, const byte *z1)
|
const byte *x1, const byte *z1)
|
||||||
{
|
{
|
||||||
/* Explicit formulas database: dbl-1987-m
|
/* Explicit formulas database: dbl-1987-m
|
||||||
*
|
*
|
||||||
|
@ -438,9 +438,9 @@ int32 FAST_FUNC pstm_read_unsigned_bin(pstm_int *a, unsigned char *b, int32 c)
|
|||||||
int32 idx = (c - 1) & ~3;
|
int32 idx = (c - 1) & ~3;
|
||||||
switch (c % 4) {
|
switch (c % 4) {
|
||||||
case 0: do { pd[idx+0] = *b++;
|
case 0: do { pd[idx+0] = *b++;
|
||||||
case 3: pd[idx+1] = *b++;
|
case 3: pd[idx+1] = *b++;
|
||||||
case 2: pd[idx+2] = *b++;
|
case 2: pd[idx+2] = *b++;
|
||||||
case 1: pd[idx+3] = *b++;
|
case 1: pd[idx+3] = *b++;
|
||||||
idx -= 4;
|
idx -= 4;
|
||||||
} while ((c -= 4) > 0);
|
} while ((c -= 4) > 0);
|
||||||
}
|
}
|
||||||
@ -1427,7 +1427,7 @@ static int32 pstm_div(psPool_t *pool, pstm_int *a, pstm_int *b, pstm_int *c,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* while (q{i-t-1} * (yt * b + y{t-1})) >
|
/* while (q{i-t-1} * (yt * b + y{t-1})) >
|
||||||
xi * b**2 + xi-1 * b + xi-2
|
xi * b**2 + xi-1 * b + xi-2
|
||||||
|
|
||||||
do q{i-t-1} -= 1;
|
do q{i-t-1} -= 1;
|
||||||
*/
|
*/
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
pkcs1Pad(in, inlen, out, outlen, cryptType)
|
pkcs1Pad(in, inlen, out, outlen, cryptType)
|
||||||
static //bbox
|
static //bbox
|
||||||
int32 pkcs1Pad(unsigned char *in, uint32 inlen, unsigned char *out,
|
int32 pkcs1Pad(unsigned char *in, uint32 inlen, unsigned char *out,
|
||||||
uint32 outlen, int32 cryptType, void *userPtr)
|
uint32 outlen, int32 cryptType, void *userPtr)
|
||||||
{
|
{
|
||||||
unsigned char *c;
|
unsigned char *c;
|
||||||
int32 randomLen;
|
int32 randomLen;
|
||||||
@ -60,7 +60,7 @@ int32 pkcs1Pad(unsigned char *in, uint32 inlen, unsigned char *out,
|
|||||||
psRsaCrypt( in, inlen, out, outlen, key, type)
|
psRsaCrypt( in, inlen, out, outlen, key, type)
|
||||||
static //bbox
|
static //bbox
|
||||||
int32 psRsaCrypt(psPool_t *pool, const unsigned char *in, uint32 inlen,
|
int32 psRsaCrypt(psPool_t *pool, const unsigned char *in, uint32 inlen,
|
||||||
unsigned char *out, uint32 *outlen, psRsaKey_t *key, int32 type,
|
unsigned char *out, uint32 *outlen, psRsaKey_t *key, int32 type,
|
||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
pstm_int tmp, tmpa, tmpb;
|
pstm_int tmp, tmpa, tmpb;
|
||||||
|
@ -506,12 +506,10 @@ static void sp_256_sqr_10(sp_digit* r, const sp_digit* a)
|
|||||||
break;
|
break;
|
||||||
if (j < 0)
|
if (j < 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
c += ((int64_t)a[i]) * a[j] * 2;
|
c += ((int64_t)a[i]) * a[j] * 2;
|
||||||
}
|
}
|
||||||
if (i == j)
|
if (i == j)
|
||||||
c += ((int64_t)a[i]) * a[i];
|
c += ((int64_t)a[i]) * a[i];
|
||||||
|
|
||||||
r[k + 2] += c >> 52;
|
r[k + 2] += c >> 52;
|
||||||
r[k + 1] = (c >> 26) & 0x3ffffff;
|
r[k + 1] = (c >> 26) & 0x3ffffff;
|
||||||
c = (c & 0x3ffffff) << 26;
|
c = (c & 0x3ffffff) << 26;
|
||||||
|
Loading…
Reference in New Issue
Block a user