Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo
I'm implementing a DSA signing scheme using beecrypt and I have my code signing and verifying my blobs but reading though mpnumber.h I don't see how one seralizes an mpnumber in a consistant way. All I am looking for is a function that takes an mpnumber and fills a constant length buffer (mpnputbin?). There looks to be more to mpnumber then just length/buffer.
Any suggestions would be helpful.
4030 Lake Washington Blvd. NE, Suite 208
Kirkland, WA 98033
You can serialize in a consistent way with the functions i2osp and os2ip. If you look at function mpnsetbin, you'll see that it uses os2ip. For examples of using i2osp, you can look inside c++/provider/SHA1withDSASignature.cxx.
Where do you get the impression that there's more the an mpnumber than length and buffer?
I was looking at the mpbarrett which has both modl and mu. Which seem to both be needed. Is there a reason all the serialization and functional signing code (SHA1withDSASignature.cxx) is in c++? (besides being a better language)
I went ahead and wrote my own to/from bytes for both mpnumber and mpbarrett using i2osp and op2ip because I didn't see a function for doing so in the native c portion of the lib.