summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/crypto/internal.h19
-rw-r--r--include/digest.h12
2 files changed, 28 insertions, 3 deletions
diff --git a/include/crypto/internal.h b/include/crypto/internal.h
new file mode 100644
index 0000000000..c6f5908ea0
--- /dev/null
+++ b/include/crypto/internal.h
@@ -0,0 +1,19 @@
+/*
+ * (C) Copyright 2015 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+ *
+ * GPL v2 only
+ */
+
+#ifdef CONFIG_DIGEST_HMAC
+int digest_hmac_register(struct digest_algo *algo, unsigned int pad_length);
+#else
+static inline int digest_hmac_register(struct digest_algo *algo,
+ unsigned int pad_length)
+{
+ return 0;
+}
+#endif
+
+int digest_generic_verify(struct digest *d, const unsigned char *md);
+int digest_generic_digest(struct digest *d, const void *data,
+ unsigned int len, u8 *out);
diff --git a/include/digest.h b/include/digest.h
index c574b4d568..00aeee5237 100644
--- a/include/digest.h
+++ b/include/digest.h
@@ -23,10 +23,16 @@
struct digest;
-struct digest_algo {
+struct crypto_alg {
char *name;
+ char *driver_name;
+ int priority;
#define DIGEST_ALGO_NEED_KEY (1 << 0)
unsigned int flags;
+};
+
+struct digest_algo {
+ struct crypto_alg base;
int (*alloc)(struct digest *d);
void (*free)(struct digest *d);
@@ -113,12 +119,12 @@ static inline int digest_set_key(struct digest *d, const unsigned char *key,
static inline int digest_is_flags(struct digest *d, unsigned int flags)
{
- return d->algo->flags & flags;
+ return d->algo->base.flags & flags;
}
static inline const char *digest_name(struct digest *d)
{
- return d->algo->name;
+ return d->algo->base.name;
}
#endif /* __SH_ST_DEVICES_H__ */