1
$\begingroup$

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?

$\endgroup$

1 Answer 1

1
$\begingroup$

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).

$\endgroup$
1
  • $\begingroup$ 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? $\endgroup$ Commented Apr 14, 2022 at 4:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.