summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/crypto.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/shared/crypto.cpp b/src/shared/crypto.cpp
index 134afc5..72dea47 100644
--- a/src/shared/crypto.cpp
+++ b/src/shared/crypto.cpp
@@ -106,7 +106,7 @@ namespace tiger
static bool init = false;
if(!init) { gensboxes(); init = true; }
- uchar temp[64];
+ uchar temp[65];
val.chunks[0] = 0x0123456789ABCDEFULL;
val.chunks[1] = 0xFEDCBA9876543210ULL;
@@ -148,7 +148,7 @@ namespace tiger
compress((chunk *)temp, val.chunks);
if(!*(const uchar *)&islittleendian)
{
- loopk(3)
+ loopk(3)
{
uchar *c = &val.bytes[k*sizeof(chunk)];
loopl(sizeof(chunk)/2) swap(c[l], c[sizeof(chunk)-1-l]);
@@ -299,7 +299,7 @@ template<int BI_DIGITS> struct bigint
{
copyshrinkdigits(y, n/BI_DIGIT_BITS);
}
-
+
template<int X_DIGITS, int Y_DIGITS> bigint &mul(const bigint<X_DIGITS> &x, const bigint<Y_DIGITS> &y)
{
if(!x.len || !y.len) { len = 0; return *this; }
@@ -364,9 +364,9 @@ template<int BI_DIGITS> struct bigint
}
void zerobits(int i, int n)
{
- zerodigits(i/BI_DIGIT_BITS, n/BI_DIGIT_BITS);
+ zerodigits(i/BI_DIGIT_BITS, n/BI_DIGIT_BITS);
}
-
+
template<int Y_DIGITS> void copydigits(int to, const bigint<Y_DIGITS> &y, int from, int n)
{
int avail = clamp(y.len-from, 0, n);
@@ -530,7 +530,7 @@ struct gfield : gfint
s.copybits(96, result, 352, 160);
s.shrinkdigits(GF_DIGITS);
add(s); add(s); // S1
-
+
if(result.morebits(384))
{
//s.zerobits(0, 96);
@@ -545,11 +545,11 @@ struct gfield : gfint
s.copybits(192, result, 448, 64);
s.shrinkdigits(GF_DIGITS);
add(s); // S3
-
+
s.copybits(0, result, 288, 96);
s.copybits(96, result, 416, 96);
s.dupbits(192, 96, 32);
- s.copybits(224, result, 256, 32);
+ s.copybits(224, result, 256, 32);
s.shrinkdigits(GF_DIGITS);
add(s); // S4
@@ -927,7 +927,7 @@ void *genchallenge(void *pubkey, const void *seed, int seedlen, vector<char> &ch
secret.print(challengestr);
challengestr.add('\0');
-
+
return new gfield(answer.x);
}