aboutsummaryrefslogtreecommitdiff
path: root/src/util/offline_signatures.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/offline_signatures.c')
-rw-r--r--src/util/offline_signatures.c63
1 files changed, 63 insertions, 0 deletions
diff --git a/src/util/offline_signatures.c b/src/util/offline_signatures.c
index cd9dceca5..7fbec826b 100644
--- a/src/util/offline_signatures.c
+++ b/src/util/offline_signatures.c
@@ -490,4 +490,67 @@ TALER_exchange_offline_wire_fee_verify (
}
+void
+TALER_exchange_offline_extension_agemask_sign (
+ const struct TALER_AgeMask mask,
+ const struct TALER_MasterPrivateKeyP *master_priv,
+ struct TALER_MasterSignatureP *master_sig)
+{
+ struct TALER_MasterExtensionAgeRestrictionPS ar = {
+ .purpose.purpose = htonl (TALER_SIGNATURE_MASTER_EXTENSION),
+ .purpose.size = htonl (sizeof(ar)),
+ .mask = mask
+ };
+ GNUNET_CRYPTO_eddsa_sign (&master_priv->eddsa_priv,
+ &ar,
+ &master_sig->eddsa_signature);
+}
+
+
+enum GNUNET_GenericReturnValue
+TALER_exchange_offline_extension_agemask_verify (
+ const struct TALER_AgeMask mask,
+ const struct TALER_MasterPublicKeyP *master_pub,
+ const struct TALER_MasterSignatureP *master_sig
+ )
+{
+ struct TALER_MasterExtensionAgeRestrictionPS ar = {
+ .purpose.purpose = htonl (TALER_SIGNATURE_MASTER_EXTENSION),
+ .purpose.size = htonl (sizeof(ar)),
+ .mask = mask
+ };
+ return
+ GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_EXTENSION,
+ &ar,
+ &master_sig->eddsa_signature,
+ &master_pub->eddsa_pub);
+}
+
+
+#if 0
+/* TODO peer2peer */
+void
+TALER_exchange_offline_extension_p2p_sign (
+ // TODO
+ const struct TALER_MasterPrivateKeyP *master_priv,
+ struct TALER_MasterSignatureP *master_sig)
+{
+ // TODO
+}
+
+
+enum GNUNET_GenericReturnValue
+TALER_exchange_offline_extension_p2p_verify (
+ // TODO
+ const struct TALER_MasterPublicKeyP *master_pub,
+ const struct TALER_MasterSignatureP *master_sig,
+ )
+{
+ // TODO
+ return GNUNET_FALSE;
+}
+
+
+#endif
+
/* end of offline_signatures.c */