Files
cryptsetup/lib/crypto_backend/crypto_backend.h
Milan Broz 7b6eda0d27 Add skeleton and implementation of various crypto backends
(gcrypt, OpenSSL, NSS and kernel crypto API supported for now).

There backends will be used for LUKS and plain passphrase hashing.

(Not yet used without following patches).

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@407 36d66b0a-2a48-0410-832c-cd162a569da5
2010-12-31 14:33:33 +00:00

34 lines
1.1 KiB
C

#ifndef _CRYPTO_BACKEND_H
#define _CRYPTO_BACKEND_H
#include "libcryptsetup.h"
#include "internal.h"
struct crypt_hash;
struct crypt_hmac;
int crypt_backend_init(void);
#define CRYPT_BACKEND_KERNEL (1 << 0) /* Crypto uses kernel part, for benchmark */
uint32_t crypt_backend_flags();
/* HASH */
int crypt_hash_size(const char *name);
int crypt_hash_init(struct crypt_hash **ctx, const char *name);
int crypt_hash_restart(struct crypt_hash *ctx);
int crypt_hash_write(struct crypt_hash *ctx, const char *buffer, size_t length);
int crypt_hash_final(struct crypt_hash *ctx, char *buffer, size_t length);
int crypt_hash_destroy(struct crypt_hash *ctx);
/* HMAC */
int crypt_hmac_size(const char *name);
int crypt_hmac_init(struct crypt_hmac **ctx, const char *name,
const void *buffer, size_t length);
int crypt_hmac_restart(struct crypt_hmac *ctx);
int crypt_hmac_write(struct crypt_hmac *ctx, const char *buffer, size_t length);
int crypt_hmac_final(struct crypt_hmac *ctx, char *buffer, size_t length);
int crypt_hmac_destroy(struct crypt_hmac *ctx);
#endif /* _CRYPTO_BACKEND_H */