Changeset View
Changeset View
Standalone View
Standalone View
sys/geom/eli/g_eli.h
Show First 20 Lines • Show All 695 Lines • ▼ Show 20 Lines | |||||
int g_eli_crypto_decrypt(u_int algo, u_char *data, size_t datasize, | int g_eli_crypto_decrypt(u_int algo, u_char *data, size_t datasize, | ||||
const u_char *key, size_t keysize); | const u_char *key, size_t keysize); | ||||
struct hmac_ctx { | struct hmac_ctx { | ||||
SHA512_CTX innerctx; | SHA512_CTX innerctx; | ||||
SHA512_CTX outerctx; | SHA512_CTX outerctx; | ||||
}; | }; | ||||
void g_eli_crypto_hmac_init(struct hmac_ctx *ctx, const uint8_t *hkey, | void g_eli_crypto_hmac_init(struct hmac_ctx *ctx, const char hkey[], | ||||
size_t hkeylen); | size_t hkeylen); | ||||
void g_eli_crypto_hmac_update(struct hmac_ctx *ctx, const uint8_t *data, | void g_eli_crypto_hmac_update(struct hmac_ctx *ctx, const uint8_t *data, | ||||
size_t datasize); | size_t datasize); | ||||
void g_eli_crypto_hmac_final(struct hmac_ctx *ctx, uint8_t *md, size_t mdsize); | void g_eli_crypto_hmac_final(struct hmac_ctx *ctx, uint8_t *md, size_t mdsize); | ||||
void g_eli_crypto_hmac(const uint8_t *hkey, size_t hkeysize, | void g_eli_crypto_hmac(const char hkey[], size_t hkeysize, | ||||
const uint8_t *data, size_t datasize, uint8_t *md, size_t mdsize); | const uint8_t *data, size_t datasize, uint8_t *md, size_t mdsize); | ||||
void g_eli_key_fill(struct g_eli_softc *sc, struct g_eli_key *key, | void g_eli_key_fill(struct g_eli_softc *sc, struct g_eli_key *key, | ||||
uint64_t keyno); | uint64_t keyno); | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
void g_eli_key_init(struct g_eli_softc *sc); | void g_eli_key_init(struct g_eli_softc *sc); | ||||
void g_eli_key_destroy(struct g_eli_softc *sc); | void g_eli_key_destroy(struct g_eli_softc *sc); | ||||
uint8_t *g_eli_key_hold(struct g_eli_softc *sc, off_t offset, size_t blocksize); | uint8_t *g_eli_key_hold(struct g_eli_softc *sc, off_t offset, size_t blocksize); | ||||
void g_eli_key_drop(struct g_eli_softc *sc, uint8_t *rawkey); | void g_eli_key_drop(struct g_eli_softc *sc, uint8_t *rawkey); | ||||
#endif | #endif | ||||
#endif /* !_G_ELI_H_ */ | #endif /* !_G_ELI_H_ */ |