diff options
Diffstat (limited to 'src/include/taler_signatures.h')
-rw-r--r-- | src/include/taler_signatures.h | 143 |
1 files changed, 139 insertions, 4 deletions
diff --git a/src/include/taler_signatures.h b/src/include/taler_signatures.h index 8c142f61f..238a915c1 100644 --- a/src/include/taler_signatures.h +++ b/src/include/taler_signatures.h | |||
@@ -13,18 +13,25 @@ | |||
13 | You should have received a copy of the GNU General Public License along with | 13 | You should have received a copy of the GNU General Public License along with |
14 | TALER; see the file COPYING. If not, If not, see <http://www.gnu.org/licenses/> | 14 | TALER; see the file COPYING. If not, If not, see <http://www.gnu.org/licenses/> |
15 | */ | 15 | */ |
16 | |||
17 | /** | 16 | /** |
18 | * @file taler-mint-keyup.c | 17 | * @file taler_signatures.h |
19 | * @brief Update the mint's keys for coins and signatures, | 18 | * @brief message formats and signature constants used to define |
20 | * using the mint's offline master key. | 19 | * the binary formats of signatures in Taler |
21 | * @author Florian Dold | 20 | * @author Florian Dold |
22 | * @author Benedikt Mueller | 21 | * @author Benedikt Mueller |
22 | * | ||
23 | * This file should define the constants and C structs that one | ||
24 | * needs to know to implement Taler clients (wallets or merchants) | ||
25 | * that need to produce or verify Taler signatures. | ||
23 | */ | 26 | */ |
24 | 27 | ||
25 | #ifndef TALER_SIGNATURES_H | 28 | #ifndef TALER_SIGNATURES_H |
26 | #define TALER_SIGNATURES_H | 29 | #define TALER_SIGNATURES_H |
27 | 30 | ||
31 | #include <gnunet/gnunet_util_lib.h> | ||
32 | #include "taler_rsa.h" | ||
33 | |||
34 | |||
28 | /** | 35 | /** |
29 | * Purpose for signing public keys signed | 36 | * Purpose for signing public keys signed |
30 | * by the mint master key. | 37 | * by the mint master key. |
@@ -102,5 +109,133 @@ | |||
102 | */ | 109 | */ |
103 | #define TALER_SIGNATURE_INCREMENTAL_DEPOSIT 202 | 110 | #define TALER_SIGNATURE_INCREMENTAL_DEPOSIT 202 |
104 | 111 | ||
112 | |||
113 | |||
114 | GNUNET_NETWORK_STRUCT_BEGIN | ||
115 | |||
116 | |||
117 | /** | ||
118 | * Request to withdraw coins from a reserve. | ||
119 | */ | ||
120 | struct TALER_WithdrawRequest | ||
121 | { | ||
122 | /** | ||
123 | * Signature over the rest of the message | ||
124 | * by the withdraw public key. | ||
125 | */ | ||
126 | struct GNUNET_CRYPTO_EddsaSignature sig; | ||
127 | |||
128 | /** | ||
129 | * Purpose must be #TALER_SIGNATURE_WITHDRAW. | ||
130 | */ | ||
131 | struct GNUNET_CRYPTO_EccSignaturePurpose purpose; | ||
132 | |||
133 | /** | ||
134 | * Reserve public key. | ||
135 | */ | ||
136 | struct GNUNET_CRYPTO_EddsaPublicKey reserve_pub; | ||
137 | |||
138 | /** | ||
139 | * Denomination public key for the coin that is withdrawn. | ||
140 | * FIXME: change to the hash of the public key (so this | ||
141 | * is fixed-size). | ||
142 | */ | ||
143 | struct TALER_RSA_PublicKeyBinaryEncoded denomination_pub; | ||
144 | |||
145 | /** | ||
146 | * Purpose containing coin's blinded public key. | ||
147 | * | ||
148 | * FIXME: this should be explicitly a variable-size field with the | ||
149 | * (blinded) message to be signed by the Mint. | ||
150 | */ | ||
151 | struct TALER_RSA_BlindedSignaturePurpose coin_envelope; | ||
152 | }; | ||
153 | |||
154 | |||
155 | |||
156 | /** | ||
157 | * FIXME | ||
158 | */ | ||
159 | struct TALER_MINT_SignKeyIssue | ||
160 | { | ||
161 | struct GNUNET_CRYPTO_EddsaSignature signature; | ||
162 | struct GNUNET_CRYPTO_EccSignaturePurpose purpose; | ||
163 | struct GNUNET_CRYPTO_EddsaPublicKey master_pub; | ||
164 | struct GNUNET_TIME_AbsoluteNBO start; | ||
165 | struct GNUNET_TIME_AbsoluteNBO expire; | ||
166 | struct GNUNET_CRYPTO_EddsaPublicKey signkey_pub; | ||
167 | }; | ||
168 | |||
169 | |||
170 | /** | ||
171 | * FIXME | ||
172 | */ | ||
173 | struct TALER_MINT_DenomKeyIssue | ||
174 | { | ||
175 | struct GNUNET_CRYPTO_EddsaSignature signature; | ||
176 | struct GNUNET_CRYPTO_EccSignaturePurpose purpose; | ||
177 | struct GNUNET_CRYPTO_EddsaPublicKey master; | ||
178 | struct GNUNET_TIME_AbsoluteNBO start; | ||
179 | struct GNUNET_TIME_AbsoluteNBO expire_withdraw; | ||
180 | struct GNUNET_TIME_AbsoluteNBO expire_spend; | ||
181 | struct TALER_RSA_PublicKeyBinaryEncoded denom_pub; | ||
182 | struct TALER_AmountNBO value; | ||
183 | struct TALER_AmountNBO fee_withdraw; | ||
184 | struct TALER_AmountNBO fee_deposit; | ||
185 | struct TALER_AmountNBO fee_refresh; | ||
186 | }; | ||
187 | |||
188 | |||
189 | /** | ||
190 | * FIXME | ||
191 | */ | ||
192 | struct RefreshMeltSignatureBody | ||
193 | { | ||
194 | struct GNUNET_CRYPTO_EccSignaturePurpose purpose; | ||
195 | struct GNUNET_HashCode melt_hash; | ||
196 | }; | ||
197 | |||
198 | /** | ||
199 | * FIXME | ||
200 | */ | ||
201 | struct RefreshCommitSignatureBody | ||
202 | { | ||
203 | struct GNUNET_CRYPTO_EccSignaturePurpose purpose; | ||
204 | struct GNUNET_HashCode commit_hash; | ||
205 | }; | ||
206 | |||
207 | |||
208 | /** | ||
209 | * FIXME | ||
210 | */ | ||
211 | struct RefreshCommitResponseSignatureBody | ||
212 | { | ||
213 | struct GNUNET_CRYPTO_EccSignaturePurpose purpose; | ||
214 | uint16_t noreveal_index; | ||
215 | }; | ||
216 | |||
217 | |||
218 | /** | ||
219 | * FIXME | ||
220 | */ | ||
221 | struct RefreshMeltResponseSignatureBody | ||
222 | { | ||
223 | struct GNUNET_CRYPTO_EccSignaturePurpose purpose; | ||
224 | struct GNUNET_HashCode melt_response_hash; | ||
225 | }; | ||
226 | |||
227 | |||
228 | /** | ||
229 | * FIXME | ||
230 | */ | ||
231 | struct RefreshMeltConfirmSignRequestBody | ||
232 | { | ||
233 | struct GNUNET_CRYPTO_EccSignaturePurpose purpose; | ||
234 | struct GNUNET_CRYPTO_EddsaPublicKey session_pub; | ||
235 | }; | ||
236 | |||
237 | |||
238 | GNUNET_NETWORK_STRUCT_END | ||
239 | |||
105 | #endif | 240 | #endif |
106 | 241 | ||