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

Hi Katja,

On Mon, May 20, 2013 at 06:45:26PM +0200, Katja Malvoni wrote:
> I tried to reuse the existing Openwall bcrypt implementation since
> parallella supports C. I first tried the simplest approach, load whole
> bcrypt implementation onto the core and execute. The problem is:
> core_test.elf section `.text' will not fit in region `INTERNAL_RAM'
> region `INTERNAL_RAM' overflowed by 6528 bytes

Note that you do not have to put the entire bcrypt onto Epiphany.  At
least initially, it is sufficient to put the configurable-cost loop from
bcrypt onto Epiphany, leaving the rest on host (yes, this means 4 KB
data transfers back and forth, but that's OK for now).  If you're
looking at crypt_blowfish-1.2/crypt_blowfish.c, that loop would be:

	do {
		int done;
			data.ctx.P[17] ^= tmp2;
		} while (1);
	} while (--count);

Note that this loop contains only one instance of BF_body, which in
turn contains two instances of BF_ENCRYPT (unrolled Blowfish).  In
BF_crypt(), there are a total of 6 instances of BF_ENCRYPT, including
the two inside BF_body in the loop above.  Thus, this change
(implementing just the main loop instead of the entire bcrypt on
Epiphany) should reduce code size to put on Epiphany by a factor of 3.

Please give this a try.

As to other issues you mentioned, Yaniv is the one to comment on them.



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.