Normal Crypto API usage is to call ioctl(CGCGSESSION) to initialize
the session, then one (or more) calls to ioctl(CIOCCRYPT) with flag
bit COP_FLAG_UPDATE set to append to the hash/xform calculation, then
a call to ioctl(CIOCCRYPT) with flag bit COP_FLAG_UPDATE cleared to
extract the result, and finally ioctl(CIOCFSESSION) to finish the
session. This follows the classic init / update* / finish data
processing model.
However crc32.c test case 8 precedes ioctl(CIOCCRYPT) with
COP_FLAG_UPDATE set with ioctl(CIOCGSESSION) and follows it with
ioctl(CIOCCRYPT) with COP_FLAG_UPDATE cleared to extract the CRC, and
then ioctl(CIOCFSESSION) to finish the session, all _within_ the loop
to CRC eight segments. This works with the software implementation
since the intermediate CRC-32 is carried forward out of one session to
seed the next session. Fix by moving the init and finish portions out
of the loop in test case 8.
Signed-off-by: Peter Barada <peter.barada@gmail.com>
Add hash testing of unaligned buffer sizes via multiple call to
ioctl(CIOCCRYPT) in a single session with buffer sizes incrementally
increasing from zero size to 255 (with monotoncially increasing
byte value data) to force all sizes to be handled by cryptodev
implementations.
Signed-off-by: Peter Barada <peter.barada@gmail.com>
Add SHA224 hash test using results generated from sha224sum.
Modify "huge block" testing since allocating 600KB to hash all
at once fails on most microcontrollers. Instead allocate a
smaller block and pass into syshash_update() enough times to
hash 600KB of data.
Signed-off-by: Peter Barada <peter.barada@gmail.com>
This adds support for testing PBKDF2 implementation. Test
vectors for SHA1 are taken from RFC6070. SHA256 vectors
were extrapolated using an online PBKDF2 generator which
was checked against RFC6070.
Signed-off-by: Vlad Pruteanu <pruteanuvlad1611@yahoo.com>
Add unistd.h and pthread.h for memorystress_main.c, unistd.h for
dhm.c and cachetest_main.c, and pthread.h for kv_test_019.c to fix
missing declarations.
Signed-off-by: hongfengchen <hongfengchen@xiaomi.com>