longfellow 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (289) hide show
  1. checksums.yaml +7 -0
  2. data/CODE_OF_CONDUCT.md +10 -0
  3. data/LICENSE.txt +21 -0
  4. data/README.md +152 -0
  5. data/ext/longfellow/CMakeLists.txt +76 -0
  6. data/ext/longfellow/extconf.rb +77 -0
  7. data/lib/longfellow/attribute.rb +65 -0
  8. data/lib/longfellow/c.rb +105 -0
  9. data/lib/longfellow/errors.rb +78 -0
  10. data/lib/longfellow/version.rb +5 -0
  11. data/lib/longfellow/zk_spec.rb +40 -0
  12. data/lib/longfellow.rb +162 -0
  13. data/sig/longfellow.rbs +74 -0
  14. data/vendor/longfellow-zk/LICENSE +203 -0
  15. data/vendor/longfellow-zk/lib/algebra/blas.h +121 -0
  16. data/vendor/longfellow-zk/lib/algebra/bogorng.h +68 -0
  17. data/vendor/longfellow-zk/lib/algebra/compare.h +40 -0
  18. data/vendor/longfellow-zk/lib/algebra/convolution.h +219 -0
  19. data/vendor/longfellow-zk/lib/algebra/crt.cc +42 -0
  20. data/vendor/longfellow-zk/lib/algebra/crt.h +299 -0
  21. data/vendor/longfellow-zk/lib/algebra/crt_convolution.h +114 -0
  22. data/vendor/longfellow-zk/lib/algebra/crt_test.cc +371 -0
  23. data/vendor/longfellow-zk/lib/algebra/fft.h +104 -0
  24. data/vendor/longfellow-zk/lib/algebra/fft_interpolation.h +304 -0
  25. data/vendor/longfellow-zk/lib/algebra/fft_interpolation_test.cc +168 -0
  26. data/vendor/longfellow-zk/lib/algebra/fft_test.cc +257 -0
  27. data/vendor/longfellow-zk/lib/algebra/fp.h +59 -0
  28. data/vendor/longfellow-zk/lib/algebra/fp2.h +240 -0
  29. data/vendor/longfellow-zk/lib/algebra/fp24.h +342 -0
  30. data/vendor/longfellow-zk/lib/algebra/fp24_6.h +305 -0
  31. data/vendor/longfellow-zk/lib/algebra/fp24_6_test.cc +197 -0
  32. data/vendor/longfellow-zk/lib/algebra/fp2_test.cc +280 -0
  33. data/vendor/longfellow-zk/lib/algebra/fp_generic.h +533 -0
  34. data/vendor/longfellow-zk/lib/algebra/fp_p128.h +91 -0
  35. data/vendor/longfellow-zk/lib/algebra/fp_p256.h +68 -0
  36. data/vendor/longfellow-zk/lib/algebra/fp_p256k1.h +123 -0
  37. data/vendor/longfellow-zk/lib/algebra/fp_p384.h +65 -0
  38. data/vendor/longfellow-zk/lib/algebra/fp_p521.h +62 -0
  39. data/vendor/longfellow-zk/lib/algebra/fp_test.cc +522 -0
  40. data/vendor/longfellow-zk/lib/algebra/hash.h +39 -0
  41. data/vendor/longfellow-zk/lib/algebra/interpolation.h +117 -0
  42. data/vendor/longfellow-zk/lib/algebra/interpolation_test.cc +74 -0
  43. data/vendor/longfellow-zk/lib/algebra/limb.h +153 -0
  44. data/vendor/longfellow-zk/lib/algebra/limb_test.cc +75 -0
  45. data/vendor/longfellow-zk/lib/algebra/nat.cc +32 -0
  46. data/vendor/longfellow-zk/lib/algebra/nat.h +212 -0
  47. data/vendor/longfellow-zk/lib/algebra/nat_test.cc +183 -0
  48. data/vendor/longfellow-zk/lib/algebra/nussbaumer.h +400 -0
  49. data/vendor/longfellow-zk/lib/algebra/nussbaumer_test.cc +138 -0
  50. data/vendor/longfellow-zk/lib/algebra/nussbaumerfp2_test.cc +139 -0
  51. data/vendor/longfellow-zk/lib/algebra/permutations.h +79 -0
  52. data/vendor/longfellow-zk/lib/algebra/poly.h +240 -0
  53. data/vendor/longfellow-zk/lib/algebra/poly_test.cc +123 -0
  54. data/vendor/longfellow-zk/lib/algebra/reed_solomon.h +150 -0
  55. data/vendor/longfellow-zk/lib/algebra/reed_solomon_extension.h +108 -0
  56. data/vendor/longfellow-zk/lib/algebra/reed_solomon_extension_test.cc +76 -0
  57. data/vendor/longfellow-zk/lib/algebra/reed_solomon_test.cc +473 -0
  58. data/vendor/longfellow-zk/lib/algebra/rfft.h +400 -0
  59. data/vendor/longfellow-zk/lib/algebra/rfft_test.cc +102 -0
  60. data/vendor/longfellow-zk/lib/algebra/static_string.h +29 -0
  61. data/vendor/longfellow-zk/lib/algebra/sysdep.h +495 -0
  62. data/vendor/longfellow-zk/lib/algebra/sysdep_test.cc +41 -0
  63. data/vendor/longfellow-zk/lib/algebra/twiddle.h +59 -0
  64. data/vendor/longfellow-zk/lib/algebra/utility.h +86 -0
  65. data/vendor/longfellow-zk/lib/algebra/utility_test.cc +86 -0
  66. data/vendor/longfellow-zk/lib/arrays/affine.h +56 -0
  67. data/vendor/longfellow-zk/lib/arrays/affine_test.cc +220 -0
  68. data/vendor/longfellow-zk/lib/arrays/dense.h +210 -0
  69. data/vendor/longfellow-zk/lib/arrays/eq.h +75 -0
  70. data/vendor/longfellow-zk/lib/arrays/eqs.h +137 -0
  71. data/vendor/longfellow-zk/lib/arrays/eqs_test.cc +151 -0
  72. data/vendor/longfellow-zk/lib/arrays/sparse.h +192 -0
  73. data/vendor/longfellow-zk/lib/cbor/host_decoder.h +323 -0
  74. data/vendor/longfellow-zk/lib/cbor/host_decoder_test.cc +541 -0
  75. data/vendor/longfellow-zk/lib/circuits/cbor_parser/cbor.h +594 -0
  76. data/vendor/longfellow-zk/lib/circuits/cbor_parser/cbor_byte_decoder.h +150 -0
  77. data/vendor/longfellow-zk/lib/circuits/cbor_parser/cbor_byte_decoder_test.cc +147 -0
  78. data/vendor/longfellow-zk/lib/circuits/cbor_parser/cbor_constants.h +27 -0
  79. data/vendor/longfellow-zk/lib/circuits/cbor_parser/cbor_pluck.h +110 -0
  80. data/vendor/longfellow-zk/lib/circuits/cbor_parser/cbor_pluck_test.cc +55 -0
  81. data/vendor/longfellow-zk/lib/circuits/cbor_parser/cbor_test.cc +174 -0
  82. data/vendor/longfellow-zk/lib/circuits/cbor_parser/cbor_testing.h +98 -0
  83. data/vendor/longfellow-zk/lib/circuits/cbor_parser/cbor_witness.h +312 -0
  84. data/vendor/longfellow-zk/lib/circuits/cbor_parser/mso2_test.cc +662 -0
  85. data/vendor/longfellow-zk/lib/circuits/cbor_parser/mso_test.cc +485 -0
  86. data/vendor/longfellow-zk/lib/circuits/cbor_parser/scan.h +104 -0
  87. data/vendor/longfellow-zk/lib/circuits/cbor_parser/scan_test.cc +137 -0
  88. data/vendor/longfellow-zk/lib/circuits/cbor_parser_v2/cbor.h +640 -0
  89. data/vendor/longfellow-zk/lib/circuits/cbor_parser_v2/cbor_byte_decoder.h +150 -0
  90. data/vendor/longfellow-zk/lib/circuits/cbor_parser_v2/cbor_byte_decoder_test.cc +147 -0
  91. data/vendor/longfellow-zk/lib/circuits/cbor_parser_v2/cbor_constants.h +27 -0
  92. data/vendor/longfellow-zk/lib/circuits/cbor_parser_v2/cbor_testing.h +99 -0
  93. data/vendor/longfellow-zk/lib/circuits/cbor_parser_v2/cbor_witness.h +319 -0
  94. data/vendor/longfellow-zk/lib/circuits/cbor_parser_v2/lexer_test.cc +120 -0
  95. data/vendor/longfellow-zk/lib/circuits/cbor_parser_v2/mdoc_examples_test.cc +89 -0
  96. data/vendor/longfellow-zk/lib/circuits/cbor_parser_v2/parser_circuit_test.cc +506 -0
  97. data/vendor/longfellow-zk/lib/circuits/cbor_parser_v2/parser_size_test.cc +79 -0
  98. data/vendor/longfellow-zk/lib/circuits/cbor_parser_v2/parser_test.cc +473 -0
  99. data/vendor/longfellow-zk/lib/circuits/compiler/canonicalization_test.cc +185 -0
  100. data/vendor/longfellow-zk/lib/circuits/compiler/circuit_dump.h +65 -0
  101. data/vendor/longfellow-zk/lib/circuits/compiler/compiler.h +471 -0
  102. data/vendor/longfellow-zk/lib/circuits/compiler/compiler_test.cc +110 -0
  103. data/vendor/longfellow-zk/lib/circuits/compiler/node.h +176 -0
  104. data/vendor/longfellow-zk/lib/circuits/compiler/pdqhash.h +127 -0
  105. data/vendor/longfellow-zk/lib/circuits/compiler/schedule.h +435 -0
  106. data/vendor/longfellow-zk/lib/circuits/ecdsa/verify_circuit.h +371 -0
  107. data/vendor/longfellow-zk/lib/circuits/ecdsa/verify_external_test.cc +246 -0
  108. data/vendor/longfellow-zk/lib/circuits/ecdsa/verify_test.cc +587 -0
  109. data/vendor/longfellow-zk/lib/circuits/ecdsa/verify_witness.h +201 -0
  110. data/vendor/longfellow-zk/lib/circuits/logic/bit_adder.h +140 -0
  111. data/vendor/longfellow-zk/lib/circuits/logic/bit_adder_test.cc +64 -0
  112. data/vendor/longfellow-zk/lib/circuits/logic/bit_plucker.h +247 -0
  113. data/vendor/longfellow-zk/lib/circuits/logic/bit_plucker_constants.h +35 -0
  114. data/vendor/longfellow-zk/lib/circuits/logic/bit_plucker_encoder.h +72 -0
  115. data/vendor/longfellow-zk/lib/circuits/logic/bit_plucker_test.cc +183 -0
  116. data/vendor/longfellow-zk/lib/circuits/logic/compiler_backend.h +62 -0
  117. data/vendor/longfellow-zk/lib/circuits/logic/counter.h +171 -0
  118. data/vendor/longfellow-zk/lib/circuits/logic/counter_test.cc +102 -0
  119. data/vendor/longfellow-zk/lib/circuits/logic/evaluation_backend.h +94 -0
  120. data/vendor/longfellow-zk/lib/circuits/logic/logic.h +1232 -0
  121. data/vendor/longfellow-zk/lib/circuits/logic/logic_circuit_test.cc +310 -0
  122. data/vendor/longfellow-zk/lib/circuits/logic/logic_test.cc +521 -0
  123. data/vendor/longfellow-zk/lib/circuits/logic/memcmp.h +68 -0
  124. data/vendor/longfellow-zk/lib/circuits/logic/memcmp_test.cc +148 -0
  125. data/vendor/longfellow-zk/lib/circuits/logic/polynomial.h +94 -0
  126. data/vendor/longfellow-zk/lib/circuits/logic/polynomial_test.cc +62 -0
  127. data/vendor/longfellow-zk/lib/circuits/logic/routing.h +445 -0
  128. data/vendor/longfellow-zk/lib/circuits/logic/routing_test.cc +241 -0
  129. data/vendor/longfellow-zk/lib/circuits/logic/unary.h +55 -0
  130. data/vendor/longfellow-zk/lib/circuits/logic/unary_plucker.h +77 -0
  131. data/vendor/longfellow-zk/lib/circuits/logic/unary_plucker_constants.h +37 -0
  132. data/vendor/longfellow-zk/lib/circuits/logic/unary_plucker_test.cc +53 -0
  133. data/vendor/longfellow-zk/lib/circuits/logic/unary_size_test.cc +69 -0
  134. data/vendor/longfellow-zk/lib/circuits/logic/unary_test.cc +62 -0
  135. data/vendor/longfellow-zk/lib/circuits/mac/mac_circuit.h +193 -0
  136. data/vendor/longfellow-zk/lib/circuits/mac/mac_circuit_test.cc +223 -0
  137. data/vendor/longfellow-zk/lib/circuits/mac/mac_reference.h +72 -0
  138. data/vendor/longfellow-zk/lib/circuits/mac/mac_witness.h +94 -0
  139. data/vendor/longfellow-zk/lib/circuits/mdoc/circuit_maker.cc +242 -0
  140. data/vendor/longfellow-zk/lib/circuits/mdoc/mdoc_attribute_ids.h +311 -0
  141. data/vendor/longfellow-zk/lib/circuits/mdoc/mdoc_attribute_test.cc +64 -0
  142. data/vendor/longfellow-zk/lib/circuits/mdoc/mdoc_circuit_id.cc +85 -0
  143. data/vendor/longfellow-zk/lib/circuits/mdoc/mdoc_constants.h +85 -0
  144. data/vendor/longfellow-zk/lib/circuits/mdoc/mdoc_decompress.cc +41 -0
  145. data/vendor/longfellow-zk/lib/circuits/mdoc/mdoc_decompress.h +27 -0
  146. data/vendor/longfellow-zk/lib/circuits/mdoc/mdoc_examples.h +5232 -0
  147. data/vendor/longfellow-zk/lib/circuits/mdoc/mdoc_generate_circuit.cc +199 -0
  148. data/vendor/longfellow-zk/lib/circuits/mdoc/mdoc_hash.h +554 -0
  149. data/vendor/longfellow-zk/lib/circuits/mdoc/mdoc_signature.h +143 -0
  150. data/vendor/longfellow-zk/lib/circuits/mdoc/mdoc_signature_test.cc +444 -0
  151. data/vendor/longfellow-zk/lib/circuits/mdoc/mdoc_test_attributes.h +157 -0
  152. data/vendor/longfellow-zk/lib/circuits/mdoc/mdoc_witness.h +863 -0
  153. data/vendor/longfellow-zk/lib/circuits/mdoc/mdoc_zk.cc +693 -0
  154. data/vendor/longfellow-zk/lib/circuits/mdoc/mdoc_zk.h +216 -0
  155. data/vendor/longfellow-zk/lib/circuits/mdoc/mdoc_zk_test.cc +724 -0
  156. data/vendor/longfellow-zk/lib/circuits/mdoc/zk_spec.cc +100 -0
  157. data/vendor/longfellow-zk/lib/circuits/mdoc/zk_spec_test.cc +155 -0
  158. data/vendor/longfellow-zk/lib/circuits/sha/flatsha256_circuit.h +330 -0
  159. data/vendor/longfellow-zk/lib/circuits/sha/flatsha256_circuit_test.cc +607 -0
  160. data/vendor/longfellow-zk/lib/circuits/sha/flatsha256_io.h +26 -0
  161. data/vendor/longfellow-zk/lib/circuits/sha/flatsha256_witness.cc +163 -0
  162. data/vendor/longfellow-zk/lib/circuits/sha/flatsha256_witness.h +47 -0
  163. data/vendor/longfellow-zk/lib/circuits/sha/sha256_constants.cc +34 -0
  164. data/vendor/longfellow-zk/lib/circuits/sha/sha256_constants.h +27 -0
  165. data/vendor/longfellow-zk/lib/circuits/sha/sha256_test_values.h +389 -0
  166. data/vendor/longfellow-zk/lib/circuits/tests/anoncred/ptrcred.h +171 -0
  167. data/vendor/longfellow-zk/lib/circuits/tests/anoncred/small.h +218 -0
  168. data/vendor/longfellow-zk/lib/circuits/tests/anoncred/small_examples.h +118 -0
  169. data/vendor/longfellow-zk/lib/circuits/tests/anoncred/small_io.h +25 -0
  170. data/vendor/longfellow-zk/lib/circuits/tests/anoncred/small_test.cc +208 -0
  171. data/vendor/longfellow-zk/lib/circuits/tests/anoncred/small_witness.h +130 -0
  172. data/vendor/longfellow-zk/lib/circuits/tests/base64/decode.h +508 -0
  173. data/vendor/longfellow-zk/lib/circuits/tests/base64/decode_circuit_test.cc +95 -0
  174. data/vendor/longfellow-zk/lib/circuits/tests/base64/decode_test.cc +119 -0
  175. data/vendor/longfellow-zk/lib/circuits/tests/base64/decode_util.cc +47 -0
  176. data/vendor/longfellow-zk/lib/circuits/tests/base64/decode_util.h +29 -0
  177. data/vendor/longfellow-zk/lib/circuits/tests/ec/pk_circuit.h +231 -0
  178. data/vendor/longfellow-zk/lib/circuits/tests/ec/pk_circuit_test.cc +428 -0
  179. data/vendor/longfellow-zk/lib/circuits/tests/ec/pk_witness.h +102 -0
  180. data/vendor/longfellow-zk/lib/circuits/tests/jwt/jwt.h +190 -0
  181. data/vendor/longfellow-zk/lib/circuits/tests/jwt/jwt_constants.h +26 -0
  182. data/vendor/longfellow-zk/lib/circuits/tests/jwt/jwt_test.cc +559 -0
  183. data/vendor/longfellow-zk/lib/circuits/tests/jwt/jwt_witness.h +315 -0
  184. data/vendor/longfellow-zk/lib/circuits/tests/mdoc/mdoc_1f.h +411 -0
  185. data/vendor/longfellow-zk/lib/circuits/tests/mdoc/mdoc_1f_io.h +32 -0
  186. data/vendor/longfellow-zk/lib/circuits/tests/mdoc/mdoc_1f_test.cc +364 -0
  187. data/vendor/longfellow-zk/lib/circuits/tests/mdoc/mdoc_1f_witness.h +278 -0
  188. data/vendor/longfellow-zk/lib/circuits/tests/mdoc/mdoc_revocation.h +146 -0
  189. data/vendor/longfellow-zk/lib/circuits/tests/mdoc/mdoc_revocation_constants.h +25 -0
  190. data/vendor/longfellow-zk/lib/circuits/tests/mdoc/mdoc_revocation_test.cc +315 -0
  191. data/vendor/longfellow-zk/lib/circuits/tests/mdoc/mdoc_revocation_witness.h +136 -0
  192. data/vendor/longfellow-zk/lib/circuits/tests/pq/bitaddr/bitaddr.h +250 -0
  193. data/vendor/longfellow-zk/lib/circuits/tests/pq/bitaddr/bitaddr_test.cc +333 -0
  194. data/vendor/longfellow-zk/lib/circuits/tests/pq/bitaddr/bitaddr_witness.h +152 -0
  195. data/vendor/longfellow-zk/lib/circuits/tests/pq/ml_dsa/ml_dsa_44.h +903 -0
  196. data/vendor/longfellow-zk/lib/circuits/tests/pq/ml_dsa/ml_dsa_44_circuit_test.cc +274 -0
  197. data/vendor/longfellow-zk/lib/circuits/tests/pq/ml_dsa/ml_dsa_44_eval_test.cc +440 -0
  198. data/vendor/longfellow-zk/lib/circuits/tests/pq/ml_dsa/ml_dsa_44_examples.cc +8851 -0
  199. data/vendor/longfellow-zk/lib/circuits/tests/pq/ml_dsa/ml_dsa_44_examples.h +93 -0
  200. data/vendor/longfellow-zk/lib/circuits/tests/pq/ml_dsa/ml_dsa_44_types.cc +24 -0
  201. data/vendor/longfellow-zk/lib/circuits/tests/pq/ml_dsa/ml_dsa_44_types.h +118 -0
  202. data/vendor/longfellow-zk/lib/circuits/tests/pq/ml_dsa/ml_dsa_44_witness.h +453 -0
  203. data/vendor/longfellow-zk/lib/circuits/tests/pq/ml_dsa/ml_dsa_44_witness_test.cc +49 -0
  204. data/vendor/longfellow-zk/lib/circuits/tests/pq/ml_dsa/ml_dsa_ref.cc +458 -0
  205. data/vendor/longfellow-zk/lib/circuits/tests/pq/ml_dsa/ml_dsa_ref.h +150 -0
  206. data/vendor/longfellow-zk/lib/circuits/tests/pq/ml_dsa/ml_dsa_ref_test.cc +398 -0
  207. data/vendor/longfellow-zk/lib/circuits/tests/pq/ml_dsa/ml_dsa_ref_test_vectors.inc +3618 -0
  208. data/vendor/longfellow-zk/lib/circuits/tests/pq/ml_dsa/ml_dsa_ref_test_vectors_pkdecode.inc +689 -0
  209. data/vendor/longfellow-zk/lib/circuits/tests/pq/ml_dsa/ml_dsa_ref_test_vectors_sigdecode.inc +1501 -0
  210. data/vendor/longfellow-zk/lib/circuits/tests/pq/ml_dsa/sigdecode_test_vectors.inc +540 -0
  211. data/vendor/longfellow-zk/lib/circuits/tests/ripemd/ripemd_circuit.h +394 -0
  212. data/vendor/longfellow-zk/lib/circuits/tests/ripemd/ripemd_circuit_test.cc +577 -0
  213. data/vendor/longfellow-zk/lib/circuits/tests/ripemd/ripemd_constants.h +90 -0
  214. data/vendor/longfellow-zk/lib/circuits/tests/ripemd/ripemd_witness.cc +174 -0
  215. data/vendor/longfellow-zk/lib/circuits/tests/ripemd/ripemd_witness.h +140 -0
  216. data/vendor/longfellow-zk/lib/circuits/tests/sha3/sha3_circuit.h +351 -0
  217. data/vendor/longfellow-zk/lib/circuits/tests/sha3/sha3_circuit_test.cc +466 -0
  218. data/vendor/longfellow-zk/lib/circuits/tests/sha3/sha3_reference.cc +207 -0
  219. data/vendor/longfellow-zk/lib/circuits/tests/sha3/sha3_reference.h +59 -0
  220. data/vendor/longfellow-zk/lib/circuits/tests/sha3/sha3_reference_test.cc +153 -0
  221. data/vendor/longfellow-zk/lib/circuits/tests/sha3/sha3_round_constants.cc +39 -0
  222. data/vendor/longfellow-zk/lib/circuits/tests/sha3/sha3_round_constants.h +29 -0
  223. data/vendor/longfellow-zk/lib/circuits/tests/sha3/sha3_slicing.h +31 -0
  224. data/vendor/longfellow-zk/lib/circuits/tests/sha3/sha3_witness.cc +83 -0
  225. data/vendor/longfellow-zk/lib/circuits/tests/sha3/sha3_witness.h +72 -0
  226. data/vendor/longfellow-zk/lib/circuits/tests/sha3/shake_test_vectors.h +477 -0
  227. data/vendor/longfellow-zk/lib/ec/elliptic_curve.h +596 -0
  228. data/vendor/longfellow-zk/lib/ec/elliptic_curve_test.cc +548 -0
  229. data/vendor/longfellow-zk/lib/ec/p256.cc +36 -0
  230. data/vendor/longfellow-zk/lib/ec/p256.h +60 -0
  231. data/vendor/longfellow-zk/lib/ec/p256k1.cc +34 -0
  232. data/vendor/longfellow-zk/lib/ec/p256k1.h +60 -0
  233. data/vendor/longfellow-zk/lib/gf2k/gf2_128.h +503 -0
  234. data/vendor/longfellow-zk/lib/gf2k/gf2_128_bench.cc +48 -0
  235. data/vendor/longfellow-zk/lib/gf2k/gf2_128_test.cc +416 -0
  236. data/vendor/longfellow-zk/lib/gf2k/gf2poly.h +74 -0
  237. data/vendor/longfellow-zk/lib/gf2k/lch14.h +242 -0
  238. data/vendor/longfellow-zk/lib/gf2k/lch14_bench.cc +75 -0
  239. data/vendor/longfellow-zk/lib/gf2k/lch14_reed_solomon.h +127 -0
  240. data/vendor/longfellow-zk/lib/gf2k/lch14_reed_solomon_test.cc +110 -0
  241. data/vendor/longfellow-zk/lib/gf2k/lch14_test.cc +246 -0
  242. data/vendor/longfellow-zk/lib/gf2k/sysdep.h +329 -0
  243. data/vendor/longfellow-zk/lib/ligero/ligero_param.h +449 -0
  244. data/vendor/longfellow-zk/lib/ligero/ligero_prover.h +354 -0
  245. data/vendor/longfellow-zk/lib/ligero/ligero_test.cc +136 -0
  246. data/vendor/longfellow-zk/lib/ligero/ligero_transcript.h +67 -0
  247. data/vendor/longfellow-zk/lib/ligero/ligero_verifier.h +272 -0
  248. data/vendor/longfellow-zk/lib/merkle/merkle_commitment.h +104 -0
  249. data/vendor/longfellow-zk/lib/merkle/merkle_tree.h +216 -0
  250. data/vendor/longfellow-zk/lib/merkle/merkle_tree_test.cc +240 -0
  251. data/vendor/longfellow-zk/lib/proto/circuit.h +354 -0
  252. data/vendor/longfellow-zk/lib/proto/circuit_test.cc +202 -0
  253. data/vendor/longfellow-zk/lib/random/random.h +119 -0
  254. data/vendor/longfellow-zk/lib/random/random_test.cc +189 -0
  255. data/vendor/longfellow-zk/lib/random/secure_random_engine.h +37 -0
  256. data/vendor/longfellow-zk/lib/random/transcript.h +193 -0
  257. data/vendor/longfellow-zk/lib/random/transcript_test.cc +344 -0
  258. data/vendor/longfellow-zk/lib/sumcheck/circuit.h +148 -0
  259. data/vendor/longfellow-zk/lib/sumcheck/circuit_id.h +71 -0
  260. data/vendor/longfellow-zk/lib/sumcheck/equad.h +126 -0
  261. data/vendor/longfellow-zk/lib/sumcheck/hquad.h +115 -0
  262. data/vendor/longfellow-zk/lib/sumcheck/prover.h +59 -0
  263. data/vendor/longfellow-zk/lib/sumcheck/prover_layers.h +362 -0
  264. data/vendor/longfellow-zk/lib/sumcheck/quad.h +227 -0
  265. data/vendor/longfellow-zk/lib/sumcheck/quad_builder.h +211 -0
  266. data/vendor/longfellow-zk/lib/sumcheck/quad_test.cc +169 -0
  267. data/vendor/longfellow-zk/lib/sumcheck/sumcheck_test.cc +324 -0
  268. data/vendor/longfellow-zk/lib/sumcheck/testing.h +69 -0
  269. data/vendor/longfellow-zk/lib/sumcheck/transcript_sumcheck.h +85 -0
  270. data/vendor/longfellow-zk/lib/sumcheck/verifier.h +84 -0
  271. data/vendor/longfellow-zk/lib/sumcheck/verifier_layers.h +221 -0
  272. data/vendor/longfellow-zk/lib/testing/test_main.cc +50 -0
  273. data/vendor/longfellow-zk/lib/util/ceildiv.h +164 -0
  274. data/vendor/longfellow-zk/lib/util/ceildiv_test.cc +152 -0
  275. data/vendor/longfellow-zk/lib/util/crc64.h +45 -0
  276. data/vendor/longfellow-zk/lib/util/crypto.cc +39 -0
  277. data/vendor/longfellow-zk/lib/util/crypto.h +108 -0
  278. data/vendor/longfellow-zk/lib/util/log.cc +110 -0
  279. data/vendor/longfellow-zk/lib/util/log.h +33 -0
  280. data/vendor/longfellow-zk/lib/util/panic.h +40 -0
  281. data/vendor/longfellow-zk/lib/util/readbuffer.h +67 -0
  282. data/vendor/longfellow-zk/lib/util/serialization.h +54 -0
  283. data/vendor/longfellow-zk/lib/zk/zk_common.h +455 -0
  284. data/vendor/longfellow-zk/lib/zk/zk_proof.h +378 -0
  285. data/vendor/longfellow-zk/lib/zk/zk_prover.h +202 -0
  286. data/vendor/longfellow-zk/lib/zk/zk_test.cc +340 -0
  287. data/vendor/longfellow-zk/lib/zk/zk_testing.h +154 -0
  288. data/vendor/longfellow-zk/lib/zk/zk_verifier.h +109 -0
  289. metadata +347 -0
