-Conversion methods: Convert byte to number and string and viceversa.
-Crypto methods: Encapsulation for Cypher, digest and MAC methods. And example of use is provided for CMAC on the code.
-The keys. Should go on another file. The code access them as if they were constants. You already have the sha1 of those so you can find them on decrypted appldr.
Sorry. I do not provide working code due to legal reasons. However I'll help anyone to get a working code. You are only missing:
-The main file. Basically a parser of the command line. Also must process the rif file and send the decrypted key if required. See SELF algorithm and gitbrew NoPDRM.
-Beans: Two beans are used two describe the npd element and the extra data (flags, blocksize and fileLenght). Those are a constructor from byte readed from NPD and a series of get