From d371faf47db015b07b5d14b71c03fc4a52d0a5e3 Mon Sep 17 00:00:00 2001 From: HarryR Date: Wed, 7 Aug 2019 02:42:07 +0100 Subject: [PATCH] Fix for SHA256 components to work on 32bit platforms --- .../gadgetlib1/gadgets/hashes/sha256/sha256_components.hpp | 4 ++-- .../gadgetlib1/gadgets/hashes/sha256/sha256_components.tcc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libsnark/gadgetlib1/gadgets/hashes/sha256/sha256_components.hpp b/libsnark/gadgetlib1/gadgets/hashes/sha256/sha256_components.hpp index 0465622b..560eedaa 100644 --- a/libsnark/gadgetlib1/gadgets/hashes/sha256/sha256_components.hpp +++ b/libsnark/gadgetlib1/gadgets/hashes/sha256/sha256_components.hpp @@ -78,7 +78,7 @@ class sha256_round_function_gadget : public gadget { pb_linear_combination_array g; pb_linear_combination_array h; pb_variable W; - long K; + const FieldT K; pb_linear_combination_array new_a; pb_linear_combination_array new_e; @@ -92,7 +92,7 @@ class sha256_round_function_gadget : public gadget { const pb_linear_combination_array &g, const pb_linear_combination_array &h, const pb_variable &W, - const long &K, + const unsigned long &K, const pb_linear_combination_array &new_a, const pb_linear_combination_array &new_e, const std::string &annotation_prefix); diff --git a/libsnark/gadgetlib1/gadgets/hashes/sha256/sha256_components.tcc b/libsnark/gadgetlib1/gadgets/hashes/sha256/sha256_components.tcc index 69e17821..36c95d9c 100644 --- a/libsnark/gadgetlib1/gadgets/hashes/sha256/sha256_components.tcc +++ b/libsnark/gadgetlib1/gadgets/hashes/sha256/sha256_components.tcc @@ -149,7 +149,7 @@ sha256_round_function_gadget::sha256_round_function_gadget(protoboard &g, const pb_linear_combination_array &h, const pb_variable &W, - const long &K, + const unsigned long &K, const pb_linear_combination_array &new_a, const pb_linear_combination_array &new_e, const std::string &annotation_prefix) : @@ -163,7 +163,7 @@ sha256_round_function_gadget::sha256_round_function_gadget(protoboard