OCB 1.0 and PMAC 1.0: Code

All of the code from this web page is for the original version of OCB and PMAC. Code for the updated algorithm is available.

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