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:
syd
2017-12-15 10:37:07 +00:00
committed by Jack Grigg
parent d66bf190cb
commit 4a617475ec
+1 -1
View File
@@ -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;
}