summaryrefslogtreecommitdiff
path: root/utils/imxtools/sbtools/crypto.h (unfollow)
Commit message (Collapse)Author
2017-01-16imxtools/sbtools: switch SHA1 implementation to Crypto++Amaury Pouly
The current implementation was custom and super slow. Since we use Crypto++ anyway, we might as well get use a good implementation. Change-Id: I761ad7401653471e54000e1c2bc3d9882378112f
2017-01-16imxtools/sbtools: switch AES implementation to Crypto++Amaury Pouly
Instead of having our own copy of the AES code, use a good library to do that. Crypto++ is well-maintained, supports a lot of ciphers, works on many OSes, and is optimized for many architectures. Change-Id: I7d7d24b47993206d7338c5f9bac8bbdd3915a667
2017-01-16imxtools/sbtools: rework cryptographyAmaury Pouly
It was a mess, a mix of crypto_* and cbc_mac calls. I made everything call crypto functions, and also separate key setup from cryptographic operations, this will be useful to speed up the code in the upcoming commits. Drop support for "usbotp" key, since the crypto code for that was never mainlined and we can always get the keys from a device as long as we have code execution (using the DCP debug registers). Change-Id: I7aa24d12207ffb744225d1b9cc7cb1dc7281dd22
2013-02-16sbtools: add brute force option for sb1 in sbtoelfAmaury Pouly
After some reverse engineering, it appears that the keys of the sb1 format are very weak: the 128 bytes are generated from the laserfuse words 4,5 and 6 but in a weird manner: 4 and 5 are simply ORed and 6 is only half used (somehow), making it "only" a 48 bit word to find. Change-Id: I40702e19d0924ef51c01894efce3cb65bd664456
2012-11-26sbtools: add support for the stmp36xx formatAmaury Pouly
The STMP36xx series also uses .sb files but with a different format. The main differences are the encryption and the lack of sections, making it basically a list of commands: fill, load, call, jump, switch mode, set sdram settings. Currently only the sbtoelf has support for the sb1 and can only dump the list of commands. Actual support for elf creation will come later. Change-Id: I1f2e0230c91ac64efd0e8430e0c5212098c599fd
2012-05-31imxtools: move tools to a new sbtools/ subdirectoryAmaury Pouly
Change-Id: I0d8d6831b35037725486f61fc363de87bc8ba92e
2011-11-06sbtools: rename to imxtools, move imx_hid_recovery to imxtools/sbloader, fix ↵Amaury Pouly
tools to correctly handle/free memory, properly return error codes git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30907 a1c6a512-1295-4272-9138-f99709370657
2011-10-29sbtools: factor key code, introduce crypto layer, move from open/read/... to ↵Amaury Pouly
fopen/fread/..., add support for encryption/decryption using a device when the key is not known, move sbtoelf to use getopt for command line git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30849 a1c6a512-1295-4272-9138-f99709370657
2011-04-17sbtoelf: fix to handle unencrypted files (minor tweak)Amaury Pouly
elftosb: properly generate sb file (encryption not implemented yet) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29742 a1c6a512-1295-4272-9138-f99709370657
2011-04-17Rename sbinfo to sbtools and sbinfo.c to sbtoelf.c; preparing for future elftosbAmaury Pouly
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29733 a1c6a512-1295-4272-9138-f99709370657
2010-11-29sbinfo: add full support for various kind of cryptographic checksAmaury Pouly
- now have a AES128, SHA1 and CRC implementation - now crc check the boot section chunks as well as the instruction headers - now sha1 check the sb header and the whole file - nearly all fields of the sb format are now documented git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28708 a1c6a512-1295-4272-9138-f99709370657