OSDN Git Service

add support for BLAKE2b and BLAKE2s hash sums
authorIvailo Monev <xakepa10@gmail.com>
Fri, 11 Mar 2022 04:22:41 +0000 (06:22 +0200)
committerIvailo Monev <xakepa10@gmail.com>
Fri, 11 Mar 2022 04:22:46 +0000 (06:22 +0200)
commit75589486a35eefc220dff073ea6629d048ae24b0
treeede5613375259e0b55eacab768f7ee642f876107
parentbfee83b9ab50505f7cf1a2cf410981c806ee6f8e
add support for BLAKE2b and BLAKE2s hash sums

benchmark results:
********* Start testing of tst_qcryptographichash *********
Config: Using QTest library 4.12.0, Katie 4.12.0
PASS  : tst_qcryptographichash::initTestCase()
RESULT   : tst_qcryptographichash::append():"10 (Md5)":
     0.00275 msecs per iteration (total: 551, iterations: 200000)
RESULT   : tst_qcryptographichash::append():"100 (Md5)":
     0.000625 msecs per iteration (total: 125, iterations: 200000)
RESULT   : tst_qcryptographichash::append():"250 (Md5)":
     0.000570 msecs per iteration (total: 114, iterations: 200000)
RESULT   : tst_qcryptographichash::append():"500 (Md5)":
     0.000550 msecs per iteration (total: 110, iterations: 200000)
RESULT   : tst_qcryptographichash::append():"10 (Sha1)":
     0.00327 msecs per iteration (total: 655, iterations: 200000)
RESULT   : tst_qcryptographichash::append():"100 (Sha1)":
     0.00106 msecs per iteration (total: 212, iterations: 200000)
RESULT   : tst_qcryptographichash::append():"250 (Sha1)":
     0.00131 msecs per iteration (total: 262, iterations: 200000)
RESULT   : tst_qcryptographichash::append():"500 (Sha1)":
     0.00133 msecs per iteration (total: 267, iterations: 200000)
RESULT   : tst_qcryptographichash::append():"10 (Sha256)":
     0.00467 msecs per iteration (total: 934, iterations: 200000)
RESULT   : tst_qcryptographichash::append():"100 (Sha256)":
     0.000895 msecs per iteration (total: 179, iterations: 200000)
RESULT   : tst_qcryptographichash::append():"250 (Sha256)":
     0.000850 msecs per iteration (total: 170, iterations: 200000)
RESULT   : tst_qcryptographichash::append():"500 (Sha256)":
     0.000825 msecs per iteration (total: 165, iterations: 200000)
RESULT   : tst_qcryptographichash::append():"10 (Sha512)":
     0.00361 msecs per iteration (total: 723, iterations: 200000)
RESULT   : tst_qcryptographichash::append():"100 (Sha512)":
     0.00105 msecs per iteration (total: 211, iterations: 200000)
RESULT   : tst_qcryptographichash::append():"250 (Sha512)":
     0.000995 msecs per iteration (total: 199, iterations: 200000)
RESULT   : tst_qcryptographichash::append():"500 (Sha512)":
     0.000980 msecs per iteration (total: 196, iterations: 200000)
RESULT   : tst_qcryptographichash::append():"10 (BLAKE2b)":
     0.00278 msecs per iteration (total: 557, iterations: 200000)
RESULT   : tst_qcryptographichash::append():"100 (BLAKE2b)":
     0.000740 msecs per iteration (total: 148, iterations: 200000)
RESULT   : tst_qcryptographichash::append():"250 (BLAKE2b)":
     0.000690 msecs per iteration (total: 138, iterations: 200000)
RESULT   : tst_qcryptographichash::append():"500 (BLAKE2b)":
     0.000650 msecs per iteration (total: 130, iterations: 200000)
RESULT   : tst_qcryptographichash::append():"10 (BLAKE2s)":
     0.00335 msecs per iteration (total: 670, iterations: 200000)
