/*
This file is part of GNUnet.
- (C) 2009 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2009 GNUnet e.V.
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
You should have received a copy of the GNU General Public License
along with GNUnet; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
*/
/**
* @file util/test_peer.c
*/
#include "platform.h"
-#include "gnunet_crypto_lib.h"
-#include "gnunet_peer_lib.h"
+#include "gnunet_util_lib.h"
+#include <gcrypt.h>
#define NUMBER_OF_PEERS 10
-#define VERBOSE GNUNET_NO
-
/**
* A list of Peer ID's to play with
*/
for (i = 0; i < NUMBER_OF_PEERS; i++)
{
- GNUNET_CRYPTO_hash_create_random (GNUNET_CRYPTO_QUALITY_WEAK,
- &pidArr[i].hashPubKey);
-#if VERBOSE
- printf ("Peer %d: %s\n", i, GNUNET_i2s (&pidArr[i]));
-#endif
+ gcry_randomize (&pidArr[i],
+ sizeof (struct GNUNET_PeerIdentity),
+ GCRY_STRONG_RANDOM);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Peer %d: %s\n", i, GNUNET_i2s (&pidArr[i]));
}
}
int
main ()
{
- int i;
+ unsigned int i;
GNUNET_log_setup ("test-peer", "ERROR", NULL);
for (i = 0; i < 1; i++)