comparison libtomcrypt/src/misc/crypt/crypt_fsa.c @ 398:59c7938af2bd

merge of '1250b8af44b62d8f4fe0f8d9fc7e7a1cc34e7e1c' and '7f8670ac3bb975f40967f3979d09d2199b7e90c8'
author Matt Johnston <matt@ucc.asn.au>
date Sat, 03 Feb 2007 08:20:30 +0000
parents 0cbe8f6dbf9e
children f849a5ca2efc
comparison
equal deleted inserted replaced
396:e7c1a77d2921 398:59c7938af2bd
1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis
2 *
3 * LibTomCrypt is a library that provides various cryptographic
4 * algorithms in a highly modular and flexible manner.
5 *
6 * The library is free for all purposes without any express
7 * guarantee it works.
8 *
9 * Tom St Denis, [email protected], http://libtomcrypt.com
10 */
11 #include "tomcrypt.h"
12 #include <stdarg.h>
13
14 /**
15 @file crypt_fsa.c
16 LibTomCrypt FULL SPEED AHEAD!, Tom St Denis
17 */
18
19 /* format is ltc_mp, cipher_desc, [cipher_desc], NULL, hash_desc, [hash_desc], NULL, prng_desc, [prng_desc], NULL */
20 int crypt_fsa(void *mp, ...)
21 {
22 int err;
23 va_list args;
24 void *p;
25
26 va_start(args, mp);
27 if (mp != NULL) {
28 XMEMCPY(&ltc_mp, mp, sizeof(ltc_mp));
29 }
30
31 while ((p = va_arg(args, void*)) != NULL) {
32 if ((err = register_cipher(p)) != CRYPT_OK) {
33 va_end(args);
34 return err;
35 }
36 }
37
38 while ((p = va_arg(args, void*)) != NULL) {
39 if ((err = register_hash(p)) != CRYPT_OK) {
40 va_end(args);
41 return err;
42 }
43 }
44
45 while ((p = va_arg(args, void*)) != NULL) {
46 if ((err = register_prng(p)) != CRYPT_OK) {
47 va_end(args);
48 return err;
49 }
50 }
51
52 va_end(args);
53 return CRYPT_OK;
54 }
55
56
57 /* $Source: /cvs/libtom/libtomcrypt/src/misc/crypt/crypt_fsa.c,v $ */
58 /* $Revision: 1.4 $ */
59 /* $Date: 2006/11/13 23:14:33 $ */