Skip to content

Commit

Permalink
Add ba2fea() check of length to be <= 32
Browse files Browse the repository at this point in the history
  • Loading branch information
fractasy committed Aug 12, 2024
1 parent e1c0037 commit 1f74381
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/utils/scalar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,12 @@ void ba2scalar(const uint8_t *pData, uint64_t dataSize, mpz_class &s);

inline void ba2fea (Goldilocks &fr, const uint8_t * pData, uint64_t len, Goldilocks::Element &fe0, Goldilocks::Element &fe1, Goldilocks::Element &fe2, Goldilocks::Element &fe3, Goldilocks::Element &fe4, Goldilocks::Element &fe5, Goldilocks::Element &fe6, Goldilocks::Element &fe7)
{
if (len == 1)
if (len > 32)
{
zklog.error("ba2fea() found scalar length > 32 : " + to_string(len));
exitProcess();
}
else if (len == 1)
{
fr.fromU64(fe0, *pData);
fe1 = fr.zero();
Expand Down

0 comments on commit 1f74381

Please sign in to comment.