[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Fun-O Basic Edition Compiler
Jeffrey Siegal <jbs@quiotix.com> writes:
> I agree with all of the above, except that I'm not sure it should be
> the operators that wrap. A nonstandard type such as
> <machine-integer> could also be used.
There's also code that assumes a certain basic type forms a finite
field of a certain size when wrapping. This is often the case for
crypto code: AES uses operations on GF(2^8), which happens to be
representable as an eight-bit two's complement number that ignores
overflows ("char" in C). IDEA does multiplications on GF(2^16 + 1),
and implementations use GF(2^16) aka "short" for the implementation.
It would be nice if the language provided a way to work with arbitrary
finite fields, which happen to have fast implementations for special
cases.
Andreas
--
"In my eyes it is never a crime to steal knowledge. It is a good
theft. The pirate of knowledge is a good pirate."
(Michel Serres)