Score:1

Does inserting an entry of 32/64-bits into a Feistel S-box would consume the same cycles per byte as inserting a single byte?

pf flag

Blowfish splits a 32-bit word into 4 bytes and insert each byte as an entry in a S-box.

Let's suppose I do the same but with an entire word, 32 or 64-bits. MARS block cipher does the same with 32-bit words.

Does it consume the same cycles per byte as inserting a single byte?

Score:1
my flag

Blowfish splits a 32-bit word into 4 bytes and insert each byte as an entry in a S-box.

No, it doesn't - Blowfish uses Sboxes with 32 bit entries. A specific Blowfish implementation may decide to insert each byte in a 4-byte Sbox entry separately, however it is not mandated to do so (and there are implementations that will insert all four bytes at once).

Does it consume the same cycles per byte as inserting a single byte?

That sort of question is hardware specific. On the other hand, for most anything above a microcontroller, writing four bytes in a single write of an aligned 32 bit word will be at least as fast (and on some platforms, faster) than an 8 bit write (and hence consume considerably fewer cycles per byte).

BTW: why do you care? Key scheduling (which in when generating sboxes are done, at least, for those ciphers with dynamic sboxes) is typically done once (when you get the key), and is usually not considered a performance bottleneck (at least, as ciphers are typically used).

phantomcraft avatar
pf flag
Is it possible to implement a Blowfish version that inserts four bytes at one in the S-box and still preserving the security of the original cipher?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.