RESULT   : tst_qcryptographichash::append():"100 (BLAKE2s)":
     0.000645 msecs per iteration (total: 129, iterations: 200000)
RESULT   : tst_qcryptographichash::append():"250 (BLAKE2s)":
     0.000600 msecs per iteration (total: 120, iterations: 200000)
RESULT   : tst_qcryptographichash::append():"500 (BLAKE2s)":
     0.000580 msecs per iteration (total: 116, iterations: 200000)
PASS  : tst_qcryptographichash::append()
RESULT   : tst_qcryptographichash::append_once():"Md5":
     0.00154 msecs per iteration (total: 308, iterations: 200000)
RESULT   : tst_qcryptographichash::append_once():"Sha1":
     0.00211 msecs per iteration (total: 422, iterations: 200000)
RESULT   : tst_qcryptographichash::append_once():"Sha256":
     0.00415 msecs per iteration (total: 831, iterations: 200000)
RESULT   : tst_qcryptographichash::append_once():"Sha512":
     0.00314 msecs per iteration (total: 629, iterations: 200000)
RESULT   : tst_qcryptographichash::append_once():"BLAKE2b":
     0.00164 msecs per iteration (total: 328, iterations: 200000)
RESULT   : tst_qcryptographichash::append_once():"BLAKE2s":
     0.00217 msecs per iteration (total: 435, iterations: 200000)
PASS  : tst_qcryptographichash::append_once()
RESULT   : tst_qcryptographichash::statichash():"Md5":
     0.00148 msecs per iteration (total: 297, iterations: 200000)
RESULT   : tst_qcryptographichash::statichash():"Sha1":
     0.00206 msecs per iteration (total: 412, iterations: 200000)
RESULT   : tst_qcryptographichash::statichash():"Sha256":
     0.00409 msecs per iteration (total: 818, iterations: 200000)
RESULT   : tst_qcryptographichash::statichash():"Sha512":
     0.00307 msecs per iteration (total: 614, iterations: 200000)
RESULT   : tst_qcryptographichash::statichash():"BLAKE2b":
     0.00157 msecs per iteration (total: 314, iterations: 200000)
RESULT   : tst_qcryptographichash::statichash():"BLAKE2s":
     0.00211 msecs per iteration (total: 422, iterations: 200000)
PASS  : tst_qcryptographichash::statichash()
RESULT   : tst_qcryptographichash::algorithms():"Md5":
     0.00148 msecs per iteration (total: 297, iterations: 200000)
RESULT   : tst_qcryptographichash::algorithms():"Sha1":
     0.00206 msecs per iteration (total: 412, iterations: 200000)
RESULT   : tst_qcryptographichash::algorithms():"Sha256":
     0.00409 msecs per iteration (total: 819, iterations: 200000)
RESULT   : tst_qcryptographichash::algorithms():"Sha512":
     0.00307 msecs per iteration (total: 614, iterations: 200000)
RESULT   : tst_qcryptographichash::algorithms():"BLAKE2b":
     0.00157 msecs per iteration (total: 314, iterations: 200000)
RESULT   : tst_qcryptographichash::algorithms():"BLAKE2s":
     0.00212 msecs per iteration (total: 424, iterations: 200000)
PASS  : tst_qcryptographichash::algorithms()
PASS  : tst_qcryptographichash::cleanupTestCase()
Totals: 6 passed, 0 failed, 0 skipped
********* Finished testing of tst_qcryptographichash *********

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
README
src/3rdparty/digest/blake2b.c [new file with mode: 0644]
src/3rdparty/digest/blake2b.h [new file with mode: 0644]
src/3rdparty/digest/blake2s.c [new file with mode: 0644]
src/3rdparty/digest/blake2s.h [new file with mode: 0644]
src/network/CMakeLists.txt
src/network/kernel/qcryptographichash.cpp
src/network/kernel/qcryptographichash.h
tests/auto/qcryptographichash/tst_qcryptographichash.cpp
tests/benchmarks/network/kernel/qcryptographichash/main.cpp