I'm on a mac compiling with xcode 4 on Snow Leapord for OS/X build
64bit using cryptopp 5.6.1


Assertion failed: (memcmp(P, A, 4*WORD_SIZE)==0), function
AtomicDivide, file cryptopp/integer.cpp, line 2530.

Related cryptopp code:
                assert(!T[2] && !T[3] && (T[1] < B[1] || (T[1]==B[1] &&
T[0]<B[0])));
                word P[4];
                s_pMul[0](P, Q, B);
                Add(P, P, T, 4);
                assert(memcmp(P, A, 4*WORD_SIZE)==0);
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ fails here

Seems that P has a value of
[0] 0x0
[1] 0x4000000000000001
[2] 0x4000000000000000
[0] 0x0

Whereas A has a value of
[0] 0x0
[1] 0x4000000000000000
[2] 0x4000000000000000
[0] 0x0

Thus the assertion fails since it's off by 1 in the [1] word array
position.

FYI WORD_SIZE is set to "8" in that code.


My test code:

          AutoSeededRandomPool rnd;

          RSA::PrivateKey rsaPrivate;
          rsaPrivate.GenerateRandomWithKeySize(rnd, 2048);


Also I had a compile error that I had to fix:

        pointer allocate(size_type n, const void * = NULL)
        {
-               CheckSize(n);
+    AllocatorBase<T>::CheckSize(n);

^ I had to put the "AllocatorBase<T>::" in front of "CheckSize" or it
wouldn't see "CheckSize" routine.

Any ideas?

Regards,
Rob

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