Re: reinterpret_cast<byte*> truncating to 8
Jeffrey Walton <[email protected]>
| Newsgroups | gmane.comp.encryption.cryptopp |
|---|---|
| Message-ID | <[email protected]> |
On Tuesday, March 9, 2021 at 3:45:47 PM UTC-5 [email protected] wrote: > Thank you for your reply. > > I am following this example - > https://www.cryptopp.com/wiki/XChaCha20Poly1305 > > and trying to use std::string instead of byte > > instead of using byte array for ct like this > dec.DecryptAndVerify(rt, mac, sizeof(mac), iv, sizeof(iv), aad, > sizeof(aad), ct, sizeof(ct)); > > I am trying to use string like this > > std::string cipher; > > StringSource(ct, *sizeof*(ct), *true*, *new* HexEncoder(*new* > StringSink(cipher))); > > *const* byte* xct = *reinterpret_cast*<*const* byte*>(cipher.data()); > > dec.DecryptAndVerify(rt, mac, sizeof(mac), iv, sizeof(iv), aad, > sizeof(aad), xct, *sizeof*(xct)); > dec.DecryptAndVerify(rt, mac, sizeof(mac), iv, sizeof(iv), aad, sizeof(aad), xct, cipher.size()); Jeff -- 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]. To view this discussion on the web visit https://groups.google.com/d/msgid/cryptopp-users/114f8723-1e85-4cf7-8b31-f3b893caf0d5n%40googlegroups.com.