123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215 |
- #ifndef CRYPTO_KERNEL
- #define CRYPTO_KERNEL
- #include "cipher.h"
- #include "auth.h"
- #include "err.h"
- #include "crypto_types.h"
- #include "key.h"
- #ifdef __cplusplus
- extern "C" {
- #endif
- typedef enum {
- srtp_crypto_kernel_state_insecure,
- srtp_crypto_kernel_state_secure
- } srtp_crypto_kernel_state_t;
- typedef struct srtp_kernel_cipher_type {
- srtp_cipher_type_id_t id;
- const srtp_cipher_type_t *cipher_type;
- struct srtp_kernel_cipher_type *next;
- } srtp_kernel_cipher_type_t;
- typedef struct srtp_kernel_auth_type {
- srtp_auth_type_id_t id;
- const srtp_auth_type_t *auth_type;
- struct srtp_kernel_auth_type *next;
- } srtp_kernel_auth_type_t;
- typedef struct srtp_kernel_debug_module {
- srtp_debug_module_t *mod;
- struct srtp_kernel_debug_module *next;
- } srtp_kernel_debug_module_t;
- typedef struct {
- srtp_crypto_kernel_state_t state;
- srtp_kernel_cipher_type_t *cipher_type_list;
- srtp_kernel_auth_type_t *auth_type_list;
- srtp_kernel_debug_module_t
- *debug_module_list;
- } srtp_crypto_kernel_t;
- srtp_err_status_t srtp_crypto_kernel_init(void);
- srtp_err_status_t srtp_crypto_kernel_shutdown(void);
- srtp_err_status_t srtp_crypto_kernel_status(void);
- srtp_err_status_t srtp_crypto_kernel_list_debug_modules(void);
- srtp_err_status_t srtp_crypto_kernel_load_cipher_type(
- const srtp_cipher_type_t *ct,
- srtp_cipher_type_id_t id);
- srtp_err_status_t srtp_crypto_kernel_load_auth_type(const srtp_auth_type_t *ct,
- srtp_auth_type_id_t id);
- srtp_err_status_t srtp_crypto_kernel_load_debug_module(
- srtp_debug_module_t *new_dm);
- srtp_err_status_t srtp_crypto_kernel_alloc_cipher(srtp_cipher_type_id_t id,
- srtp_cipher_pointer_t *cp,
- int key_len,
- int tag_len);
- srtp_err_status_t srtp_crypto_kernel_alloc_auth(srtp_auth_type_id_t id,
- srtp_auth_pointer_t *ap,
- int key_len,
- int tag_len);
- srtp_err_status_t srtp_crypto_kernel_set_debug_module(const char *mod_name,
- int v);
- #ifdef __cplusplus
- }
- #endif
- #endif
|