Fix libsnark test failure.
The shorten() method was copying too much into the destination buffer, overflowing it and affecting neighboring data.
This commit is contained in:
@@ -201,7 +201,7 @@ inline bigint<m> bigint<n>::shorten(const bigint<m>& q, const char *msg) const
|
||||
}
|
||||
}
|
||||
bigint<m> res;
|
||||
mpn_copyi(res.data, data, n);
|
||||
mpn_copyi(res.data, data, m);
|
||||
res.limit(q, msg);
|
||||
return res;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user