Commit 23c03b1
committed
Refactor CompactProof to use two type parameters R, L
BREAKING CHANGE: CompactProof now takes two type parameters instead of one.
## Motivation
When implementing serde support for types that contain CompactProof<S>,
the typenum types (like U16, U32) used for challenge lengths don't
implement Serialize/Deserialize. This makes it impossible to derive
serde for types containing CompactProof without complex workarounds.
## Changes
- Changed CompactProof<S: Sigma> to CompactProof<R, L> where:
- R is the response type
- L is the challenge length (ArrayLength<u8>)
- Added serde bounds to only serialize/deserialize R, not L
- Updated FiatShamir::prove to return CompactProof<S::Response, S::ChallengeLength>
- Updated FiatShamir::verify to accept &CompactProof<S::Response, S::ChallengeLength>
- Updated all usages throughout sigma_fun and ecdsa_fun
- Maintained bincode support with generic implementation for any challenge length
## Impact
This is a breaking change for any code that directly uses CompactProof.
Most users interact through FiatShamir which maintains the same API.1 parent 6e3bad4 commit 23c03b1
File tree
4 files changed
+53
-29
lines changed- ecdsa_fun/src/adaptor
- sigma_fun/src
- ext
4 files changed
+53
-29
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
199 | 202 | | |
200 | 203 | | |
201 | 204 | | |
| |||
213 | 216 | | |
214 | 217 | | |
215 | 218 | | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
220 | 226 | | |
221 | 227 | | |
222 | 228 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
74 | 77 | | |
75 | 78 | | |
76 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
2 | 5 | | |
3 | 6 | | |
4 | 7 | | |
| |||
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
48 | | - | |
| 51 | + | |
49 | 52 | | |
50 | 53 | | |
51 | 54 | | |
| |||
58 | 61 | | |
59 | 62 | | |
60 | 63 | | |
61 | | - | |
| 64 | + | |
62 | 65 | | |
63 | 66 | | |
64 | 67 | | |
65 | 68 | | |
66 | 69 | | |
67 | 70 | | |
68 | 71 | | |
69 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
70 | 77 | | |
71 | 78 | | |
72 | 79 | | |
| |||
89 | 96 | | |
90 | 97 | | |
91 | 98 | | |
92 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
93 | 107 | | |
94 | | - | |
| 108 | + | |
95 | 109 | | |
96 | | - | |
| 110 | + | |
97 | 111 | | |
98 | | - | |
| 112 | + | |
99 | 113 | | |
100 | 114 | | |
101 | 115 | | |
102 | 116 | | |
103 | 117 | | |
104 | | - | |
| 118 | + | |
105 | 119 | | |
106 | | - | |
| 120 | + | |
| 121 | + | |
107 | 122 | | |
108 | 123 | | |
109 | 124 | | |
| |||
118 | 133 | | |
119 | 134 | | |
120 | 135 | | |
121 | | - | |
| 136 | + | |
122 | 137 | | |
123 | | - | |
124 | | - | |
| 138 | + | |
| 139 | + | |
125 | 140 | | |
126 | 141 | | |
127 | 142 | | |
128 | 143 | | |
129 | 144 | | |
130 | | - | |
| 145 | + | |
131 | 146 | | |
132 | 147 | | |
133 | | - | |
| 148 | + | |
134 | 149 | | |
135 | 150 | | |
136 | 151 | | |
| |||
141 | 156 | | |
142 | 157 | | |
143 | 158 | | |
144 | | - | |
| 159 | + | |
145 | 160 | | |
146 | | - | |
147 | | - | |
| 161 | + | |
| 162 | + | |
148 | 163 | | |
149 | 164 | | |
150 | 165 | | |
| |||
0 commit comments