I'm porting Crypto++ (561) to an embedded target I work with. Mostly
this has been pretty pain free, once I figured out the switch
configurations needed and defined the stack and heaps sizes large
enough.

I've got one problem that I suspect is a bug in the library or the
tests though. I'm getting a misaligned data access exception from my
hardware at line 352 in panama.cpp, function:
   template <class B>
  void Panama<B>::Iterate(size_t count, const word32 *p, word32 *z,
const word32 *y)

The problem is that y is not always 32-bit aligned. I see this when
running the validation test "Testing SymmetricCipher algorithm Panama-
LE". Looking up the call stack it looks like this originates in
RandomizedTransfer in datatest.cpp when start has a value 0x1b:

void RandomizedTransfer(BufferedTransformation &source,
BufferedTransformation &target, bool finish, const std::string
&channel=DEFAULT_CHANNEL)
{
        while (source.MaxRetrievable() > (finish ? 0 : 4096))
        {
                byte buf[4096+64];
                size_t start = GlobalRNG().GenerateWord32(0, 63);
                size_t len = GlobalRNG().GenerateWord32(1, UnsignedMin(4096U,
3*source.MaxRetrievable()/2));
                len = source.Get(buf+start, len);
                target.ChannelPut(channel, buf+start, len);
        }
}

My question are, should the iterate method in Panama expect to have
misaligned inputs or should RandomizedTransfer avoid pointing to non-
aligned buffer start points? I suspect the former but some review and
guidance would be great.

Regards,
Stuart Smith.

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