summaryrefslogtreecommitdiff
path: root/crypto/cast5_generic.c
diff options
context:
space:
mode:
authorStephan Mueller <smueller@chronox.de>2014-08-17 17:37:34 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2014-08-25 20:34:07 +0800
commit4de21f5a93d671b84dc2fa3ba89911158c1746e3 (patch)
treefc906c78fc1d17ee17913473e418b2cde613b862 /crypto/cast5_generic.c
parent3eebd831501397915d883823eab4fe42444b38b3 (diff)
downloadlinux-crypto-4de21f5a93d671b84dc2fa3ba89911158c1746e3.tar.gz
linux-crypto-4de21f5a93d671b84dc2fa3ba89911158c1746e3.zip
crypto: drbg - replace int2byte with cpu_to_be
The DRBG requires the conversion of an integer into a string representation of that integer. The previous implementation converted the given integer byte-wise. However, the kernel offers the cpu_to_be function which already re-arranges the memory representation of an integer such that it applies when interpreting the same memory as character string. The change therefore uses an integer-cast / union of the target character array together with the cpu_to_be function to convert an integer into its string representation. Tests show that the Hash and CTR DRBG implementations (the HMAC DRBG does not require such conversion) is about 10% faster (or requires less computing power, respectively). Signed-off-by: Stephan Mueller <smueller@chronox.de> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/cast5_generic.c')
0 files changed, 0 insertions, 0 deletions