diff options
Diffstat (limited to 'src/mint/mint_db.h')
-rw-r--r-- | src/mint/mint_db.h | 143 |
1 files changed, 1 insertions, 142 deletions
diff --git a/src/mint/mint_db.h b/src/mint/mint_db.h index 5fab7c02a..d5a74a45d 100644 --- a/src/mint/mint_db.h +++ b/src/mint/mint_db.h | |||
@@ -29,149 +29,8 @@ | |||
29 | #include "taler_util.h" | 29 | #include "taler_util.h" |
30 | #include "taler_rsa.h" | 30 | #include "taler_rsa.h" |
31 | #include "taler-mint-httpd_db.h" | 31 | #include "taler-mint-httpd_db.h" |
32 | #include "mint.h" | ||
32 | 33 | ||
33 | /** | ||
34 | * Public information about a coin. | ||
35 | */ | ||
36 | struct TALER_CoinPublicInfo | ||
37 | { | ||
38 | /** | ||
39 | * The coin's public key. | ||
40 | */ | ||
41 | struct GNUNET_CRYPTO_EcdsaPublicKey coin_pub; | ||
42 | |||
43 | /* | ||
44 | * The public key signifying the coin's denomination. | ||
45 | */ | ||
46 | struct TALER_RSA_PublicKeyBinaryEncoded denom_pub; | ||
47 | |||
48 | /** | ||
49 | * Signature over coin_pub by denom_pub. | ||
50 | */ | ||
51 | struct TALER_RSA_Signature denom_sig; | ||
52 | }; | ||
53 | |||
54 | |||
55 | |||
56 | |||
57 | |||
58 | |||
59 | /** | ||
60 | * Reserve row. Corresponds to table 'reserves' in | ||
61 | * the mint's database. | ||
62 | */ | ||
63 | struct Reserve | ||
64 | { | ||
65 | /** | ||
66 | * Signature over the purse. | ||
67 | * Only valid if (blind_session_missing==GNUNET_YES). | ||
68 | */ | ||
69 | struct GNUNET_CRYPTO_EddsaSignature status_sig; | ||
70 | /** | ||
71 | * Signature with purpose TALER_SIGNATURE_PURSE. | ||
72 | * Only valid if (blind_session_missing==GNUNET_YES). | ||
73 | */ | ||
74 | struct GNUNET_CRYPTO_EccSignaturePurpose status_sig_purpose; | ||
75 | /** | ||
76 | * Signing key used to sign the purse. | ||
77 | * Only valid if (blind_session_missing==GNUNET_YES). | ||
78 | */ | ||
79 | struct GNUNET_CRYPTO_EddsaPublicKey status_sign_pub; | ||
80 | /** | ||
81 | * Withdraw public key, identifies the purse. | ||
82 | * Only the customer knows the corresponding private key. | ||
83 | */ | ||
84 | struct GNUNET_CRYPTO_EddsaPublicKey reserve_pub; | ||
85 | /** | ||
86 | * Remaining balance in the purse. | ||
87 | */ | ||
88 | struct TALER_AmountNBO balance; | ||
89 | |||
90 | /** | ||
91 | * Expiration date for the purse. | ||
92 | */ | ||
93 | struct GNUNET_TIME_AbsoluteNBO expiration; | ||
94 | }; | ||
95 | |||
96 | |||
97 | struct CollectableBlindcoin | ||
98 | { | ||
99 | struct TALER_RSA_BlindedSignaturePurpose ev; | ||
100 | struct TALER_RSA_Signature ev_sig; | ||
101 | struct TALER_RSA_PublicKeyBinaryEncoded denom_pub; | ||
102 | struct GNUNET_CRYPTO_EddsaPublicKey reserve_pub; | ||
103 | struct GNUNET_CRYPTO_EddsaSignature reserve_sig; | ||
104 | }; | ||
105 | |||
106 | |||
107 | struct RefreshSession | ||
108 | { | ||
109 | int has_commit_sig; | ||
110 | struct GNUNET_CRYPTO_EddsaSignature commit_sig; | ||
111 | struct GNUNET_CRYPTO_EddsaPublicKey session_pub; | ||
112 | uint16_t num_oldcoins; | ||
113 | uint16_t num_newcoins; | ||
114 | uint16_t kappa; | ||
115 | uint16_t noreveal_index; | ||
116 | uint8_t reveal_ok; | ||
117 | }; | ||
118 | |||
119 | |||
120 | #define TALER_REFRESH_SHARED_SECRET_LENGTH (sizeof (struct GNUNET_HashCode)) | ||
121 | #define TALER_REFRESH_LINK_LENGTH (sizeof (struct LinkData)) | ||
122 | |||
123 | struct RefreshCommitLink | ||
124 | { | ||
125 | struct GNUNET_CRYPTO_EddsaPublicKey session_pub; | ||
126 | struct GNUNET_CRYPTO_EcdsaPublicKey transfer_pub; | ||
127 | uint16_t cnc_index; | ||
128 | uint16_t oldcoin_index; | ||
129 | char shared_secret_enc[sizeof (struct GNUNET_HashCode)]; | ||
130 | }; | ||
131 | |||
132 | struct LinkData | ||
133 | { | ||
134 | struct GNUNET_CRYPTO_EcdsaPrivateKey coin_priv; | ||
135 | struct TALER_RSA_BlindingKeyBinaryEncoded bkey_enc; | ||
136 | }; | ||
137 | |||
138 | |||
139 | GNUNET_NETWORK_STRUCT_BEGIN | ||
140 | |||
141 | struct SharedSecretEnc | ||
142 | { | ||
143 | char data[TALER_REFRESH_SHARED_SECRET_LENGTH]; | ||
144 | }; | ||
145 | |||
146 | |||
147 | struct LinkDataEnc | ||
148 | { | ||
149 | char data[sizeof (struct LinkData)]; | ||
150 | }; | ||
151 | |||
152 | GNUNET_NETWORK_STRUCT_END | ||
153 | |||
154 | struct RefreshCommitCoin | ||
155 | { | ||
156 | struct GNUNET_CRYPTO_EddsaPublicKey session_pub; | ||
157 | struct TALER_RSA_BlindedSignaturePurpose coin_ev; | ||
158 | uint16_t cnc_index; | ||
159 | uint16_t newcoin_index; | ||
160 | char link_enc[sizeof (struct LinkData)]; | ||
161 | }; | ||
162 | |||
163 | |||
164 | struct KnownCoin | ||
165 | { | ||
166 | struct TALER_CoinPublicInfo public_info; | ||
167 | struct TALER_Amount expended_balance; | ||
168 | int is_refreshed; | ||
169 | /** | ||
170 | * Refreshing session, only valid if | ||
171 | * is_refreshed==1. | ||
172 | */ | ||
173 | struct GNUNET_CRYPTO_EddsaPublicKey refresh_session_pub; | ||
174 | }; | ||
175 | 34 | ||
176 | int | 35 | int |
177 | TALER_MINT_DB_prepare (PGconn *db_conn); | 36 | TALER_MINT_DB_prepare (PGconn *db_conn); |