crypto_xor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,
 I was checking the crypto_xor() function and it is for some reason
limited to 32 bit integers. Why not make it depend on the architecture
by replacing the u32 with unsigned long? That way 64bit machines should
perform xor with less instructions...

Something like:

void crypto_xor(u8 *dst, const u8 *src, unsigned int size)
{
        unsigned long *a = (unsigned long *)dst;
        unsigned long *b = (unsigned long *)src;

        for (; size >= sizeof(unsigned long); size -= sizeof(unsigned long))
                *a++ ^= *b++;

        crypto_xor_byte((u8 *)a, (u8 *)b, size);
}


regards,
Nikos
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux