(apologies to Michael who may be receiving this twice)

I had to figure this out at some point, and it's a bit tricky. I don't
recall where I got it from, but it seems to work. I've extracted some
code below, hopefully I've extracted the right code. (It's been a
while, so i don't recall exactly how this works....)


First, it seems, you have to do this:

        RegisterSymmetricCipherDefaultFactories<Salsa20>();

Which I believe allows you to find ciphers by name. Then,

symmetricCipher =
ObjectFactoryRegistry<SymmetricCipher>::Registry().CreateObject("Salsa20");
symmetricCipher->SetKey( &key[0], key.size(),
                           MakeParameters( Name::Rounds(), rounds )
                                         ( Name::IV(),
                                         
 ConstByteArrayParameter((const byte *)&iv[0],
                                                                 
 iv.size()),
                                           false ) );


If you don't need to set rounds, (rounds == 20) you can just:

symmetricCipher->SetKey( &key[0], key.size(),
                           MakeParameters( Name::IV(),
                                         
 ConstByteArrayParameter((const byte *)&iv[0],
                                                                 
 iv.size()),
                                           false ) );

HTH,

        bjorn

On Mar 18, 11:00 pm, Michael <[email protected]> wrote:
> Trying to mimic the auth protocol of a specific network.
>
> Is it possible to set the IV, Key, AND Rounds?
>
> i see setkeywithiv, and setkeywithrounds
>
> but what about all 3?

-- 
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.

Reply via email to