diff options
author | allanjude <allanjude@FreeBSD.org> | 2015-12-27 17:33:59 +0000 |
---|---|---|
committer | allanjude <allanjude@FreeBSD.org> | 2015-12-27 17:33:59 +0000 |
commit | c7c2f2dfabee24fac29d13375d8c29a7f766746c (patch) | |
tree | 8a9bc5399c16c0f637716b176f3f95c32c001a0f /sys/dev/random | |
parent | e7bdbef72941799b684fb8a542f52b0fbafd254d (diff) | |
download | FreeBSD-src-c7c2f2dfabee24fac29d13375d8c29a7f766746c.zip FreeBSD-src-c7c2f2dfabee24fac29d13375d8c29a7f766746c.tar.gz |
Replace sys/crypto/sha2/sha2.c with lib/libmd/sha512c.c
cperciva's libmd implementation is 5-30% faster
The same was done for SHA256 previously in r263218
cperciva's implementation was lacking SHA-384 which I implemented, validated against OpenSSL and the NIST documentation
Extend sbin/md5 to create sha384(1)
Chase dependancies on sys/crypto/sha2/sha2.{c,h} and replace them with sha512{c.c,.h}
Reviewed by: cperciva, des, delphij
Approved by: secteam, bapt (mentor)
MFC after: 2 weeks
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D3929
Diffstat (limited to 'sys/dev/random')
-rwxr-xr-x | sys/dev/random/build.sh | 2 | ||||
-rw-r--r-- | sys/dev/random/fortuna.c | 4 | ||||
-rw-r--r-- | sys/dev/random/hash.c | 2 | ||||
-rw-r--r-- | sys/dev/random/other_algorithm.c | 2 | ||||
-rw-r--r-- | sys/dev/random/randomdev.c | 2 | ||||
-rw-r--r-- | sys/dev/random/unit_test.c | 2 | ||||
-rw-r--r-- | sys/dev/random/yarrow.c | 4 |
7 files changed, 8 insertions, 10 deletions
diff --git a/sys/dev/random/build.sh b/sys/dev/random/build.sh index 2b4052d..326f8a6 100755 --- a/sys/dev/random/build.sh +++ b/sys/dev/random/build.sh @@ -42,7 +42,6 @@ cc -g -O0 -pthread \ hash.c \ ../../crypto/rijndael/rijndael-api-fst.c \ ../../crypto/rijndael/rijndael-alg-fst.c \ - ../../crypto/sha2/sha2.c \ ../../crypto/sha2/sha256c.c \ -lz \ -o yunit_test @@ -53,7 +52,6 @@ cc -g -O0 -pthread \ hash.c \ ../../crypto/rijndael/rijndael-api-fst.c \ ../../crypto/rijndael/rijndael-alg-fst.c \ - ../../crypto/sha2/sha2.c \ ../../crypto/sha2/sha256c.c \ -lz \ -o funit_test diff --git a/sys/dev/random/fortuna.c b/sys/dev/random/fortuna.c index 4ae006b..800c397 100644 --- a/sys/dev/random/fortuna.c +++ b/sys/dev/random/fortuna.c @@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$"); #include <machine/cpu.h> #include <crypto/rijndael/rijndael-api-fst.h> -#include <crypto/sha2/sha2.h> +#include <crypto/sha2/sha256.h> #include <dev/random/hash.h> #include <dev/random/randomdev.h> @@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$"); #include "unit_test.h" #include <crypto/rijndael/rijndael-api-fst.h> -#include <crypto/sha2/sha2.h> +#include <crypto/sha2/sha256.h> #include <dev/random/hash.h> #include <dev/random/randomdev.h> diff --git a/sys/dev/random/hash.c b/sys/dev/random/hash.c index 284057c..fe52cd6 100644 --- a/sys/dev/random/hash.c +++ b/sys/dev/random/hash.c @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); #endif /* _KERNEL */ #include <crypto/rijndael/rijndael-api-fst.h> -#include <crypto/sha2/sha2.h> +#include <crypto/sha2/sha256.h> #include <dev/random/hash.h> diff --git a/sys/dev/random/other_algorithm.c b/sys/dev/random/other_algorithm.c index 740e879..0c73ef5 100644 --- a/sys/dev/random/other_algorithm.c +++ b/sys/dev/random/other_algorithm.c @@ -55,7 +55,7 @@ __FBSDID("$FreeBSD$"); #include <machine/cpu.h> #include <crypto/rijndael/rijndael-api-fst.h> -#include <crypto/sha2/sha2.h> +#include <crypto/sha2/sha256.h> #include <dev/random/hash.h> #include <dev/random/randomdev.h> diff --git a/sys/dev/random/randomdev.c b/sys/dev/random/randomdev.c index f20a462..978a564 100644 --- a/sys/dev/random/randomdev.c +++ b/sys/dev/random/randomdev.c @@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$"); #include <sys/unistd.h> #include <crypto/rijndael/rijndael-api-fst.h> -#include <crypto/sha2/sha2.h> +#include <crypto/sha2/sha256.h> #include <dev/random/hash.h> #include <dev/random/randomdev.h> diff --git a/sys/dev/random/unit_test.c b/sys/dev/random/unit_test.c index f682d17..aec2f1d2 100644 --- a/sys/dev/random/unit_test.c +++ b/sys/dev/random/unit_test.c @@ -36,7 +36,7 @@ cc -g -O0 -pthread -DRANDOM_<alg> -I../.. -lstdthreads -Wall \ hash.c \ ../../crypto/rijndael/rijndael-api-fst.c \ ../../crypto/rijndael/rijndael-alg-fst.c \ - ../../crypto/sha2/sha2.c \ + ../../crypto/sha2/sha256c.c \ -lz \ -o unit_test ./unit_test diff --git a/sys/dev/random/yarrow.c b/sys/dev/random/yarrow.c index 5cb1bce..8d5f389 100644 --- a/sys/dev/random/yarrow.c +++ b/sys/dev/random/yarrow.c @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); #include <machine/cpu.h> #include <crypto/rijndael/rijndael-api-fst.h> -#include <crypto/sha2/sha2.h> +#include <crypto/sha2/sha256.h> #include <dev/random/hash.h> #include <dev/random/randomdev.h> @@ -60,7 +60,7 @@ __FBSDID("$FreeBSD$"); #include "unit_test.h" #include <crypto/rijndael/rijndael-api-fst.h> -#include <crypto/sha2/sha2.h> +#include <crypto/sha2/sha256.h> #include <dev/random/hash.h> #include <dev/random/randomdev.h> |