Closed GoogleCodeExporter closed 8 years ago
I confirm point compression works when Montgomery reduction is configured. What
happens is that y is compressed to a single bit which is incorrectly
interpreted when you print the point or just the y-coordinate. However, it
works as expected if you just test the lowest significant bit (as it's done in
ep_upk()). This number greater than zero is actually 2^n mod p, or 1 in
Montgomery representation.
Is this counter-intuitive and would it be better if the semantics was
compatible with Montgomery reduction, with the price that directly examining
the memory for the y-coordinate would now be inconsistent with intuition?
Original comment by dfaranha
on 29 Jul 2011 at 11:57
Original comment by dfaranha
on 30 Jul 2011 at 12:29
Oh, I see. It seen better this manner.
I needed to swap:
fp_zero(ecTmp->y);
fp_add_dig(ecTmp->y,1);
by
fp_zero(ecTmp->y);
fp_set_bit(ecTmp->y,0,1);
Now, the program works, thanks!
Original comment by dio...@gmail.com
on 1 Aug 2011 at 12:53
Great! I will consider this as fixed and close the issue.
Original comment by dfaranha
on 1 Aug 2011 at 5:49
Original issue reported on code.google.com by
dio...@gmail.com
on 29 Jul 2011 at 6:05