Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 29 Jul 2013 05:18:43 +0400
From: Solar Designer <>
Subject: Re: Parallella: bcrypt


On Sun, Jul 28, 2013 at 10:56:58PM +0400, Solar Designer wrote:
> I think it's time for you to move to using a separate .S file instead of
> inline assembly.  See x86.S for an example of how this is done for bcrypt.
> However, if you choose to continue with inline assembly then I think
> you'll find C preprocessor's ## operator handy, to enclose variable
> names, indices, etc. in double-quotes.

BTW, my advice (from a few days ago) for you to manually write code for
two rounds of Blowfish in one macro was based on the difficulty for you
to swap L and R (the names) with inline asm.  However, either of two
approaches suggested above (move away from inline asm or use ##) should
address that issue - you'd be able to use e.g.:


... and so on.

With separate assembly file, I think this is obvious.  With inline asm,
I think it'd go something like:

#define BF_ROUND(L, R, P) \
	"...\n\t" \
	"someinstruction " ## L ", further operands\n\t"
	"...\n\t" \

Before you implemented 2x interleaving, having two rounds in one macro
could also be helpful as a way to hide instruction latencies (bringing
some instructions needed for the next round up in the code), but with
the interleaving you probably have enough parallelism within one round
(combined for both instances).


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.