return ctr_rfc3686_aes_set_key(crypto_skcipher_tfm(tfm), in_key, key_len);
}
-
/*! \fn void ifx_deu_aes (void *ctx_arg, u8 *out_arg, const u8 *in_arg, u8 *iv_arg, u32 nbytes, int encdec, int mode)
* \ingroup IFX_AES_FUNCTIONS
* \brief main interface with deu hardware in DMA mode
.decrypt = ecb_aes_decrypt,
};
-
/*! \fn int ecb_aes_encrypt(struct skcipher_req *req)
* \ingroup IFX_AES_FUNCTIONS
* \brief CBC AES encrypt using linux crypto skcipher
.decrypt = ofb_aes_decrypt,
};
-
/*! \fn int cfb_aes_encrypt(struct skcipher_req *req)
* \ingroup IFX_AES_FUNCTIONS
* \brief CFB AES encrypt using linux crypto skcipher
.decrypt = cfb_aes_decrypt,
};
-
/*! \fn int ctr_basic_aes_encrypt(struct skcipher_req *req)
* \ingroup IFX_AES_FUNCTIONS
* \brief Counter mode AES encrypt using linux crypto skcipher
.decrypt = ctr_basic_aes_decrypt,
};
-
/*! \fn int ctr_rfc3686_aes_encrypt(struct skcipher_req *req)
* \ingroup IFX_AES_FUNCTIONS
* \brief Counter mode AES (rfc3686) encrypt using linux crypto skcipher
.decrypt = ctr_rfc3686_aes_decrypt,
};
-
/*! \fn int ifxdeu_init_aes (void)
* \ingroup IFX_AES_FUNCTIONS
* \brief function to initialize AES driver
extern int disable_deudma;
extern int disable_multiblock;
-
/*! \fn static void _deu_arc4 (void *ctx_arg, u8 *out_arg, const u8 *in_arg, u8 *iv_arg, u32 nbytes, int encdec, int mode)
\ingroup IFX_ARC4_FUNCTIONS
\brief main interface to ARC4 hardware
}
-
-
extern int disable_multiblock;
extern int disable_deudma;
-
/*! \fn int des_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen)
* \ingroup IFX_DES_FUNCTIONS
* \brief sets DES key
return err;
}
-
/*! \fn int des_setkey_skcipher (struct crypto_skcipher *tfm, const uint8_t *in_key, unsigned int key_len)
* \ingroup IFX_AES_FUNCTIONS
* \brief sets the AES keys for skcipher
return des_setkey(crypto_skcipher_tfm(tfm), in_key, key_len);
}
-
/*! \fn void ifx_deu_des(void *ctx_arg, u8 *out_arg, const u8 *in_arg, u8 *iv_arg, u32 nbytes, int encdec, int mode)
* \ingroup IFX_DES_FUNCTIONS
* \brief main interface to DES hardware
* \param mode operation mode such as ebc, cbc
*/
-
-
/*! \fn void ifx_deu_des_ecb (void *ctx, uint8_t *dst, const uint8_t *src, uint8_t *iv, size_t nbytes, int encdec, int inplace)
* \ingroup IFX_DES_FUNCTIONS
* \brief sets DES hardware to ECB mode
* \param encdec 1 for encrypt; 0 for decrypt
* \param inplace not used
*/
-
void ifx_deu_des_ecb (void *ctx, uint8_t *dst, const uint8_t *src,
uint8_t *iv, size_t nbytes, int encdec, int inplace)
{
crypto_unregister_skcipher (&ifxdeu_cbc_des3_ede_alg);
}
-
*((u32 *) hash + 2) = hashs->D3R;
*((u32 *) hash + 3) = hashs->D4R;
- mctx->started = 1;
-
CRTCL_SECT_HASH_END;
+
+ mctx->started = 1;
}
/*! \fn static inline void md5_transform_helper(struct md5_ctx *ctx)
crypto_unregister_shash(&ifxdeu_md5_alg);
}
-
static int md5_hmac_setkey(struct crypto_shash *tfm, const u8 *key, unsigned int keylen)
{
struct md5_hmac_ctx *mctx = crypto_shash_ctx(tfm);
- volatile struct deu_hash_t *hash = (struct deu_hash_t *) HASH_START;
int err;
//printk("copying keys to context with length %d\n", keylen);
return 0;
}
-
/*! \fn int md5_hmac_setkey_hw(const u8 *key, unsigned int keylen)
* \ingroup IFX_MD5_HMAC_FUNCTIONS
* \brief sets md5 hmac key into the hardware registers
* \param key input key
* \param keylen key length greater than 64 bytes IS NOT SUPPORTED
*/
-
static int md5_hmac_setkey_hw(const u8 *key, unsigned int keylen)
{
volatile struct deu_hash_t *hash = (struct deu_hash_t *) HASH_START;
in += 16;
}
-
#if 1
if (hash_final) {
//wait for digest ready
*((u32 *) out + 2) = hashs->D3R;
*((u32 *) out + 3) = hashs->D4R;
+ CRTCL_SECT_HASH_END;
+
if (hash_final) {
/* reset the context after we finish with the hash */
mctx->byte_count = 0;
} else {
mctx->dbn = 0;
}
- CRTCL_SECT_HASH_END;
-
-
- return 0;
+ return 0;
}
/*! \fn void md5_hmac_init_tfm(struct crypto_tfm *tfm)
kfree(mctx->desc);
}
-
/*
* \brief MD5_HMAC function mappings
*/
-
static struct shash_alg ifxdeu_md5_hmac_alg = {
.digestsize = MD5_DIGEST_SIZE,
.init = md5_hmac_init,
{
crypto_unregister_shash(&ifxdeu_md5_hmac_alg);
}
-
-
\brief ifx deu sha1 functions
*/
-
/* Project header */
#include <linux/init.h>
#include <linux/module.h>
extern int disable_deudma;
-
/*! \fn static void sha1_transform1 (u32 *state, const u32 *in)
* \ingroup IFX_SHA1_FUNCTIONS
* \brief main interface to sha1 hardware
}
-
-
\brief ifx sha1 hmac functions
*/
-
/* Project header */
#include <linux/init.h>
#include <linux/module.h>
static int sha1_hmac_setkey(struct crypto_shash *tfm, const u8 *key, unsigned int keylen)
{
struct sha1_hmac_ctx *sctx = crypto_shash_ctx(tfm);
- volatile struct deu_hash_t *hash = (struct deu_hash_t *) HASH_START;
int err;
if (keylen > SHA1_HMAC_MAX_KEYLEN) {
return 0;
}
-
/*! \fn int sha1_hmac_setkey_hw(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen)
* \ingroup IFX_SHA1_HMAC_FUNCTIONS
* \brief sets sha1 hmac key into hw registers
*((u32 *) out + 3) = hashs->D4R;
*((u32 *) out + 4) = hashs->D5R;
+ CRTCL_SECT_HASH_END;
+
if (hash_final) {
memset(&sctx->buffer[0], 0, SHA1_HMAC_BLOCK_SIZE);
sctx->count = 0;
sctx->dbn = 0;
}
//printk("debug ln: %d, fn: %s\n", __LINE__, __func__);
- CRTCL_SECT_HASH_END;
-
return 0;
kfree(sctx->desc);
}
-
/*
* \brief SHA1_HMAC function mappings
*/
}
};
-
/*! \fn int ifxdeu_init_sha1_hmac (void)
* \ingroup IFX_SHA1_HMAC_FUNCTIONS
* \brief initialize sha1 hmac driver
}
-