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

Fix when using gcc flag "-mx32" #51

Merged
merged 4 commits into from
Sep 29, 2014
Merged

Fix when using gcc flag "-mx32" #51

merged 4 commits into from
Sep 29, 2014

Conversation

sjaeckel
Copy link
Member

the "-mx32" flag can be used to create software that uses 64bit types on 64bit architectures but uses only 32bits for pointers.

This fixes an issue with the ecc code where it was assumend that unsigned long is always the same width as the architecture, which does not apply when using "-mx32".

Therefore a new type ltc_mp_digit is introduced and used in the relevant functions.

unsigned long is 32bit wide when compiling with the compiler flag "-mx32"
but the digit size of the math libraries is still 64 bit which lead to
the buggy ecc code.

Therefore define a new type ltc_mp_digit with the correct width and use
that as return value of get_digit()

Has been tested with all three math providers
@sjaeckel sjaeckel merged commit afaef39 into develop Sep 29, 2014
sjaeckel added a commit that referenced this pull request Sep 29, 2014
@sjaeckel sjaeckel deleted the fix/x32 branch September 29, 2014 21:49
@sjaeckel sjaeckel modified the milestone: v2.0.0 Feb 21, 2017
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.

None yet

1 participant