@@ -0,0 +1,171 @@
1
+ // Copyright 2026 Google LLC.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ #ifndef PRIVACY_PROOFS_ZK_LIB_CIRCUITS_TESTS_ANONCRED_PTRCRED_H_
16
+ #define PRIVACY_PROOFS_ZK_LIB_CIRCUITS_TESTS_ANONCRED_PTRCRED_H_
17
+ #include <cstddef>
18
+ #include <vector>
19
+
20
+ #include "circuits/ecdsa/verify_circuit.h"
21
+ #include "circuits/logic/bit_plucker.h"
22
+ #include "circuits/logic/memcmp.h"
23
+ #include "circuits/logic/routing.h"
24
+ #include "circuits/sha/flatsha256_circuit.h"
25
+ #include "circuits/tests/anoncred/small_io.h"
26
+
27
+ namespace proofs {
28
+
29
+ // This class creates a circuit to verify the signatures in a "ptrcred".
30
+ // A ptr credential is a document formatted as:
31
+ // n // 8 bits specifying the number of attributes
32
+ // ind <table of n pointer, each of 10 bits>
33
+ // each pointer references from the beginning of the document
34
+ // A byte string containing keys and values.
35
+ // A key consists of 3 bytes.
36
+ // A value can be arbitrarily long.
37
+ template <class LogicCircuit, class Field, class EC, size_t kNumAttr>
38
+ class PtrCred {
39
+ using EltW = typename LogicCircuit::EltW;
40
+ using Elt = typename LogicCircuit::Elt;
41
+ using Nat = typename Field::N;
42
+ using Ecdsa = VerifyCircuit<LogicCircuit, Field, EC>;
43
+ using EcdsaWitness = typename Ecdsa::Witness;
44
+
45
+ using v8 = typename LogicCircuit::v8;
46
+ using v32 = typename LogicCircuit::v32;
47
+ static constexpr size_t kIndexBits = 5;
48
+ static constexpr size_t kMaxSHABlocks = 3;
49
+ static constexpr size_t kMaxMsoLen = kMaxSHABlocks * 64 - 9;
50
+
51
+ using vind = typename LogicCircuit::template bitvec<kIndexBits>;
52
+ using Flatsha = FlatSHA256Circuit<LogicCircuit, BitPlucker<LogicCircuit, 3>>;
53
+ using RoutingL = Routing<LogicCircuit>;
54
+ using ShaBlockWitness = typename Flatsha::BlockWitness;
55
+
56
+ const LogicCircuit& lc_;
57
+ const EC& ec_;
58
+ const Nat& order_;
59
+
60
+ public:
61
+ class Witness {
62
+ public:
63
+ EltW e_;
64
+ EltW dpkx_, dpky_;
65
+
66
+ EcdsaWitness sig_;
67
+ EcdsaWitness dpk_sig_;
68
+
69
+ v8 in_[64 * kMaxSHABlocks]; /* input bytes, 64 * MAX */
70
+ v8 nb_; /* index of sha block that contains the real hash */
71
+ ShaBlockWitness sig_sha_[kMaxSHABlocks];
72
+
73
+ void input(const LogicCircuit& lc) {
74
+ e_ = lc.eltw_input();
75
+ dpkx_ = lc.eltw_input();
76
+ dpky_ = lc.eltw_input();
77
+
78
+ sig_.input(lc);
79
+ dpk_sig_.input(lc);
80
+
81
+ nb_ = lc.template vinput<8>();
82
+
83
+ // sha input init =========================
84
+ for (size_t i = 0; i < 64 * kMaxSHABlocks; ++i) {
85
+ in_[i] = lc.template vinput<8>();
86
+ }
87
+ for (size_t j = 0; j < kMaxSHABlocks; j++) {
88
+ sig_sha_[j].input(lc);
89
+ }
90
+ }
91
+ };
92
+
93
+ struct OpenedAttribute {
94
+ v8 ind; /* index of attribute */
95
+ v8 len; /* length of attribute, 1--32 */
96
+ v8 v1[32]; /* attribute value */
97
+ void input(const LogicCircuit& lc) {
98
+ ind = lc.template vinput<8>();
99
+ len = lc.template vinput<8>();
100
+ for (size_t j = 0; j < 32; ++j) {
101
+ v1[j] = lc.template vinput<8>();
102
+ }
103
+ }
104
+ };
105
+
106
+ EltW repack(const v8 in[], size_t ind) const {
107
+ EltW h = lc_.konst(0);
108
+ EltW base = lc_.konst(0x2);
109
+ for (size_t i = 0; i < 32; ++i) {
110
+ for (size_t j = 0; j < 8; ++j) {
111
+ auto t = lc_.mul(h, base);
112
+ auto tin = lc_.eval(in[ind + i][7 - j]);
113
+ h = lc_.add(tin, t);
114
+ }
115
+ }
116
+ return h;
117
+ }
118
+
119
+ explicit PtrCred(const LogicCircuit& lc, const EC& ec, const Nat& order)
120
+ : lc_(lc), ec_(ec), order_(order), sha_(lc), r_(lc) {}
121
+
122
+ void assert_credential(EltW pkX, EltW pkY, EltW hash_tr,
123
+ OpenedAttribute oa[/* NUM_ATTR */],
124
+ const v8 now[/*kDateLen*/], const Witness& vw) const {
125
+ Ecdsa ecc(lc_, ec_, order_);
126
+
127
+ ecc.verify_signature3(pkX, pkY, vw.e_, vw.sig_);
128
+ ecc.verify_signature3(vw.dpkx_, vw.dpky_, hash_tr, vw.dpk_sig_);
129
+ sha_.assert_message(kMaxSHABlocks, vw.nb_, vw.in_, vw.sig_sha_);
130
+
131
+ const Memcmp<LogicCircuit> CMP(lc_);
132
+ // validFrom <= now
133
+ lc_.assert1(CMP.leq(kDateLen, &vw.in_[84], &now[0]));
134
+
135
+ // now <= validUntil
136
+ lc_.assert1(CMP.leq(kDateLen, &now[0], &vw.in_[92]));
137
+
138
+ // DPK_{x,y}
139
+ EltW dpkx = repack(vw.in_, 100);
140
+ EltW dpky = repack(vw.in_, 132);
141
+ lc_.assert_eq(dpkx, vw.dpkx_);
142
+ lc_.assert_eq(dpky, vw.dpky_);
143
+
144
+ // Attributes parsing
145
+ const v8 zz = lc_.template vbit<8>(0xff); // cannot appear in strings
146
+ std::vector<v8> cmp_buf(32);
147
+ for (size_t ai = 0; ai < kNumAttr; ++ai) {
148
+ r_.shift(oa[ai].ind, 32, &cmp_buf[0], kMaxMsoLen, vw.in_, zz, 3);
149
+ assert_attribute(32, oa[ai].len, &cmp_buf[0], &oa[ai].v1[0]);
150
+ }
151
+ }
152
+
153
+ private:
154
+ // Checks that an attribute id or attribute value is as expected.
155
+ // The len parameter holds the byte length of the expected id or value.
156
+ void assert_attribute(size_t max, const v8& vlen, const v8 got[/*max*/],
157
+ const v8 want[/*max*/]) const {
158
+ for (size_t j = 0; j < max; ++j) {
159
+ auto ll = lc_.vlt(j, vlen);
160
+ auto cmp = lc_.veq(got[j], want[j]);
161
+ lc_.assert_implies(ll, cmp);
162
+ }
163
+ }
164
+
165
+ Flatsha sha_;
166
+ RoutingL r_;
167
+ };
168
+
169
+ } // namespace proofs
170
+
171
+ #endif // PRIVACY_PROOFS_ZK_LIB_CIRCUITS_TESTS_ANONCRED_PTRCRED_H_
@@ -0,0 +1,218 @@
1
+ // Copyright 2026 Google LLC.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ #ifndef PRIVACY_PROOFS_ZK_LIB_CIRCUITS_TESTS_ANONCRED_SMALL_H_
16
+ #define PRIVACY_PROOFS_ZK_LIB_CIRCUITS_TESTS_ANONCRED_SMALL_H_
17
+
18
+ #include <cstddef>
19
+ #include <vector>
20
+
21
+ #include "circuits/ecdsa/verify_circuit.h"
22
+ #include "circuits/logic/bit_plucker.h"
23
+ #include "circuits/logic/memcmp.h"
24
+ #include "circuits/logic/routing.h"
25
+ #include "circuits/sha/flatsha256_circuit.h"
26
+ #include "circuits/tests/anoncred/small_io.h"
27
+
28
+ namespace proofs {
29
+
30
+ // This class creates a circuit to verify the signatures in a "small" MDOC.
31
+ // A small credential is a 183-byte document formatted as:
32
+ // first_name 32 0
33
+ // family_name 32 32
34
+ // date_of_birth YYYYMMDD 64
35
+ // gender B 72
36
+ // age_over_X. BBBBBBB 73 [16, 18, 21, 25, 62, 65, 67]
37
+ // issuerid BBBB 80
38
+ // validfrom YYYYMMDD 84
39
+ // validuntil YYYYMMDD 92
40
+ // DPKX 32x 100
41
+ // DPKY 32x 132
42
+ // <arbitrary bytes of information>
43
+ template <class LogicCircuit, class Field, class EC, size_t kNumAttr>
44
+ class Small {
45
+ using EltW = typename LogicCircuit::EltW;
46
+ using Elt = typename LogicCircuit::Elt;
47
+ using Nat = typename Field::N;
48
+ using Ecdsa = VerifyCircuit<LogicCircuit, Field, EC>;
49
+ using EcdsaWitness = typename Ecdsa::Witness;
50
+
51
+ using v8 = typename LogicCircuit::v8;
52
+ using v32 = typename LogicCircuit::v32;
53
+ static constexpr size_t kIndexBits = 5;
54
+ static constexpr size_t kMaxSHABlocks = 7;
55
+ static constexpr size_t kMaxMsoLen = kMaxSHABlocks * 64 - 9;
56
+
57
+ using vind = typename LogicCircuit::template bitvec<kIndexBits>;
58
+ using Flatsha = FlatSHA256Circuit<LogicCircuit, BitPlucker<LogicCircuit, 3>>;
59
+ using RoutingL = Routing<LogicCircuit>;
60
+ using ShaBlockWitness = typename Flatsha::BlockWitness;
61
+ using sha_packed_v32 = typename Flatsha::packed_v32;
62
+
63
+ const LogicCircuit& lc_;
64
+ const EC& ec_;
65
+ const Nat& order_;
66
+
67
+ public:
68
+ class Witness {
69
+ public:
70
+ EltW e_;
71
+ EltW dpkx_, dpky_;
72
+
73
+ EcdsaWitness sig_;
74
+ EcdsaWitness dpk_sig_;
75
+
76
+ v8 in_[64 * kMaxSHABlocks]; /* input bytes, 64 * MAX */
77
+ v8 nb_; /* index of sha block that contains the real hash */
78
+ ShaBlockWitness sig_sha_[kMaxSHABlocks];
79
+
80
+ void input(const LogicCircuit& lc) {
81
+ e_ = lc.eltw_input();
82
+ dpkx_ = lc.eltw_input();
83
+ dpky_ = lc.eltw_input();
84
+
85
+ sig_.input(lc);
86
+ dpk_sig_.input(lc);
87
+
88
+ nb_ = lc.template vinput<8>();
89
+
90
+ // sha input init =========================
91
+ for (size_t i = 0; i < 64 * kMaxSHABlocks; ++i) {
92
+ in_[i] = lc.template vinput<8>();
93
+ }
94
+ for (size_t j = 0; j < kMaxSHABlocks; j++) {
95
+ sig_sha_[j].input(lc);
96
+ }
97
+ }
98
+ };
99
+
100
+ struct OpenedAttribute {
101
+ v8 ind; /* index of attribute */
102
+ v8 len; /* length of attribute, 1--32 */
103
+ v8 v1[32]; /* attribute value */
104
+ void input(const LogicCircuit& lc) {
105
+ ind = lc.template vinput<8>();
106
+ len = lc.template vinput<8>();
107
+ for (size_t j = 0; j < 32; ++j) {
108
+ v1[j] = lc.template vinput<8>();
109
+ }
110
+ }
111
+ };
112
+
113
+ explicit Small(const LogicCircuit& lc, const EC& ec, const Nat& order)
114
+ : lc_(lc), ec_(ec), order_(order), sha_(lc), r_(lc) {}
115
+
116
+ void assert_credential(EltW pkX, EltW pkY, EltW hash_tr,
117
+ OpenedAttribute oa[/* NUM_ATTR */],
118
+ const v8 now[/*kDateLen*/], const Witness& vw) const {
119
+ Ecdsa ecc(lc_, ec_, order_);
120
+
121
+ ecc.verify_signature3(pkX, pkY, vw.e_, vw.sig_);
122
+ ecc.verify_signature3(vw.dpkx_, vw.dpky_, hash_tr, vw.dpk_sig_);
123
+
124
+ sha_.assert_message(kMaxSHABlocks, vw.nb_, vw.in_, vw.sig_sha_);
125
+ assert_hash(vw.e_, vw);
126
+
127
+ const Memcmp<LogicCircuit> CMP(lc_);
128
+ // // validFrom <= now
129
+ lc_.assert1(CMP.leq(kDateLen, &vw.in_[84], &now[0]));
130
+
131
+ // // now <= validUntil
132
+ lc_.assert1(CMP.leq(kDateLen, &now[0], &vw.in_[92]));
133
+
134
+ // // DPK_{x,y}
135
+ EltW dpkx = repack(vw.in_, 100);
136
+ EltW dpky = repack(vw.in_, 132);
137
+ lc_.assert_eq(dpkx, vw.dpkx_);
138
+ lc_.assert_eq(dpky, vw.dpky_);
139
+
140
+ // Attributes parsing
141
+ const v8 zz = lc_.template vbit<8>(0xff); // cannot appear in strings
142
+ std::vector<v8> cmp_buf(32);
143
+ for (size_t ai = 0; ai < kNumAttr; ++ai) {
144
+ r_.shift(oa[ai].ind, 32, &cmp_buf[0], kMaxMsoLen, vw.in_, zz, 3);
145
+ assert_attribute(32, oa[ai].len, &cmp_buf[0], &oa[ai].v1[0]);
146
+ }
147
+ }
148
+
149
+ private:
150
+ // Checks that an attribute id or attribute value is as expected.
151
+ // The len parameter holds the byte length of the expected id or value.
152
+ void assert_attribute(size_t max, const v8& vlen, const v8 got[/*max*/],
153
+ const v8 want[/*max*/]) const {
154
+ for (size_t j = 0; j < max; ++j) {
155
+ auto ll = lc_.vlt(j, vlen);
156
+ auto cmp = lc_.veq(got[j], want[j]);
157
+ lc_.assert_implies(ll, cmp);
158
+ }
159
+ }
160
+
161
+ // Assert that the hash of the mdoc is equal to e.
162
+ // The hash is encoded in the SHA witness, and thus the correct block
163
+ // must be muxed for the comparison. Thus method first muxes the "packed"
164
+ // encoding of the SHA witness, then unpacks it and compares it to e to
165
+ // save a lot of work in the bit plucker.
166
+ void assert_hash(const EltW& e, const Witness& vw) const {
167
+ sha_packed_v32 x[8];
168
+ for (size_t b = 0; b < kMaxSHABlocks; ++b) {
169
+ auto bt = lc_.veq(vw.nb_, b + 1); /* b is zero-indexed */
170
+ auto ebt = lc_.eval(bt);
171
+ for (size_t i = 0; i < 8; ++i) {
172
+ for (size_t k = 0; k < sha_.bp_.kNv32Elts; ++k) {
173
+ if (b == 0) {
174
+ x[i][k] = lc_.mul(ebt, vw.sig_sha_[b].h1[i][k]);
175
+ } else {
176
+ auto maybe_sha = lc_.mul(ebt, vw.sig_sha_[b].h1[i][k]);
177
+ x[i][k] = lc_.add(x[i][k], maybe_sha);
178
+ }
179
+ }
180
+ }
181
+ }
182
+
183
+ EltW h = repack32(x);
184
+ lc_.assert_eq(h, e);
185
+ }
186
+
187
+ EltW repack(const v8 in[], size_t ind) const {
188
+ EltW h = lc_.konst(0);
189
+ EltW base = lc_.konst(0x2);
190
+ for (size_t i = 0; i < 32; ++i) {
191
+ for (size_t j = 0; j < 8; ++j) {
192
+ auto t = lc_.mul(h, base);
193
+ auto tin = lc_.eval(in[ind + i][7 - j]);
194
+ h = lc_.add(tin, t);
195
+ }
196
+ }
197
+ return h;
198
+ }
199
+
200
+ EltW repack32(const sha_packed_v32 H[]) const {
201
+ EltW h = lc_.konst(0);
202
+ Elt twok = lc_.one();
203
+ for (size_t j = 8; j-- > 0;) {
204
+ auto hj = sha_.bp_.unpack_v32(H[j]);
205
+ for (size_t k = 0; k < 32; ++k) {
206
+ h = lc_.axpy(h, twok, lc_.eval(hj[k]));
207
+ lc_.f_.add(twok, twok);
208
+ }
209
+ }
210
+ return h;
211
+ }
212
+
213
+ Flatsha sha_;
214
+ RoutingL r_;
215
+ };
216
+ } // namespace proofs
217
+
218
+ #endif // PRIVACY_PROOFS_ZK_LIB_CIRCUITS_TESTS_ANONCRED_SMALL_H_
@@ -0,0 +1,118 @@
1
+ // Copyright 2026 Google LLC.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ #ifndef PRIVACY_PROOFS_ZK_LIB_CIRCUITS_TESTS_ANONCRED_SMALL_EXAMPLES_H_
16
+ #define PRIVACY_PROOFS_ZK_LIB_CIRCUITS_TESTS_ANONCRED_SMALL_EXAMPLES_H_
17
+
18
+ #include <cstddef>
19
+ #include <cstdint>
20
+
21
+ #include "algebra/static_string.h"
22
+
23
+ namespace proofs {
24
+
25
+ struct SmallTest {
26
+ StaticString pkx, pky; /* public key of the issuer */
27
+ StaticString sigr, sigs, sigtr, sigts;
28
+ uint8_t transcript[1024];
29
+ size_t transcript_size;
30
+ uint8_t *now;
31
+ size_t mdoc_size;
32
+ uint8_t mdoc[5000];
33
+ };
34
+
35
+ static const struct SmallTest mdoc_small_tests[] = {
36
+ // Example that requires 3 SHA blocks for the credential.
37
+ {StaticString(
38
+ "0x298aa30b14298b8bdb5b2b1cc0150e84a86a1469fa813f8df0f0bd09d8489661"),
39
+ StaticString(
40
+ "0x2f821d00395d0c63b222a8613c7af5f5cb2b655dda6c3926af7ea3acd6a05fba"),
41
+ StaticString(
42
+ "0xc96b7605f15536877592c24d4d65066a377c34e3e6a624ea52ce9d899207"),
43
+ StaticString(
44
+ "0xaca1128a3460368caefc5c24a27a7f9e8cc8d590b93485db2c408d1ac96d80ae"),
45
+ StaticString(
46
+ "0x08ca78156b6c60c711e501641d4b5000f1ff7715386f1186ce4aec1d6eb2ba92"),
47
+ StaticString(
48
+ "0xfdcb8d4da84f1dc03a7bd22909a6bcc103281310f9fe1fb97c13e5d2eb6934df"),
49
+ {0x60, 0x80, 0xf3, 0x09, 0x55, 0x56, 0xe5, 0x21, 0x4c, 0x5f, 0xff,
50
+ 0x7c, 0x6d, 0x3d, 0xcb, 0x90, 0x3e, 0x2d, 0xcc, 0x45, 0x42, 0x9c,
51
+ 0x4d, 0x81, 0xf9, 0x80, 0x8d, 0x5e, 0x7a, 0xd2, 0x14, 0x50},
52
+ 32,
53
+ (uint8_t *)"20241005",
54
+ 183,
55
+ {0x45, 0x72, 0x69, 0x6b, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
56
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
57
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4d, 0x75, 0x73, 0x74,
58
+ 0x65, 0x72, 0x6d, 0x61, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
59
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
60
+ 0x00, 0x00, 0x00, 0x00, 0x31, 0x39, 0x38, 0x30, 0x30, 0x31, 0x30, 0x31,
61
+ 0x00, 0xf5, 0xf5, 0xf5, 0xf5, 0xf4, 0xf4, 0xf4, 0x00, 0x00, 0x00, 0x00,
62
+ 0x32, 0x30, 0x32, 0x34, 0x31, 0x30, 0x30, 0x31, 0x32, 0x30, 0x32, 0x35,
63
+ 0x31, 0x30, 0x30, 0x31, 0x3c, 0xeb, 0x4a, 0xec, 0x0d, 0x76, 0xbb, 0x50,
64
+ 0x35, 0x09, 0xc6, 0x46, 0xad, 0xc6, 0x30, 0x3f, 0xb9, 0xea, 0xa5, 0x84,
65
+ 0xb4, 0x8f, 0xa0, 0xbe, 0x07, 0x6f, 0x14, 0x28, 0xe4, 0xec, 0x3b, 0x37,
66
+ 0x77, 0x91, 0x61, 0xbe, 0xb9, 0x86, 0x90, 0xfb, 0xc8, 0xe3, 0x57, 0x5a,
67
+ 0x9d, 0xd9, 0x41, 0x91, 0xae, 0x8e, 0x4d, 0xbe, 0x2c, 0x44, 0x39, 0x07,
68
+ 0x69, 0xea, 0x0c, 0x08, 0x80, 0x22, 0xf2, 0xc6, 0x00, 0x00, 0x00, 0x00,
69
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
70
+ 0x00, 0x00, 0x00}},
71
+ // The next examples requires 4 SHA blocks for the credential.
72
+ {
73
+ StaticString("0x08a25115e57d680260aafa44e674d45d43af885fffa6746b44ece71"
74
+ "cd42febd2"),
75
+ StaticString("0x4a177f6c38543876c66573218db63de627d343f16a483a313069830"
76
+ "37df79b2f"),
77
+ StaticString("0x95394343021474ed688e7e783063c768a3343def0f1245f1da09406"
78
+ "34eb57410"),
79
+ StaticString("0x4953b2f11cd46c8e1673ac50ddc51665702a27e5788eca3a8bffa67"
80
+ "fbdbf65ce"),
81
+ StaticString("0x1ca6eef3238ec5320429774f6b6b743cc868b3cfebff96c41112b36"
82
+ "5638a9dc5"),
83
+ StaticString("0x7e303bd730d0e663621ddcaf52991ba9f744cabe161598a44b4508f"
84
+ "de7bdaf2d"),
85
+
86
+ {0x60, 0x80, 0xf3, 0x09, 0x55, 0x56, 0xe5, 0x21, 0x4c, 0x5f, 0xff,
87
+ 0x7c, 0x6d, 0x3d, 0xcb, 0x90, 0x3e, 0x2d, 0xcc, 0x45, 0x42, 0x9c,
88
+ 0x4d, 0x81, 0xf9, 0x80, 0x8d, 0x5e, 0x7a, 0xd2, 0x14, 0x50},
89
+ 32,
90
+ (uint8_t *)"20241005",
91
+ 247,
92
+ {0x45, 0x72, 0x69, 0x6b, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
93
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
94
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4d, 0x75, 0x73, 0x74,
95
+ 0x65, 0x72, 0x6d, 0x61, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
96
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
97
+ 0x00, 0x00, 0x00, 0x00, 0x31, 0x39, 0x38, 0x30, 0x30, 0x31, 0x30, 0x31,
98
+ 0x00, 0xf5, 0xf5, 0xf5, 0xf5, 0xf4, 0xf4, 0xf4, 0x00, 0x00, 0x00, 0x00,
99
+ 0x32, 0x30, 0x32, 0x34, 0x31, 0x30, 0x30, 0x31, 0x32, 0x30, 0x32, 0x35,
100
+ 0x31, 0x30, 0x30, 0x31, 0x3e, 0xf6, 0x39, 0x05, 0x33, 0xf8, 0xf3, 0x37,
101
+ 0x7d, 0xe0, 0xb2, 0xb5, 0x65, 0x19, 0x93, 0x3f, 0x49, 0xe1, 0xa1, 0x41,
102
+ 0x57, 0xa5, 0x22, 0x0e, 0xac, 0x79, 0x8a, 0xe2, 0xe2, 0xea, 0xd2, 0x0c,
103
+ 0x9f, 0x23, 0x3d, 0x1b, 0xe2, 0x8e, 0x69, 0xc1, 0xda, 0x76, 0xec, 0xf9,
104
+ 0xc3, 0x0c, 0xf9, 0x3b, 0xb5, 0xb6, 0x69, 0x6f, 0xc6, 0xc2, 0x8a, 0xa8,
105
+ 0x98, 0x19, 0x7d, 0xbf, 0xea, 0x6d, 0xad, 0x40, 0x00, 0x00, 0x00, 0x00,
106
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
107
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
108
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
109
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
110
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
111
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
112
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
113
+ },
114
+ };
115
+
116
+ } // namespace proofs
117
+
118
+ #endif // PRIVACY_PROOFS_ZK_LIB_CIRCUITS_TESTS_ANONCRED_SMALL_EXAMPLES_H_
@@ -0,0 +1,25 @@
1
+ // Copyright 2026 Google LLC.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ #ifndef PRIVACY_PROOFS_ZK_LIB_CIRCUITS_TESTS_ANONCRED_SMALL_IO_H_
16
+ #define PRIVACY_PROOFS_ZK_LIB_CIRCUITS_TESTS_ANONCRED_SMALL_IO_H_
17
+
18
+ #include <cstddef>
19
+ namespace proofs {
20
+
21
+ static constexpr size_t kDateLen = 8;
22
+
23
+ } // namespace proofs
24
+
25
+ #endif // PRIVACY_PROOFS_ZK_LIB_CIRCUITS_TESTS_ANONCRED_SMALL_IO_H_