Cryptography Reference
In-Depth Information
notation, in most significant bit order — as in, left-to-right, the more important, and hence “bigger,” bits writ-
ten first. For example, the byte representing the number 130 written in binary is
10000010
There is such a thing as least significant bit order, where the bits are essentially written backwards in a byte
(certain communication protocols use this, for example), but I shall not discuss this further.
The next major organization of bits is the word , the size of which is dependent on the native size of the
CPU's arithmetic register. Normally, this is 32 bits, although 64-bit words have been becoming common for
quite some time; less commonly seen are 16-bit and 128-bit words.
We again have two ways of writing down words as combinations of bytes. The mostsignificantbyte (MSB)
writes the “biggest” and most important bytes first, which would be analogous to the most significant bit or-
der first. This is also called big endian, since the “big end” is first. For a 32-bit word, values between 0 and
4,294,967,295 (= 2 32 - 1) can be represented (again, assuming we are representing non-negative integers). In
big-endian binary, we would write the decimal number 1,048,580 (= 2 20 + 2 2 = 1,048,576 + 4) as
00000000 00010000 00000000 00000100
Equivalently,wecanwriteitinbig-endianhexadecimal (base16)byusingaconversiontablebetweenbinary
and hexadecimal (see Table 4-1 ).
Table 4-1 Binary to Hexadecimal Conversion Table
The above number, 1,048,580, written in big-endian hexadecimal (“hex”) would be 00 10 00 04 .
There is also another way to represent words in bytes: least significant byte (LSB) or little endian (for
“little end” first). Basically, just take the previous way of writing it, and reverse it. The most confusing part is
that the bits are still written in most significant bit order.
This would make the above number, 1,048,580, written in little-endian hexadecimal as 04 00 10 00 and
in binary as
00000100 00000000 00010000 00000000
There is no consensus in the computer architecture community on which one of these methods of writing
words is “better”: They both have their advantages and disadvantages.
I will always be very clear which method is being used in which particular cipher, as different ciphers have
adopted different conventions.
 
 
Search WWH ::




Custom Search