D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 20889 - Support construction of std.bigint.BigInt from a sign and a byte-array magnitude
Summary: Support construction of std.bigint.BigInt from a sign and a byte-array magnitude
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P1 enhancement
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2020-06-01 05:47 UTC by Nathan S.
Modified: 2020-06-20 01:08 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Nathan S. 2020-06-01 05:47:00 UTC
Support construction of std.bigint.BigInt from a sign and a byte-array magnitude. Having it in the library would avoid the necessity of workarounds seen in the wild like https://github.com/shove70/crypto/blob/4052a5ef41c604b274ffff8bf6011180cd3a474d/src/crypto/bigint.d#L91-L112

See related https://issues.dlang.org/show_bug.cgi?id=13804
Comment 1 Dlang Bot 2020-06-01 05:51:34 UTC
@n8sh created dlang/phobos pull request #7511 "Support construction of std.bigint.BigInt from a sign and a byte-array magnitude" fixing this issue:

- Fix Issue 20889 - Support construction of std.bigint.BigInt from a sign and a byte-array magnitude
  
  For consistency with other std.bigint functions allows arbitrary ranges.

https://github.com/dlang/phobos/pull/7511
Comment 2 Dlang Bot 2020-06-20 01:08:21 UTC
dlang/phobos pull request #7511 "Support construction of std.bigint.BigInt from a sign and a byte-array magnitude" was merged into master:

- a0f4b65db87a5b349bd175371607a082a5858c37 by Nathan Sashihara:
  Fix Issue 20889 - Support construction of std.bigint.BigInt from a sign and a byte-array magnitude
  
  For consistency with other std.bigint functions allows arbitrary ranges.

https://github.com/dlang/phobos/pull/7511