I haven't checked RNG yet.
My suggestion is:
...
static inline unsigned int
padlock_xstore(size_t count,unsigned int edx_in,
unsigned char *output_addr)
{
unsigned int eax_out=0; /* compensate for gcc 2.95 bug */ asm volatile (".byte 0xf3,0x0f,0xa7,0xc0" /* rep xstore */
: "+a"(eax_out), "+c"(count), "+D"(output_addr)
: "d" (edx_in)
);return eax_out; }
...
static int
padlock_rand_bytes(unsigned char *output, int count)
{
if (count >= 4) {
padlock_xstore(count&~3, 1, output);
output += count&~3;
count %= 4;
}
if (count > 0) {
/* xstore always stores at least 4 bytes - we must avoid
overwriting the innocent data! */
volatile unsigned int buf[2];
padlock_xstore(count, 3, (void *)buf);
memcpy(output, (void *)buf, count);
buf[0] = buf[1] = 0;
}
return 1;
}Note that 3rd argument to padlock_xstore is no longer void ** and second argument to more diverse, 1 and 3. As for void **. If you really want to get %edi value at output, I'd copy it to %eax. But what it would be required for?
Coding Windows port. Do you run or do you know anybody who runs Windows on such system?
Once the code in CVS, I'll be throwing in Windows port, so get ready with your VMware Windows guest:-) A.
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]
