aboutsummaryrefslogtreecommitdiff
path: root/src/secretsharing/test_secretsharing_sig.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/secretsharing/test_secretsharing_sig.c')
-rw-r--r--src/secretsharing/test_secretsharing_sig.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/secretsharing/test_secretsharing_sig.c b/src/secretsharing/test_secretsharing_sig.c
new file mode 100644
index 000000000..da5f0a390
--- /dev/null
+++ b/src/secretsharing/test_secretsharing_sig.c
@@ -0,0 +1,45 @@
1/*
2 This file is part of GNUnet.
3 (C) 2013 Christian Grothoff (and other contributing authors)
4
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
19*/
20
21/**
22 * @file secretsharing/test_secretsharing_sig.c
23 * @brief ...
24 */
25#include "platform.h"
26#include "gnunet_util_lib.h"
27#include "gnunet_signatures.h"
28#include "secretsharing_protocol.h"
29
30
31int
32main (int argc, char **argv)
33{
34 struct GNUNET_SECRETSHARING_KeygenCommitData *d;
35 struct GNUNET_CRYPTO_EddsaPrivateKey *private_key;
36
37 private_key = GNUNET_CRYPTO_eddsa_key_create ();
38
39 d = GNUNET_malloc (sizeof *d);
40 d->purpose.size = htons ((sizeof *d) - offsetof (struct GNUNET_SECRETSHARING_KeygenCommitData, purpose));
41 d->purpose.purpose = htons (GNUNET_SIGNATURE_PURPOSE_SECRETSHARING_DKG1);
42 GNUNET_assert (GNUNET_OK == GNUNET_CRYPTO_eddsa_sign (private_key, &d->purpose, &d->signature));
43 return 0;
44}
45