Longfellow ZK 0290cb32
Loading...
Searching...
No Matches
small_examples.h
1// Copyright 2025 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_ANONCRED_SMALL_EXAMPLES_H_
16#define PRIVACY_PROOFS_ZK_LIB_CIRCUITS_ANONCRED_SMALL_EXAMPLES_H_
17
18#include <cstddef>
19#include <cstdint>
20
21#include "algebra/static_string.h"
22
23namespace proofs {
24
25struct 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
35static const struct SmallTest mdoc_small_tests[] = {
36 // Example that requires 3 SHA blocks for the credential.
38 "0x298aa30b14298b8bdb5b2b1cc0150e84a86a1469fa813f8df0f0bd09d8489661"),
40 "0x2f821d00395d0c63b222a8613c7af5f5cb2b655dda6c3926af7ea3acd6a05fba"),
42 "0xc96b7605f15536877592c24d4d65066a377c34e3e6a624ea52ce9d899207"),
44 "0xaca1128a3460368caefc5c24a27a7f9e8cc8d590b93485db2c408d1ac96d80ae"),
46 "0x08ca78156b6c60c711e501641d4b5000f1ff7715386f1186ce4aec1d6eb2ba92"),
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_ANONCRED_SMALL_EXAMPLES_H_
Definition static_string.h:22
Definition small_examples.h:25