On Thursday, April 20, 2017 at 3:16:25 PM UTC-4, Anton Gorev wrote:
>
> Seems like message was cut off. Just in case full report is attached here.
>
> четверг, 20 апреля 2017 г., 14:10:20 UTC-5 пользователь Anton Gorev 
> написал:
>>
>> Hi,
>>
>> I have troubles when execute cryptest.exe on Solaris 10. Below is 
>> information I collected so far. Please let me know if you need anything 
>> else.
>>
>
sha.cpp : 1762 is this code, give or take 
(https://github.com/weidai11/cryptopp/blob/master/sha.cpp#L1747):

#define S0(x) (rotrFixed(x,28)^rotrFixed(x,34)^rotrFixed(x,39)) 
#define S1(x) (rotrFixed(x,14)^rotrFixed(x,18)^rotrFixed(x,41)) 
#define s0(x) (rotrFixed(x,1)^rotrFixed(x,8)^(x>>7)) 
#define s1(x) (rotrFixed(x,19)^rotrFixed(x,61)^(x>>6)) 

#define R(i) 
h(i)+=S1(e(i))+Ch(e(i),f(i),g(i))+SHA512_K[i+j]+(j?blk2(i):blk0(i));\ 
d(i)+=h(i);h(i)+=S0(a(i))+Maj(a(i),b(i),c(i)) 

word64 W[16]; 
word64 T[8];

/* Copy context->state[] to working vars */ 
memcpy(T, state, sizeof(T));

/* 80 operations, partially loop unrolled */ 
for (unsigned int j=0; j<80; j+=16) 
{ 
     R( 0); R( 1); R( 2); R( 3); 
     R( 4); R( 5); R( 6); R( 7); 
     R( 8); R( 9); R(10); R(11); 
     R(12); R(13); R(14); R(15); 
}

The blk0(i) macro on line 43 is a suspect. Here it is:

    #define blk0(i) (W[i] = data[i])

And then improve it:

template <typename T>
inline T BLK0_TEMPLATE(const T* y, const int i)
{
    T t;
    memcpy(&t, y+i, sizeof(t));
    return t;
}

#if defined(__SUNPRO_CC)
#  define blk0(i) (W[i] = BLK0_TEMPLATE(data,i))
#else
#  define blk0(i) (W[i] = data[i])
#endif

This is kind of a blind stab since it looks like the data pointer is 
aligned. That's assuming the Sun hardware and word64 needs 8-byte alignment.

SunCC compiler issues can be a drag. I don't have test environment because 
I lack the hardware or access to a test environment with it. And SunCC is 
kind of flaky, so we often have to work around compiler bugs.

If that does not fix it, can you provide me with SSH access to the machine?

Jeff

-- 
-- 
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to cryptopp-users-unsubscr...@googlegroups.com.
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.
--- 
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 cryptopp-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to