gnark icon indicating copy to clipboard operation
gnark copied to clipboard

byte operation problem

Open SherLzp opened this issue 2 years ago • 2 comments

Hi team, I have the problem for byte operations. For example: I have two byte array:

A []byte // size 20
B []byte // size 20

C := append(A, B) // size 40
CHash := mimc(C)

If I only put A,B into the circuit, how can I get the same result of CHash?

SherLzp avatar May 11 '22 11:05 SherLzp

@gbotrel @ThomasPiellard

SherLzp avatar May 12 '22 13:05 SherLzp

And another problem, if I have an array:

var A []Variable

Could I just use Select to decide to if I need to do an append operation.

My goal is to:

if flag{
    A = append(A, new value)
}

SherLzp avatar May 13 '22 02:05 SherLzp