Uses by default the OpenSSL crypto MD5 implementation.

This commit is contained in:
Andrea Mazzoleni 2011-04-12 18:58:30 +02:00
parent 5f3659e7c9
commit 21569be70d
7 changed files with 37 additions and 21 deletions

View file

@ -4,6 +4,7 @@ SnapRAID HISTORY
0.4 2011/4
==========
* Added hidden 'dry' command mainly for speed measurement.
* As default, uses the OpenSSL crypto MD5 implementation.
0.3 2011/4
==========

16
TODO
View file

@ -9,14 +9,18 @@ This is a list of possible TODO for SnapRAID. The order is not relevant.
* Reduce memory occupation removing the flag field in the block structure.
* Add RAID6 redundancy support.
There is the very good raid6 library from H. Peter Anvin (hpa) in the Linux Kernel ready to use:
See:
* Add RAID6 redundancy support. There is the very good raid6 library from
H. Peter Anvin (hpa) in the Linux Kernel ready to use. See:
http://kernel.org/pub/linux/kernel/people/hpa/raid6.pdf
http://lxr.linux.no/#linux+v2.6.38/lib/raid6
* Go multithread to speed up the MD5 computation. We can do it when syncing and checking.
* Go multithread to speed up the MD5 computation. We can do it when syncing and
checking.
* Use the O_NOATIME flag if run as 'root'.
Anyway a better solution is to mount the disk with the "noatime" and "nodiratime" options.
* Evaluate the new MurmorHash3 to use instead MD5. It should be faster, but
unsure of it's reliability. In fact, in MurmorHash2 was found a serious issue
that suggests to wait some time before using it.
* Use the O_NOATIME flag if run as 'root'. Anyway a better solution is to
mount the disk with the "noatime" and "nodiratime" options.

View file

@ -53,8 +53,14 @@ AC_ARG_WITH([crypto],
[AS_HELP_STRING([--with-crypto],
[enable the use of the MD5 fast implementation of the OpenSSL crypto library])],
[],
[with_crypto=no])
AS_IF([test "x$with_crypto" != xno], [AC_CHECK_LIB([crypto], [MD5], [], [AC_MSG_FAILURE([--with-crypto was given, but test for OpenSSL crypto library failed])])])
[with_crypto=check])
AS_IF([test "x$with_crypto" != xno], [
AC_CHECK_LIB([crypto], [MD5], [],
[if test "x$with_crypto" != xcheck; then
AC_MSG_FAILURE([--with-crypto was given, but test for OpenSSL crypto library failed])
fi
])
])
dnl Checks for test environment
AS_CASE([$host],

View file

@ -299,10 +299,9 @@ Prints more information in the processing.
.TP
.B \(hyT, \(hy\(hyspeed\(hytest
Executes a speed test of the MD5 implementation used.
As default, SnapRAID uses a C implementation, but if
configured with the \(hy\(hywith\(hycrypto option it uses the
MD5 implementation of the OpenSSL crypto library usually
faster as written in highly optimized assembler.
If available, SnapRAID uses the fast MD5 implementation
from the OpenSSL crypto library. Otherwise it uses a
slower C implementation.
.TP
.B \(hyh, \(hy\(hyhelp
Prints a short help screen.

View file

@ -94,7 +94,15 @@ void speed(void)
unsigned blocksize = 256 * 1024;
void* block = malloc_nofail(blocksize);
printf(PACKAGE " v" VERSION " by Andrea Mazzoleni, " PACKAGE_URL "\n");
#if HAVE_LIBCRYPTO
printf("Using OpenSSL libcrypto MD5\n");
#else
printf("Using portable MD5\n");
#endif
#ifdef __GNUC__
printf("Compiled with gcc " __VERSION__ "\n");
#endif
printf("Hashing speed test...\n");
gettimeofday(&start, 0);

View file

@ -212,10 +212,9 @@ Options
-T, --speed-test
Executes a speed test of the MD5 implementation used.
As default, SnapRAID uses a C implementation, but if
configured with the --with-crypto option it uses the
MD5 implementation of the OpenSSL crypto library usually
faster as written in highly optimized assembler.
If available, SnapRAID uses the fast MD5 implementation
from the OpenSSL crypto library. Otherwise it uses a
slower C implementation.
-h, --help
Prints a short help screen.

View file

@ -231,10 +231,9 @@ SnapRAID provides three simple commands that allow to:
-T, --speed-test
Executes a speed test of the MD5 implementation used.
As default, SnapRAID uses a C implementation, but if
configured with the --with-crypto option it uses the
MD5 implementation of the OpenSSL crypto library usually
faster as written in highly optimized assembler.
If available, SnapRAID uses the fast MD5 implementation
from the OpenSSL crypto library. Otherwise it uses a
slower C implementation.
-h, --help
Prints a short help screen.