ash2005 / jcardsim

Automatically exported from code.google.com/p/jcardsim
0 stars 1 forks source link

ByteContainer should discard leading zero byte when set from BigInteger #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If the most significant bit of a BigInteger's magnitude is set, when encoded to 
a byte array, an extra leading byte will be added so that the resulting byte 
array can be passed back to the BigInteger constructor that takes only a byte 
array and no sign indicator.

This causes encoded parameters to sometimes be one byte longer than expected. 
All parameters (modulus, exponent, etc.) should be treated as unsigned numbers, 
and this leading byte can be discarded. In other words, since the sign of new 
BigInteger is fixed to be positive, we don't need to track the sign.

Original issue reported on code.google.com by erick...@bitflash.net on 13 Sep 2013 at 6:45

GoogleCodeExporter commented 9 years ago

Original comment by jcard...@licel.ru on 17 Sep 2013 at 10:14

GoogleCodeExporter commented 9 years ago
We moved to GitHub, in this connection we are closing issue tracker here. Your 
issue available here now - https://github.com/licel/jcardsim/issues/15. Become 
a watcher and you will be able to receive all updates on the project. To check 
progress on your issue click the link above.

Original comment by jcard...@licel.ru on 25 Oct 2013 at 2:18