path: root/crypto/streebog_generic.c
AgeCommit message (Collapse)Author
2019-08-15crypto: streebog - remove two unused variablesYueHaibing
crypto/streebog_generic.c:162:17: warning: Pi defined but not used [-Wunused-const-variable=] crypto/streebog_generic.c:151:17: warning: Tau defined but not used [-Wunused-const-variable=] They are never used, so can be removed. Reported-by: Hulk Robot <> Signed-off-by: YueHaibing <> Reviewed-by: Vitaly Chikunov <> Signed-off-by: Herbert Xu <>
2019-04-18crypto: run initcalls for generic implementations earlierEric Biggers
Use subsys_initcall for registration of all templates and generic algorithm implementations, rather than module_init. Then change cryptomgr to use arch_initcall, to place it before the subsys_initcalls. This is needed so that when both a generic and optimized implementation of an algorithm are built into the kernel (not loadable modules), the generic implementation is registered before the optimized one. Otherwise, the self-tests for the optimized implementation are unable to allocate the generic implementation for the new comparison fuzz tests. Note that on arm, a side effect of this change is that self-tests for generic implementations may run before the unaligned access handler has been installed. So, unaligned accesses will crash the kernel. This is arguably a good thing as it makes it easier to detect that type of bug. Signed-off-by: Eric Biggers <> Signed-off-by: Herbert Xu <>
2019-04-08crypto: streebog - fix unaligned memory accessesEric Biggers
Don't cast the data buffer directly to streebog_uint512, as this violates alignment rules. Fixes: fe18957e8e87 ("crypto: streebog - add Streebog hash function") Cc: Vitaly Chikunov <> Signed-off-by: Eric Biggers <> Reviewed-by: Vitaly Chikunov <> Signed-off-by: Herbert Xu <>
2019-01-18crypto: streebog - use correct endianness typeEric Biggers
streebog_uint512::qword needs to be __le64, not u64. This fixes a large number of sparse warnings: crypto/streebog_generic.c:25:9: warning: incorrect type in initializer (different base types) crypto/streebog_generic.c:25:9: expected unsigned long long crypto/streebog_generic.c:25:9: got restricted __le64 [usertype] [omitted many similar warnings] No actual change in behavior. Cc: Vitaly Chikunov <> Signed-off-by: Eric Biggers <> Signed-off-by: Herbert Xu <>
2018-11-16crypto: streebog - add Streebog hash functionVitaly Chikunov
Add GOST/IETF Streebog hash function (GOST R 34.11-2012, RFC 6986) generic hash transformation. Cc: Signed-off-by: Vitaly Chikunov <> Reviewed-by: Ard Biesheuvel <> Signed-off-by: Herbert Xu <>