On Tue, 24 Jan 2012, Andy Polyakov wrote:

> >> Unfortunately one of the tests core dumps.
> >> Here is what gdb says.
> >> .......
> >> $ gdb -c core ./ssltest 
> >> #0  0x080d8590 in gcm_ghash_4bit_mmx ()
> > 
> > I would guess that it fails at pinsrw. Intel instructions reference

Good guess.
......
[snip]
0x80d857f <gcm_ghash_4bit_mmx+1087>:    pxor   0x110(%esp,%edi,8),%mm7
0x80d8587 <gcm_ghash_4bit_mmx+1095>:    and    $0xf,%al
0x80d8589 <gcm_ghash_4bit_mmx+1097>:    psllq  $0x38,%mm3
0x80d858d <gcm_ghash_4bit_mmx+1101>:    shr    $0x4,%ebp
0x80d8590 <gcm_ghash_4bit_mmx+1104>:    pinsrw $0x2,(%esi,%ebx,2),%mm2
0x80d8595 <gcm_ghash_4bit_mmx+1109>:    pxor   0x10(%esp,%eax,8),%mm7
0x80d859a <gcm_ghash_4bit_mmx+1114>:    rol    $0x8,%edx
0x80d859d <gcm_ghash_4bit_mmx+1117>:    pxor   0x90(%esp,%eax,8),%mm6
[snip]
(gdb) info all-registers
eax            0x5      5
ecx            0x8928b5da       -1993820710
edx            0x7627cf65       1982320485
ebx            0x2a     42
esp            0x8042c30        0x8042c30
ebp            0x6      0x6
esi            0x80d8b00        135105280
edi            0xc      12
eip            0x80d8590        0x80d8590
eflags         0x210206 2163206
cs             0x17     23
ss             0x1f     31
ds             0x819001f        135856159
es             0x1f     31
fs             0x0      0
gs             0x0      0
st0            0        (raw 0x3591ffffaaaaffff0000)
st1            0        (raw 0x0000000005d80017080f)
st2            0        (raw 0x000000000000ffff001f)
st3            0        (raw 0x000000000000ffff0000)
st4            0        (raw 0x000000000000ffff0000)
st5            0        (raw 0x000000000000ffff0000)
st6            -0       (raw 0x815c227ac5f2ffff1f00)
st7            0        (raw 0x2ca1440d24f1ffff02a3)
fctrl          0x1f     31
fstat          0x0      0
ftag           0x1f     31
fiseg          0x0      0
fioff          0xc      12
foseg          0x0      0
fooff          0x1f     31
fop            0x0      0
(gdb) tim@sco507 47% 
......

> > doesn't tell when exactly this instruction was introduced, so I assumed
> > it was MMX. But it might be that it was introduced with SSE. Try
> > following. Open crypto/modes/gcm128.c in text editor, locate line that
> > has '/* check MMX bit */' comment and replace '1<<23' with '1<<25'.

Changing crypto/modes/gcm128.c gets test to pass.

> > You must be running it on really old processor...

Pentium II
CPU ID 652

> Another test to perform is following. Revert back to '1<<23', then open
> crypto/modes/asm/ghash-x86.pl in text editor and locate line that reads
> 'if (0) {{ # "May" MMX version is kept for reference...". Replace '(0)'
> with '(!$sse2)'...

[ reverting crypto/modes/gcm128.c ]
This change to crypto/modes/asm/ghash-x86.pl works also.
.......
ALL TESTS SUCCESSFUL.
        OPENSSL_CONF=apps/openssl.cnf util/opensslwrap.sh version -a
OpenSSL 1.0.1-beta3-dev 21 Jan 2012
built on: Tue Jan 24 11:06:25 PST 2012
platform: sco5-gcc
options:  bn(64,32) rc4(4x,int) des(ptr,risc1,16,long) idea(int) blowfish(idx) 
compiler: gcc -DZLIB -DDSO_DLFCN -DHAVE_DLFCN_H -O3 -fomit-frame-pointer 
-DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m 
-DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DRMD160_ASM -DAES_ASM 
-DWHIRLPOOL_ASM -DGHASH_ASM
OPENSSLDIR: "/usr/local/ssl"
.......

Thanks for your help.

-- 
Tim Rice                                Multitalents
[email protected]


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [email protected]
Automated List Manager                           [email protected]

Reply via email to