I concur.

It appears that Base32 does not encode correctly. Also, there seems to
be no support for padding (that RFC 4648 seems to require).

RFC 4648 says: BASE32("foobar") = "MZXW6YTBOI======"  (but it's actually
Base32Hex - not strict Base32)

My own test-code output matched Rawler's, producing N3ZY82VBQI



On 10/9/11 10:01 AM, Rawler wrote:
> Hi,
>
> I was just trying to use the base32-decoder, noticing it produced
> unexpected output. Some further investigation, and I've now concluded
> it also produces incorrect output for the test-vectors in
> http://www.faqs.org/rfcs/rfc4648.html.
>
> CODE:
>
> #include <crypto++/filters.h>
> #include <crypto++/base32.h>
>
> #include <iostream>
>
> int main() {
>   std::string testdata("foobar");
>   std::string base32str;
>   CryptoPP::StringSource(testdata, true,
>                 new CryptoPP::Base32Encoder(
>                     new CryptoPP::StringSink(base32str)));
>   std::cout << base32str << std::endl;
>   return 0;
> }
>
> RUN:
> g++ -o test test.cpp -lcrypto++ && ./test
>
> EXPECTED:
> MZXW6YTBOI
>
> GOT:
> N3ZY82VBQI
>


-- 
Regards,
Mouse

-- 
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