This fixes the previously commented test for the BlindGeneratorBlindSum binding.
Before this, the byte slice returned by this method was not matching the expected one.
After investigating, the problem was actually in the conversion of number values from the json to the uint64 go built-in type.
By using the generic interface{} for converting a json into a golang type when Unmarshaling, every number is automatically converted into a float64, and this was causing loss of information when then casting to uint64.
The fix for this is to create the custom types testType and testVectorType that reflect the json structure. In particular, the testVectorType contains a Values field, among the others, that is declared []uint64 so no information is lost in the conversion.
This fixes the previously commented test for the
BlindGeneratorBlindSum
binding.Before this, the byte slice returned by this method was not matching the expected one. After investigating, the problem was actually in the conversion of number values from the json to the
uint64
go built-in type.By using the generic
interface{}
for converting a json into a golang type whenUnmarshal
ing, every number is automatically converted into afloat64
, and this was causing loss of information when then casting touint64
.The fix for this is to create the custom types
testType
andtestVectorType
that reflect the json structure. In particular, thetestVectorType
contains aValues
field, among the others, that is declared[]uint64
so no information is lost in the conversion.This closes #57.