Mercurial > dropbear
comparison libtomcrypt/src/misc/crypt/crypt_fsa.c @ 382:0cbe8f6dbf9e
propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 2af22fb4e878750b88f80f90d439b316d229796f)
to branch 'au.asn.ucc.matt.dropbear' (head 02c413252c90e9de8e03d91e9939dde3029f5c0a)
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 11 Jan 2007 02:41:05 +0000 |
parents | |
children | f849a5ca2efc |
comparison
equal
deleted
inserted
replaced
379:b66a00272a90 | 382:0cbe8f6dbf9e |
---|---|
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(<c_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 $ */ |