Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 #15

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

lcn2
Copy link

@lcn2 lcn2 commented May 23, 2017

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.

lcn2 added 8 commits May 17, 2017 18:51
The typedefs used in header files are protected by
the CRYPTO_TYPES macro so that if one includes more
thann one header files, one does not see multiple
typedef errors.

Changed BYTE and WORD typedefs to ensure that they
are unsigned 8 and 32 bit values.
Fixed how 3DES triggers encrypt and decrypt.

Fixed header guard symbol.
@lcn2 lcn2 changed the title Fix compiler warnings and add Makefile to build and run all tests Fix compiler issues, fix several algorithms, 64-bit machine fix, add Makefile to build and run all tests, rollup of other pull requests May 31, 2017
@lcn2 lcn2 changed the title Fix compiler issues, fix several algorithms, 64-bit machine fix, add Makefile to build and run all tests, rollup of other pull requests Fix compiler issues, fix several algorithms, 64-bit machine fix, add Makefile to build and run all tests, rollup of previous pull requests May 31, 2017
@lcn2 lcn2 changed the title Fix compiler issues, fix several algorithms, 64-bit machine fix, add Makefile to build and run all tests, rollup of previous pull requests Fix compiler issues, fix several algorithms, 64-bit machine fix, add Makefile to build and run all tests, rollup of all previous (to #15) pull requests May 31, 2017
lcn2 added 4 commits May 31, 2017 11:59
Each test will exit 0 if all is well, or exit 1 if there was an error.

Now 'make test' will report of any of the tests failed or of all tests
passed.  It will exit non-zero of any of the tests failed.
On some systems, the base64_test() call would fail because
an output buffer was not zeroized befure using it.
@lcn2 lcn2 changed the title Fix compiler issues, fix several algorithms, 64-bit machine fix, add Makefile to build and run all tests, rollup of all previous (to #15) pull requests 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 Jun 1, 2017
@lcn2 lcn2 mentioned this pull request Jun 1, 2017
Copy link

@hxl9654 hxl9654 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also think so

@OctoThreadGardener
Copy link

I also think so

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants