algorithms.h 2.18 KB
Newer Older
1
/* algorithms.h
Niels Möller's avatar
Niels Möller committed
2 3 4
 *
 * Translate algorithm identifiers (or names) to algorithm objects.
 *
5
 */
Niels Möller's avatar
Niels Möller committed
6 7 8 9 10

#ifndef LSH_ALGORITHMS_H_INCLUDED
#define LSH_ALGORITHMS_H_INCLUDED

#include "alist.h"
11
#include "compress.h"
12 13
#include "crypto.h"
#include "list.h"
14
#include "lsh_argp.h"
Niels Möller's avatar
Niels Möller committed
15

16 17 18 19 20 21 22 23 24
#define GABA_DECLARE
#include "algorithms.h.x"
#undef GABA_DECLARE

/* GABA:
   (class
     (name algorithms_options)
     (vars
       (algorithms object alist)
25
       
26 27
       (crypto_algorithms object int_list)
       (mac_algorithms object int_list)
28
       (compression_algorithms object int_list)
29
       (kex_algorithms object int_list)
30
       (hostkey_algorithms object int_list)))
31 32
*/

33
struct alist *all_symmetric_algorithms(void);
34
struct alist *all_signature_algorithms(void);
35

36 37 38 39 40 41 42 43 44 45 46 47
struct int_list *
default_crypto_algorithms(struct alist *algorithms);

struct int_list *
default_mac_algorithms(struct alist *algorithms);

struct int_list *
default_compression_algorithms(struct alist *algorithms);

struct int_list *
default_hostkey_algorithms(void);

48 49 50
struct int_list *
default_kex_algorithms(void);

51 52 53 54
struct int_list *
filter_algorithms(struct alist *algorithms,
		  const struct int_list *candidates);

55 56 57 58 59 60 61 62 63 64
int
lookup_crypto(struct alist *algorithms, const char *name,
	      struct crypto_algorithm **ap);
int
lookup_mac(struct alist *algorithms, const char *name,
	   struct mac_algorithm **ap);
int
lookup_compression(struct alist *algorithms, const char *name,
		   struct compress_algorithm **ap);

65 66 67
int
lookup_hostkey_algorithm(const char *name);

68 69 70
int
lookup_kex_algorithm(const char *name);

71 72 73 74 75 76 77 78 79 80
void
list_crypto_algorithms(const struct argp_state *state,
		       struct alist *algorithms);
void
list_mac_algorithms(const struct argp_state *state,
		    struct alist *algorithms);
void
list_compression_algorithms(const struct argp_state *state,
			    struct alist *algorithms);

81 82
void
list_hostkey_algorithms(const struct argp_state *state);
83

84 85 86
void
list_kex_algorithms(const struct argp_state *state);

87 88 89
void init_algorithms_options(struct algorithms_options *self,
			     struct alist *algorithms);

90 91 92
struct algorithms_options *
make_algorithms_options(struct alist *algorithms);

93 94
extern const struct argp algorithms_argp;

95
#endif /* LSH_ALGORITHMS_H_INCLUDED */