* Added AES-CBC module. * Added functions Md5Calculate, Sha1Calculate, Sha256Calculate, and Sha512Calculate to calculate a hash in one call. * Added function Rc4XorWithKey to encrypt/decrypt a buffer with RC4 in one call. * Bugfix: AesInitialise now returns -1 if invalid key size is provided. Previously it would return 0 despite what was documented.
30 lines
1.4 KiB
C
30 lines
1.4 KiB
C
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// WjCryptLibTest_AesCbc
|
|
//
|
|
// Tests the cryptography functions against known test vectors to verify algorithms are correct.
|
|
// Tests the following:
|
|
// AES CBC
|
|
//
|
|
// This is free and unencumbered software released into the public domain - March 2018 waterjuice.org
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// IMPORTS
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
#include <stdbool.h>
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// EXPORTED FUNCTIONS
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// TestAesCbc
|
|
//
|
|
// Test AES CBC algorithm
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
bool
|
|
TestAesCbc
|
|
(
|
|
void
|
|
); |