Re: [Boost-bugs] [Boost C++ Libraries] #9235: Construction from binary data

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #9235: Construction from binary data
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-10-12 11:09:11


#9235: Construction from binary data
-------------------------------+----------------------------
  Reporter: psiha | Owner: johnmaddock
      Type: Bugs | Status: reopened
 Milestone: To Be Determined | Component: multiprecision
   Version: Boost 1.54.0 | Severity: Optimization
Resolution: | Keywords:
-------------------------------+----------------------------
Changes (by psiha):

 * status: closed => reopened
 * resolution: wontfix =>

Comment:

 1) you somewhat contradict yourself here WRT to
 https://svn.boost.org/trac/boost/ticket/9234#comment:1 where you refer to
 contruction from a string as something non trivial
 [[BR]]
  2) regardless, closing this as wontfix (instead of at least postponing
 until you or someone else finds the time) is lame IMO because this is
 certainly doable...'of the top of my head': you'd 'just' need to define an
 underlying POD which could be filled through a macro that'd:
 - fill the raw array that represents the number
 - set any aditional/auxiliary members you might have in number<>
 - define a fully typeed number<> & bound to the helper underlying POD
 instance...
 - "I know" it is doable because in my code (which I don't have with me now
 as I'm not at work) I had to do the opposite: retrieve the raw binary data
 from a cpp_int in order to compare it to an expected signature which I did
 by reinterpret_casting your number<> to a boost::array<> and calling
 std::reverse() on it...so this is one more function missing from the
 interface (retreiving a numbers raw byte representation as opposed to a
 slow EH littered dynamically allocated std::string conversion)
 [[BR]]
  3) the ticket isn't (only) about static strings but creation from binary
 data in general (which one may receive or generate at runtime, for example
 from a different big-int library) so a function that does this (what I
 currently do with the mentioned loop in the other ticket) is certainly
 needed
 [[BR]]
  4 when one uses your lib for cryptography or hash/licence verification
 storing (private) keys as plain text hex strings is not an option

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9235#comment:4>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:14 UTC