keeloq software encoder in c? (HCS300 emulator)
I need to emulate a HCS300/301 via software, using a dsPIC. Basically, the dsPIC has to act as a remote for an existing system.
I have the various appnotes contained in the keeloq encryption package, but i'm struggling to find a solution for this problem.
-The appnotes contain a set of routines for encryption/decryption in assembly for several families but they don't provide data to test against, i have to accept blindly the result. besides, poor assembly, not saving/restoring registers. sigh.
-Then i found this https://github.com/hadipourh/KeeLoq
and while it provide some kind of test data, it doesn't match the result if i run the code compiled for dsPIC or x86.
-Of course microchip's routines and this guy's routines results don't match
-Then there's the issue on what i actually have to do to emulate the HCS300, because there's not only the encryption.
I want to know how to generate the word to send.
If anyone can give me some pointers?