diff options
Diffstat (limited to 'include/crypto/algapi.h')
-rw-r--r-- | include/crypto/algapi.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/include/crypto/algapi.h b/include/crypto/algapi.h index 418d270e1806..e73c19e90e38 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) | |||
386 | return (type ^ CRYPTO_ALG_ASYNC) & mask & CRYPTO_ALG_ASYNC; | 386 | return (type ^ CRYPTO_ALG_ASYNC) & mask & CRYPTO_ALG_ASYNC; |
387 | } | 387 | } |
388 | 388 | ||
389 | #endif /* _CRYPTO_ALGAPI_H */ | 389 | noinline unsigned long __crypto_memneq(const void *a, const void *b, size_t size); |
390 | |||
391 | /** | ||
392 | * crypto_memneq - Compare two areas of memory without leaking | ||
393 | * timing information. | ||
394 | * | ||
395 | * @a: One area of memory | ||
396 | * @b: Another area of memory | ||
397 | * @size: The size of the area. | ||
398 | * | ||
399 | * Returns 0 when data is equal, 1 otherwise. | ||
400 | */ | ||
401 | static inline int crypto_memneq(const void *a, const void *b, size_t size) | ||
402 | { | ||
403 | return __crypto_memneq(a, b, size) != 0UL ? 1 : 0; | ||
404 | } | ||
390 | 405 | ||
406 | #endif /* _CRYPTO_ALGAPI_H */ | ||