OCB and PMAC: Code


Reference C code

The reference C code, written by Ted Krovetz (with John Black pitching in). The code is intended to clarify the algorithm; it is not as fast as possible. It will be changed without notice, even the names of files and the contents of the header file. For the time being, we have one file which implements both OCB and PMAC. The AES code that we have used is public-domain code from www.esat.kuleuven.ac.be/~rijmen/rijndael/, written by Rijmen, Bosselaers, and Barreto.

Java code

A Java implementation of OCB and PMAC, kindly provided by Paulo Barreto.

Fast C code

Not yet being distributed.

Fast x86 Assembly code

I suggest purchasing this from Helger Lipmaa, who is quite a magician at making fast assembly code for cryptographic algorithms. We ourselves have not been able to produce anything as fast Helger has.

Can't get your own code to give my test vectors?

My test vectors are correct; multiple, independent implementations have given these same values. If you're getting something else, experience indicates that the problem is, almost certainly, endian nonsense. A note by Gladman on AES bit-ordering conventions may help. (But then again, nothing really helps to banish endian difficulties!)


Back to the OCB home page