summaryrefslogtreecommitdiffhomepage
path: root/libtomcrypt/src/misc/crypt/crypt_fsa.c
diff options
context:
space:
mode:
Diffstat (limited to 'libtomcrypt/src/misc/crypt/crypt_fsa.c')
-rw-r--r--libtomcrypt/src/misc/crypt/crypt_fsa.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/libtomcrypt/src/misc/crypt/crypt_fsa.c b/libtomcrypt/src/misc/crypt/crypt_fsa.c
index 3d6d86d..dc2a570 100644
--- a/libtomcrypt/src/misc/crypt/crypt_fsa.c
+++ b/libtomcrypt/src/misc/crypt/crypt_fsa.c
@@ -5,8 +5,6 @@
*
* The library is free for all purposes without any express
* guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
#include "tomcrypt.h"
#include <stdarg.h>
@@ -14,12 +12,11 @@
/**
@file crypt_fsa.c
LibTomCrypt FULL SPEED AHEAD!, Tom St Denis
-*/
+*/
/* format is ltc_mp, cipher_desc, [cipher_desc], NULL, hash_desc, [hash_desc], NULL, prng_desc, [prng_desc], NULL */
int crypt_fsa(void *mp, ...)
{
- int err;
va_list args;
void *p;
@@ -27,33 +24,33 @@ int crypt_fsa(void *mp, ...)
if (mp != NULL) {
XMEMCPY(&ltc_mp, mp, sizeof(ltc_mp));
}
-
+
while ((p = va_arg(args, void*)) != NULL) {
- if ((err = register_cipher(p)) != CRYPT_OK) {
+ if (register_cipher(p) == -1) {
va_end(args);
- return err;
+ return CRYPT_INVALID_CIPHER;
}
}
while ((p = va_arg(args, void*)) != NULL) {
- if ((err = register_hash(p)) != CRYPT_OK) {
+ if (register_hash(p) == -1) {
va_end(args);
- return err;
+ return CRYPT_INVALID_HASH;
}
}
while ((p = va_arg(args, void*)) != NULL) {
- if ((err = register_prng(p)) != CRYPT_OK) {
+ if (register_prng(p) == -1) {
va_end(args);
- return err;
+ return CRYPT_INVALID_PRNG;
}
}
va_end(args);
- return CRYPT_OK;
+ return CRYPT_OK;
}
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
+/* ref: $Format:%D$ */
+/* git commit: $Format:%H$ */
+/* commit time: $Format:%ai$ */