Latest Intel compiler means every word in "if copying [with memcpy] takes
place between objects that overlap, the behavior is undefined." It's hard to comprehend, but it reportedly manages to be case.
This commit is contained in:
parent
7d368fcbd8
commit
8f3bdc72d0
@ -125,7 +125,7 @@ void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits,
|
|||||||
sh[0]=v0, sh[1]=v1, sh[2]=d0, sh[3]=d1;
|
sh[0]=v0, sh[1]=v1, sh[2]=d0, sh[3]=d1;
|
||||||
#endif
|
#endif
|
||||||
if (rem==0)
|
if (rem==0)
|
||||||
memcpy(ovec,ovec+num,8);
|
memmove(ovec,ovec+num,8);
|
||||||
else
|
else
|
||||||
for(i=0 ; i < 8 ; ++i)
|
for(i=0 ; i < 8 ; ++i)
|
||||||
ovec[i]=ovec[i+num]<<rem |
|
ovec[i]=ovec[i+num]<<rem |
|
||||||
@ -168,7 +168,7 @@ void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits,
|
|||||||
sh[0]=v0, sh[1]=v1, sh[2]=d0, sh[3]=d1;
|
sh[0]=v0, sh[1]=v1, sh[2]=d0, sh[3]=d1;
|
||||||
#endif
|
#endif
|
||||||
if (rem==0)
|
if (rem==0)
|
||||||
memcpy (ovec,ovec+num,8);
|
memmove(ovec,ovec+num,8);
|
||||||
else
|
else
|
||||||
for(i=0 ; i < 8 ; ++i)
|
for(i=0 ; i < 8 ; ++i)
|
||||||
ovec[i]=ovec[i+num]<<rem |
|
ovec[i]=ovec[i+num]<<rem |
|
||||||
|
Loading…
x
Reference in New Issue
Block a user