Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Endian fixes for the PKey encryption/decryption.
The PKey crypto code simply treats the data to be encrypted or decrypted as one single BigInt and copies the data into a BigInt verbatim. However, a BigInt simply consists of a number of 32 bit integers in the native endian format, so the data copied to/from the BigInt needs to be byteswapped on big endian systems to yield the same result as on little endian systems.
- Loading branch information
e260535
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks dubious to me. In Decrypt, exp_b_mod_c is called with data that was explicitly converted to little-endian. But in Encrypt, it is called with data that was explicitly converted to host format.