Skip to content

Commit

Permalink
windows fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
wjblanke committed Oct 12, 2024
1 parent e5f7120 commit dca8e96
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/bqfc.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ static void bqfc_export(uint8_t *out_str, size_t *offset, size_t size,
size_t bytes;

mpz_export(&out_str[*offset], &bytes, -1, 1, 0, 0, n);
if (bytes > size)
gmp_printf("bqfc_export overflow offset %d size %d n %Zd\n", *offset, size, n);
if (bytes < size)
memset(&out_str[*offset + bytes], 0, size - bytes);
*offset += size;
Expand Down
3 changes: 2 additions & 1 deletion src/proof_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ integer HashPrime(std::vector<uint8_t> seed, int length, vector<int> bitmask) {
break;
}
picosha2::hash256(sprout.begin(), sprout.end(), hash.begin(), hash.end());
// Visual Studio doesn't like pointer arithmetic past the bounds
blob.insert(blob.end(), hash.begin(),
std::min(hash.end(), hash.begin() + length / 8 - blob.size()));
hash.begin() + std::min(hash.size(), length / 8 - blob.size()));
}

assert ((int) blob.size() * 8 == length);
Expand Down

0 comments on commit dca8e96

Please sign in to comment.