Skip to content

Conversation

dunhamsteve
Copy link

This is my first pull request on github. Hopefully I'm doing it right.

I think I discovered an issue in your CMC implementation on platforms with signed characters. Due to sign extension, the value that you're using for carry ends up being much larger than "1". My proposed solution is to cast the characters that you're pulling from string to uint8_t.

I discovered this while trying to write my own implementation of CMC in Java to play around with encrypted databases. I could find no test vectors, so I thought I'd generate some with your code. I couldn't get the results to match, so I tweaked your code to print out the value of m, which ended up having a lot of ff in it. (I'm using clang on OSX, but g++ on Linux appears to have similar issues.)

I know this is a fairly old project, but I thought I should let someone know.

The attached patch should fix the issue, but I presume it would break existing databases.

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.

1 participant