+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
#include <tomcrypt.h>
#include "crypto_if.h"
+static const char *tom_init(void)
+{
+ /* nothing to initialize */
+ return "tomcrypt";
+}
+
static unsigned long tom_encrypt(void *key, int keylen, void *iv,
void *pt, void *ct, int tlen)
{
int index, rc;
unsigned long ltaglen = *taglen;
- if (keylen != 20) return CRYPT_INVALID_KEYSIZE;
if ((index = register_hash(&sha1_desc)) == -1)
return CRYPT_INVALID_HASH;
rc = hmac_memory(index, key, keylen, pt, tlen, tag, <aglen);
}
struct crypto_interface tom_crypto_if = {
- .name = "tomcrypt",
+ .init = tom_init,
.encrypt = tom_encrypt,
.decrypt = tom_decrypt,
.hash = tom_hash,