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-11-20 19:26:34 -05:00 committed by Jack Grigg
parent d66bf190cb
commit 4a617475ec
No known key found for this signature in database
GPG Key ID: 665DBCD284F7DAFF
1 changed files with 1 additions and 1 deletions

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;
}