Thanks Jeff, I am rather new in this, would you mind telling me how a key can be sent by reference? and how to invoke it?
Many thanks On Saturday, August 12, 2017 at 6:05:11 AM UTC+10, Jeffrey Walton wrote: > > > > On Thursday, August 10, 2017 at 11:30:14 PM UTC-4, alido...@gmail.com > wrote: >> >> >> I installed crypto++ on my mac and try to run a simple code on xcode. I >>>> can create keys using the following: >>>> >>>> CryptoPP::AutoSeededRandomPool rng; >>>> >>>> CryptoPP::InvertibleRSAFunction param; >>>> >>>> param.GenerateRandomWithKeySize(rng,1536); >>>> >>>> CryptoPP::RSA::PrivateKey privatekey(param); >>>> >>>> CryptoPP::RSA::PublicKey publickey (param); >>>> >>>> prk.push_back(privatekey); >>>> >>>> pk.push_back(publickey); >>>> >>> >>> The push_back's look unusual. Do something else. >>> >> >> I tried with one public private key (without puch_back). Get the same >> error. >> > > I don't believe copy on PublicKey and PrivateKey is working as expected, > but I could be wrong because I did not attempt to run the code. Some > unusual things go on with those keys at times, like casting to a PrivateKey > to a PublicKey still results in a private key. I think its dangerous > especially if the key is being serialized. > > In your function, you should probably pass the key by reference. > > Jeff > > -- -- You received this message because you are subscribed to the "Crypto++ Users" Google Group. To unsubscribe, send an email to cryptopp-users-unsubscr...@googlegroups.com. More information about Crypto++ and this group is available at http://www.cryptopp.com. --- You received this message because you are subscribed to the Google Groups "Crypto++ Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to cryptopp-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.