alias des3_ede des
+The Null algorithms reside in the crypto_null module, so these lines
+should also be added:
+
+ alias cipher_null crypto_null
+ alias digest_null crypto_null
+ alias compress_null crypto_null
+
DEVELOPER NOTES
HMAC: Keyed-Hashing for Message Authentication (RFC2104).
This is required for IPSec.
+config CRYPTO_NULL
+ tristate "Null algorithms"
+ depends on CRYPTO
+ help
+ These are 'Null' algorithms, used by IPsec, which do nothing.
+
config CRYPTO_MD4
tristate "MD4 digest algorithm"
depends on CRYPTO
obj-$(CONFIG_CRYPTO) += api.o cipher.o digest.o compress.o $(autoload-crypto-y)
obj-$(CONFIG_CRYPTO_HMAC) += hmac.o
+obj-$(CONFIG_CRYPTO_NULL) += crypto_null.o
obj-$(CONFIG_CRYPTO_MD4) += md4.o
obj-$(CONFIG_CRYPTO_MD5) += md5.o
obj-$(CONFIG_CRYPTO_SHA1) += sha1.o
case CRYPTO_ALG_TYPE_DIGEST:
return crypto_init_digest_flags(tfm, flags);
- case CRYPTO_ALG_TYPE_COMP:
+ case CRYPTO_ALG_TYPE_COMPRESS:
return crypto_init_compress_flags(tfm, flags);
default:
case CRYPTO_ALG_TYPE_DIGEST:
return crypto_init_digest_ops(tfm);
- case CRYPTO_ALG_TYPE_COMP:
+ case CRYPTO_ALG_TYPE_COMPRESS:
return crypto_init_compress_ops(tfm);
default:
#include <linux/string.h>
#include "internal.h"
-/*
- * This code currently implements blazingly fast and
- * lossless Quadruple ROT13 compression.
- */
static void crypto_compress(struct crypto_tfm *tfm)
-{ }
+{
+ tfm->__crt_alg->cra_compress.coa_compress();
+}
static void crypto_decompress(struct crypto_tfm *tfm)
-{ }
+{
+ tfm->__crt_alg->cra_compress.coa_decompress();
+}
int crypto_init_compress_flags(struct crypto_tfm *tfm, u32 flags)
{
#define CRYPTO_ALG_TYPE_MASK 0x000000ff
#define CRYPTO_ALG_TYPE_CIPHER 0x00000001
#define CRYPTO_ALG_TYPE_DIGEST 0x00000002
-#define CRYPTO_ALG_TYPE_COMP 0x00000004
+#define CRYPTO_ALG_TYPE_COMPRESS 0x00000004
/*
static inline unsigned int crypto_tfm_alg_min_keysize(struct crypto_tfm *tfm)
{
+ BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
return tfm->__crt_alg->cra_cipher.cia_min_keysize;
}
static inline unsigned int crypto_tfm_alg_max_keysize(struct crypto_tfm *tfm)
{
+ BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
return tfm->__crt_alg->cra_cipher.cia_max_keysize;
}
static inline unsigned int crypto_tfm_alg_ivsize(struct crypto_tfm *tfm)
{
+ BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
return tfm->__crt_alg->cra_cipher.cia_ivsize;
}
static inline unsigned int crypto_tfm_alg_digestsize(struct crypto_tfm *tfm)
{
+ BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST);
return tfm->__crt_alg->cra_digest.dia_digestsize;
}
static inline void crypto_comp_compress(struct crypto_tfm *tfm)
{
- BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_COMP);
+ BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_COMPRESS);
tfm->crt_compress.cot_compress(tfm);
}
static inline void crypto_comp_decompress(struct crypto_tfm *tfm)
{
- BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_COMP);
+ BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_COMPRESS);
tfm->crt_compress.cot_decompress(tfm);
}