crypto-algorithms
crypto-algorithms copied to clipboard
Fixed compiler issues, fixed several algorithms, 64-bit machine fix, add Makefile to build and run all tests, rollup of all previous (to #15) pull requests
Hello,
I fixed a number of compiler warnings and add a Makefile to make (pun intended) it easy to compile and run all of the tests. If any test fails, that test will exit with an error. The 'make test' will report of all tests passed or if any test failed.
A .gitignore has been added to ignore all of the executables.
Fixed problems where AES caused some compilers to become confused while doing 3DES.
A bug in RC4, where some variables were incorrectly initialized, was fixed.
On some systems the base64 test would fail because an output buffer was not properly zeroized before use.
Changes were made to header files so that multiple header files may be included by another program. I fixed types for WORD so that 64-bit machines would use the correct size. In doing so I adjusted the BYTE type to use the same <stdint.h> convention.
I added a handy function that allows one to perform a sha256() hash in one call.
Fixed rot13 to work correctly when given non-ASCII data.
Make a fix to RC4 (ARCFOUR). While the test worked, the mechanism did not work in that state was not being preserved across calls as the comment indicated. This limitation has been fixed and replaces previous RC4 fixes relating to the I and j variables.
Best wishes and thanks
p.s. I noticed a number of other pending pull requests made a few (but not all) of the above fixes. To help I broke up this pull request into multiple commits to help identify any overlap. I did not, however, include pull request #11 as it changed the output of the test and failed to properly format it.
I also think so