[Cryptech Tech] Pascal indexing?

Joachim Strömbergson joachim at secworks.se
Tue May 5 06:53:02 UTC 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Aloha!

Paul Selkirk wrote:
> On 05/04/2015 08:49 AM, Joachim Strömbergson wrote:
>> One thing I noted in the cryptech.h is that bits seems to be 
>> counted from 1 and onwards, not 0 and onwards as I'm used to in C. 
>> Since the cores define bits as in C it becomes slightly confusing.
> 
> Those are bit masks rather than bit positions, i.e. bit position 0
> is value 1, bit position 1 is value 2. If we had more than 2 control
> or status bits defined, it would be more obvious that bit position 2
> is value 4, etc.
> 
> If you think it would be clearer to express bits positionally, or to 
> express them in terms of shifts (e.g. INIT=1<<0, NEXT=1<<1), I can 
> make that change.

To me it makes more sence to have someting called _BIT be the index
number of the bit. But hey, I'm the HW guy and also know the context. If
the team thinks it would be easier to grokk for users (esp SW
developers) to have _BIT mean the bitmask then I'm all for it.


> You also define things like AES_CTRL_INIT_BIT equal to
> CTRL_INIT_BIT, which I think is unnecessary; if we want all cores to
> use the same values for INIT and NEXT, READY and VALID, then we
> should use the base names, rather than cluttering the namespace with
> redundant names.

My though was that when a SW-developer wants to do stuff with AES and by
looking at AES_-something, you get all defines you need to operate the
core. But I can also understand the namespace issue.

- -- 
Med vänlig hälsning, Yours

Joachim Strömbergson - Alltid i harmonisk svängning.
========================================================================
 Joachim Strömbergson          Secworks AB          joachim at secworks.se
========================================================================
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBCAAGBQJVSGjOAAoJEF3cfFQkIuyNGW8QAJErGbl50gFr2OTGrFoJVXZ2
TjzFICNGBDzOzZNcciA2dXQ9JNi6MMw+3vmku4X9zj3KEi79Zk3GVIhiCd4HwkVC
Y1q7lDcliCc2/ykfRcs1cQzACv3t7ws1teQUQbUTl9WeVFMNjE6lnSKQCYT6xvJf
5oUEUIt3Jdz4I6S2oxe7qyE3CmcXDMcK7dv1czdI+RNTDXXeI8FrUgFpRR9GiHdj
N93jh/N/3XVdkv22PIzixjpSJSvqsWju4XSk4EYwtmn6qIBPF8hi26TF39c+IcP5
nSoR6JKALrRkS6EEVu1wPFb/9Z68PTy6RzZZ7nhES4gpOobt2UUZwMs8tKqVCOBH
Rdwu8jjFwSAuW/ZTcEDC+OyuoGUhGSun6FUab0oiU111gqPCkqbbLQVe2VLI2h/u
s0R8RozLmpDwGfWiHzRlJR/3fRTKMqfe2eK70+2qdijO8NdAcvJZ7dGdugInS3fj
FbTMM6kTyKyuVKilruGvQYoHg/vYTmTTF5+45mQyEd35jd2CrSWRetLk0iOMSXjD
TzErsiAbCKrpa4zv6NL4SQ3zTbksIXM9Ck1+HYBIKqe6swSi/FvfRsObyY12dnRG
QMFmlqRz0zqRUtk/xcnxtjl24mGLozZ1fdtP2wp7LG52p5pmKrg2JLgWOQN/Jn04
SIUbzJxbsQymO+dHg3VN
=C8KR
-----END PGP SIGNATURE-----


More information about the Tech mailing list