Commit Graph

4 Commits

Author SHA1 Message Date
Sam Cappleman-Lynes e520bdad0d Add scalar multiplication to BigUint, BigInt
BigUint and BigInt can now be multiplied by a BigDigit, re-using the same buffer for the output, thereby reducing allocations and copying.
2017-06-28 14:02:45 +01:00
Eduardo Pinho 61cfdc37b3 BigInt two's complement adjustments
- rename `_twos_complement_` methods to just `_signed_`
- make `from_` variants take &[u8]
- refactor helper functions twos_complement (they take byte slice but use a generic function underneath)
- fix issues in `to_signed_` functions (only two's complement negative numbers; perform byte extension where needed)
- add tests to `to_signed_` methods
2017-06-18 01:42:56 +01:00
Eduardo Pinho 1660590125 Add BigInt 2's complement conversions
- add methods `from_twos_complement_bytes_le`, `from_twos_complement_bytes_be`, `to_twos_complement_bytes_le`, and `to_twos_complement_bytes_be` to `BigInt`.
- add respective tests
2017-06-16 17:58:04 +01:00
Kent Overstreet 279522316c bigint: Break out into multiple files 2016-07-18 15:56:03 -08:00