You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have tried a lot of ways to do the xor process, however it wont work. Here's my code.
the first part is about change the variables to binary, for this function we use the api XOR/OR/AND function as an parameter f
func UInt64BitOperation(api *frontend.API, a, b frontend.Variable, f func(a, b frontend.Variable) frontend.Variable) frontend.Variable {
cs := *api
aBits := cs.ToBinary(a, 64)
bBits := cs.ToBinary(b, 64)
var resBits []frontend.Variable = make([]frontend.Variable, 64)
And this below which is straight thinking but won't work
for i := 0; i < 64; i++ {
resBits[i] = f(aBits[i], bBits[i])
}
And I have tried another way.
for i := 0; i < 64; i++ {
aC := (*api).Select(aBits[i], One, Zero)
bC := (*api).Select(bBits[i], One, Zero)
resBits[i] = f(aC, bC)
}
I just check the value in hint function, so weird that aC, bC is all 1, but the XOR result returns a overflow number. And the error keep telling constraint #13307 is not satisfied: [assertIsBoolean] -1 == (0|1)
I have seen there's saying boolean operations results will always be boolean, but it seems like not the situation. How should I do?thanks.
The text was updated successfully, but these errors were encountered:
Hi @ZhAnGeek - can you give a full compilable circuit which causes the error? Particularly, what is the implementation of the function f you are using?
I have tried a lot of ways to do the xor process, however it wont work. Here's my code.
the first part is about change the variables to binary, for this function we use the api XOR/OR/AND function as an parameter f
And this below which is straight thinking but won't work
And I have tried another way.
I just check the value in hint function, so weird that aC, bC is all 1, but the XOR result returns a overflow number. And the error keep telling constraint #13307 is not satisfied: [assertIsBoolean] -1 == (0|1)
I have seen there's saying boolean operations results will always be boolean, but it seems like not the situation. How should I do?thanks.
The text was updated successfully, but these errors were encountered: