projects
/
oweals
/
gnunet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
-fix the fix
[oweals/gnunet.git]
/
src
/
util
/
test_crypto_hash.c
diff --git
a/src/util/test_crypto_hash.c
b/src/util/test_crypto_hash.c
index a8ef39a380f47c4912d7fecbc59e540d23ccf7b3..731205841c50bfb17c4c9928734776f6c2ab21de 100644
(file)
--- a/
src/util/test_crypto_hash.c
+++ b/
src/util/test_crypto_hash.c
@@
-1,6
+1,6
@@
/*
This file is part of GNUnet.
/*
This file is part of GNUnet.
- (C) 2002, 2003, 2004, 2006, 2009 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2002, 2003, 2004, 2006, 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
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
@@
-14,8
+14,8
@@
You should have received a copy of the GNU General Public License
along with GNUnet; see the file COPYING. If not, write to the
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., 5
9 Temple Place - Suite 330
,
- Boston, MA 0211
1-1307
, USA.
+ Free Software Foundation, Inc., 5
1 Franklin Street, Fifth Floor
,
+ Boston, MA 0211
0-1301
, USA.
*/
/**
*/
/**
@@
-24,9
+24,7
@@
* @brief Test for crypto_hash.c
*/
#include "platform.h"
* @brief Test for crypto_hash.c
*/
#include "platform.h"
-#include "gnunet_common.h"
-#include "gnunet_crypto_lib.h"
-#include "gnunet_scheduler_lib.h"
+#include "gnunet_util_lib.h"
static char block[65536];
static char block[65536];
@@
-65,14
+63,12
@@
testEncoding ()
static int
testArithmetic ()
{
static int
testArithmetic ()
{
- static struct GNUNET_CRYPTO_AesSessionKey zskey;
- static struct GNUNET_CRYPTO_AesInitializationVector ziv;
struct GNUNET_HashCode h1;
struct GNUNET_HashCode h2;
struct GNUNET_HashCode d;
struct GNUNET_HashCode s;
struct GNUNET_HashCode h1;
struct GNUNET_HashCode h2;
struct GNUNET_HashCode d;
struct GNUNET_HashCode s;
- struct GNUNET_CRYPTO_
Aes
SessionKey skey;
- struct GNUNET_CRYPTO_
Aes
InitializationVector iv;
+ struct GNUNET_CRYPTO_
Symmetric
SessionKey skey;
+ struct GNUNET_CRYPTO_
Symmetric
InitializationVector iv;
GNUNET_CRYPTO_hash_create_random (GNUNET_CRYPTO_QUALITY_WEAK, &h1);
GNUNET_CRYPTO_hash_create_random (GNUNET_CRYPTO_QUALITY_WEAK, &h2);
GNUNET_CRYPTO_hash_create_random (GNUNET_CRYPTO_QUALITY_WEAK, &h1);
GNUNET_CRYPTO_hash_create_random (GNUNET_CRYPTO_QUALITY_WEAK, &h2);
@@
-100,9
+96,6
@@
testArithmetic ()
return 1;
memset (&d, 0, sizeof (d));
GNUNET_CRYPTO_hash_to_aes_key (&d, &skey, &iv);
return 1;
memset (&d, 0, sizeof (d));
GNUNET_CRYPTO_hash_to_aes_key (&d, &skey, &iv);
- if ((0 != memcmp (&skey, &zskey, sizeof (skey) - sizeof (unsigned int))) ||
- (0 != memcmp (&iv, &ziv, sizeof (iv))))
- return 1;
return 0;
}
return 0;
}
@@
-121,7
+114,7
@@
finished_task (void *cls, const struct GNUNET_HashCode * res)
static void
static void
-file_hasher (void *cls
, const struct GNUNET_SCHEDULER_TaskContext *tc
)
+file_hasher (void *cls)
{
GNUNET_assert (NULL !=
GNUNET_CRYPTO_hash_file (GNUNET_SCHEDULER_PRIORITY_DEFAULT,
{
GNUNET_assert (NULL !=
GNUNET_CRYPTO_hash_file (GNUNET_SCHEDULER_PRIORITY_DEFAULT,