On Monday, December 3, 2018 at 11:58:54 AM UTC-5, [email protected] wrote: > > Hi, > when decrypting using pipelines I would normally do something like: > > StringSource ss(cipher_hex, true, new HexDecoder(new > StreamTransformationFilter(dec, new StringSink(recover)))); > > Now i ran into a problem using the Panama Stream Cipher: > > AutoSeededRandomPool prng; > std::string plain("High-school students – who have been protesting > against changes to colleges and the university system – also seized on the > mood of protest and stepped up their blockades."); > std::string cipher_hex, recover1, recover2, cipher_bin; > > SecByteBlock key(32), iv(32); > prng.GenerateBlock(key, key.size()); > prng.GenerateBlock(iv, iv.size()); > > PanamaCipher<LittleEndian>::Encryption enc; > enc.SetKeyWithIV(key, key.size(), iv, iv.size()); > PanamaCipher<LittleEndian>::Decryption dec; > dec.SetKeyWithIV(key, key.size(), iv, iv.size()); > > StringSource (plain, true, new StreamTransformationFilter(enc, new > HexEncoder(new StringSink(cipher_hex)))); > > // works fine, recover1 = plain > StringSource (cipher_hex, true, new HexDecoder(new StringSink( > cipher_bin))); > StringSource (cipher_bin, true, new StreamTransformationFilter(dec, > new StringSink(recover1))); > > dec.Resynchronize(iv, iv.size()); > > // does not work, recover2 = "High-school students – who have been > protesting against changes –Ö)‘à« ç›áS` ¥¨~]Šm Qÿö:Û (...) " > StringSource (cipher_hex, true, new HexDecoder(new > StreamTransformationFilter(dec, new StringSink(recover2)))); > > Is this expected behaviour? Is it not possible to use a Decoder inside the > decryption pipeline of a stream cipher? >
No, its not expected behavior. I can duplicate it with GCC 8.2.1 on Fedora 29. Clang 6.0.1 is OK on Fedora 29. GCC 6 and Clang 6 are OK on OS X. Let me see if I can find a workaround in the code. Jeff -- You received this message because you are subscribed to "Crypto++ Users". More information about Crypto++ and this group is available at http://www.cryptopp.com and http://groups.google.com/forum/#!forum/cryptopp-users. --- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
