summaryrefslogtreecommitdiffstats
path: root/include/crypto/algapi.h
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-02 16:39:07 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-02 16:39:07 -0800
commit06749f192b740651302a84273707d0b66749d126 (patch)
treef79f6bd1f8a8a0b63b624d78bedc5c00650f1383 /include/crypto/algapi.h
parent931cf48d2db64c67d0e917f55d7db7ab7b9fefa3 (diff)
parentdc1ccc48159d63eca5089e507c82c7d22ef60839 (diff)
downloadop-kernel-dev-06749f192b740651302a84273707d0b66749d126.zip
op-kernel-dev-06749f192b740651302a84273707d0b66749d126.tar.gz
Merge v3.13-rc2 into staging-next
we want these fixes in here. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/crypto/algapi.h')
-rw-r--r--include/crypto/algapi.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/include/crypto/algapi.h b/include/crypto/algapi.h
index 418d270..e73c19e 100644
--- a/include/crypto/algapi.h
+++ b/include/crypto/algapi.h
@@ -386,5 +386,21 @@ static inline int crypto_requires_sync(u32 type, u32 mask)
return (type ^ CRYPTO_ALG_ASYNC) & mask & CRYPTO_ALG_ASYNC;
}
-#endif /* _CRYPTO_ALGAPI_H */
+noinline unsigned long __crypto_memneq(const void *a, const void *b, size_t size);
+
+/**
+ * crypto_memneq - Compare two areas of memory without leaking
+ * timing information.
+ *
+ * @a: One area of memory
+ * @b: Another area of memory
+ * @size: The size of the area.
+ *
+ * Returns 0 when data is equal, 1 otherwise.
+ */
+static inline int crypto_memneq(const void *a, const void *b, size_t size)
+{
+ return __crypto_memneq(a, b, size) != 0UL ? 1 : 0;
+}
+#endif /* _CRYPTO_ALGAPI_H */
OpenPOWER on IntegriCloud