array.zk 567 B

1234567891011121314151617181920212223242526
  1. k = 13;
  2. field = "pallas";
  3. constant "Array" {}
  4. witness "Array" {
  5. Scalar foo,
  6. Scalar bar,
  7. Base baz,
  8. Base fizz,
  9. }
  10. # This circuit is intended to be used in testing the zkas compilation pipeline.
  11. # When arrays are fully implemented, this code should produce no errors
  12. circuit "Array" {
  13. array_scalar = [foo, bar];
  14. hash1 = poseidon_hash(foo, bar);
  15. hash2 = poseidon_hash(array_scalar);
  16. constrain_equal_scalar(hash1, hash2);
  17. array_base = [baz, fizz];
  18. hash3 = poseidon_hash(baz, fizz);
  19. hash4 = poseidon_hash(array_base);
  20. constrain_equal_base(hash3, hash4);
  21. }