[Cryptech Tech] Noise board on Novena
Bernd Paysan
bernd at net2o.de
Tue Sep 23 11:00:37 UTC 2014
Am Dienstag, 23. September 2014, 08:54:16 schrieb Fredrik Thulin:
> On Tuesday, September 23, 2014 06:04:58 AM Benedikt Stockebrand wrote:
> > Hi Joachim and list,
> >
> > Joachim Strömbergson <joachim at secworks.se> writes:
> > > [Why SPI is a pain]
> > >
> > > That (and a few other details) is what i mean with "don't like". ;-)
> > >
> > > I'm spending a lot of time in another project with SPI. The positive
> > > thing with SPI is that it is commonly supported by many devices.
> >
> > that's the point: I just wanted to make sure this didn't look like an
> > unjustified personal dislike, but like a justified one:-)
>
> I agree - SPI has it's downsides. I'll be easily swayed in the matter if you
> can argue why some other alternative is better.
>
> As I see it, the alternatives on this levels for the speeds we are talking
> about are SPI, I2C, UART, and bit-banging.
>
> The appealing thing about SPI, I2C and UART in my mind is that they are well
> supported (often in hardware) among MCUs, and other people could take a
> entropy module speaking one of those, connect it to a Raspberry Pi (for
> example) and start interacting with it in about 10 lines of Python code.
>
> This makes it easier for others to test, develop and audit entropy sources
> for Cryptech HSMs. The entropy sources would also be easier to reuse in
> other applications.
>
> Bit-banging, although preferably with less than 32 parallel data lines,
> would probably be easier if we didn't have to care about other people, but
> I think we should care.
>
> Let me hear your arguments for something else than SPI =)
I've used SPI, I²C and UARTs in different projects, and depending on the
environment, I prefer different things. SPI has the advantage of an explicit
clock and all signals are push-pull (whereas I²C is pullup+pull, which limits
the speed). The four modes are a disadvantage; usually I just commit to the
one mode that makes sense (the others don't really ;-).
For things that connect to a PC, however, I prefer UART, because USB to serial
is very cheap and easy to get (and supported out of the box by the OS),
whereas USB to SPI requires a specific FTDI device and a special library.
When I use UART protocols, I make sure that the first byte you will send over
the UART is odd, so the device can do automatic baud rate adjustment (like
"AT" modem commands - 'A' is odd: 65). UART has the advantage of needing just
two lines (RX and TX; when you talk to hardware, you don't need flow control,
the hardware will always be fast enough to respond), and there's no mode
inflation (when you use 8N1).
--
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://bernd-paysan.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.cryptech.is/archives/tech/attachments/20140923/286f2a95/attachment.sig>
More information about the Tech
mailing list