#ifndef _CRYPTO_REGISTER_CRYPTO_H_
#define _CRYPTO_REGISTER_CRYPTO_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <corecrypto/ccdigest.h>
#include <corecrypto/cchmac.h>
#include <corecrypto/ccmode.h>
#include <corecrypto/ccrc4.h>
typedef void (*ccdigest_init_fn_t)(const struct ccdigest_info *di, ccdigest_ctx_t ctx);
typedef void (*ccdigest_update_fn_t)(const struct ccdigest_info *di, ccdigest_ctx_t ctx,
unsigned long len, const void *data);
typedef void (*ccdigest_final_fn_t)(const struct ccdigest_info *di, ccdigest_ctx_t ctx,
void *digest);
typedef void (*ccdigest_fn_t)(const struct ccdigest_info *di, unsigned long len,
const void *data, void *digest);
typedef void (*cchmac_init_fn_t)(const struct ccdigest_info *di, cchmac_ctx_t ctx,
unsigned long key_len, const void *key);
typedef void (*cchmac_update_fn_t)(const struct ccdigest_info *di, cchmac_ctx_t ctx,
unsigned long data_len, const void *data);
typedef void (*cchmac_final_fn_t)(const struct ccdigest_info *di, cchmac_ctx_t ctx,
unsigned char *mac);
typedef void (*cchmac_fn_t)(const struct ccdigest_info *di, unsigned long key_len,
const void *key, unsigned long data_len, const void *data,
unsigned char *mac);
typedef void (*ccpbkdf2_hmac_fn_t)(const struct ccdigest_info *di,
unsigned long passwordLen, const void *password,
unsigned long saltLen, const void *salt,
unsigned long iterations,
unsigned long dkLen, void *dk);
typedef int (*ccdes_key_is_weak_fn_t)(void *key, unsigned long length);
typedef void (*ccdes_key_set_odd_parity_fn_t)(void *key, unsigned long length);
typedef void (*ccpad_xts_decrypt_fn_t)(const struct ccmode_xts *xts, ccxts_ctx *ctx,
unsigned long nbytes, const void *in, void *out);
typedef void (*ccpad_xts_encrypt_fn_t)(const struct ccmode_xts *xts, ccxts_ctx *ctx,
unsigned long nbytes, const void *in, void *out);
typedef struct crypto_functions {
ccdigest_init_fn_t ccdigest_init_fn;
ccdigest_update_fn_t ccdigest_update_fn;
ccdigest_final_fn_t ccdigest_final_fn;
ccdigest_fn_t ccdigest_fn;
const struct ccdigest_info * ccmd5_di;
const struct ccdigest_info * ccsha1_di;
const struct ccdigest_info * ccsha256_di;
const struct ccdigest_info * ccsha384_di;
const struct ccdigest_info * ccsha512_di;
cchmac_init_fn_t cchmac_init_fn;
cchmac_update_fn_t cchmac_update_fn;
cchmac_final_fn_t cchmac_final_fn;
cchmac_fn_t cchmac_fn;
const struct ccmode_ecb *ccaes_ecb_encrypt;
const struct ccmode_ecb *ccaes_ecb_decrypt;
const struct ccmode_cbc *ccaes_cbc_encrypt;
const struct ccmode_cbc *ccaes_cbc_decrypt;
const struct ccmode_xts *ccaes_xts_encrypt;
const struct ccmode_xts *ccaes_xts_decrypt;
const struct ccmode_ecb *ccdes_ecb_encrypt;
const struct ccmode_ecb *ccdes_ecb_decrypt;
const struct ccmode_cbc *ccdes_cbc_encrypt;
const struct ccmode_cbc *ccdes_cbc_decrypt;
const struct ccmode_ecb *cctdes_ecb_encrypt;
const struct ccmode_ecb *cctdes_ecb_decrypt;
const struct ccmode_cbc *cctdes_cbc_encrypt;
const struct ccmode_cbc *cctdes_cbc_decrypt;
const struct ccrc4_info *ccrc4_info;
const struct ccmode_ecb *ccblowfish_ecb_encrypt;
const struct ccmode_ecb *ccblowfish_ecb_decrypt;
const struct ccmode_ecb *cccast_ecb_encrypt;
const struct ccmode_ecb *cccast_ecb_decrypt;
ccdes_key_is_weak_fn_t ccdes_key_is_weak_fn;
ccdes_key_set_odd_parity_fn_t ccdes_key_set_odd_parity_fn;
ccpad_xts_encrypt_fn_t ccpad_xts_encrypt_fn;
ccpad_xts_decrypt_fn_t ccpad_xts_decrypt_fn;
} *crypto_functions_t;
int register_crypto_functions(const crypto_functions_t funcs);
#ifdef __cplusplus
}
#endif
#endif