rockbox/utils/imxtools/sbtools
Amaury Pouly 2b20026dd7 imxtools/sbtools: rework cryptography
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
2017-01-16 19:58:24 +01:00
..
keys sbtools: add Sansa Express bootloader key 2013-06-17 13:38:31 +02:00
aes128.c imxtools: fix bug aes128 (did not update cbc-macp) 2017-01-01 19:52:00 +01:00
crc.c
crypto.cpp imxtools/sbtools: rework cryptography 2017-01-16 19:58:24 +01:00
crypto.h imxtools/sbtools: rework cryptography 2017-01-16 19:58:24 +01:00
dbparser.c imxtools/efltosb: fix extern() in db files 2013-09-10 23:19:34 +02:00
dbparser.h sbtools: more work on sbtoelf and elftosb, support more attributes 2013-08-22 14:39:46 +02:00
elf.c imxtools/sbtools/elf: fix debug code 2013-12-06 15:22:38 +01:00
elf.h sbtools: more code refactoring 2013-08-21 22:20:53 +02:00
elftosb.c elftosb: fix crash on invalid command file 2013-12-06 11:37:49 +01:00
elftosb1.c sbtools: more code refactoring 2013-08-21 22:20:53 +02:00
Makefile imxtools/sbtools: rework cryptography 2017-01-16 19:58:24 +01:00
misc.c imxtools/sbtools: rework cryptography 2017-01-16 19:58:24 +01:00
misc.h sbtools: more code refactoring 2013-08-21 22:20:53 +02:00
README
rsrc.c sbtools,mkximboot: fix whitespace 2013-06-15 22:27:34 +02:00
rsrc.h imxtools/sbtools: rework cryptography 2017-01-16 19:58:24 +01:00
rsrctool.c sbtools: refactor and cleanup 2013-07-18 00:27:12 +02:00
sb.c imxtools/sbtools: rework cryptography 2017-01-16 19:58:24 +01:00
sb.h imxtools/sbtools: rework cryptography 2017-01-16 19:58:24 +01:00
sb1.c sb1: fix buggy comparison 2014-12-20 15:31:18 +01:00
sb1.h imxtools/sbtools: rework cryptography 2017-01-16 19:58:24 +01:00
sbloader.c sbtools: use default transfer size if it cannot be probed 2014-09-07 17:44:53 +02:00
sbtoelf.c imxtools: rework key/IV overriding logic 2017-01-16 19:50:25 +01:00
sha1.c sbtools,mkximboot: fix whitespace 2013-06-15 22:27:34 +02:00
xorcrypt.c sbtools: refactor and cleanup 2013-07-18 00:27:12 +02:00

This file document the format of the command file used by the elftosb tool.
By no way our tools tries to be compatible with Freescale's elftosb2.
However, our format is more subset of the general one.

The parse supports a limited form of comments: comments starting with // and ending at the end of the line.

A file first contains the list of sources:

sources
{
    hw_init = "sdram_init.elf";
    rockbox = "rockbox.elf";
}

It can then contain an arbitrary number of section. A section is identified by a number.
Within a section, three commands are supported: "load", "jump" and "call":

section(0x626f6f74) // hex for 'boot'
{
    load hw_init;
    call hw_init;
    load rockbox;
    jump rockbox;
}

Finally, both elftosb and sbtoelf tools use key files. A key file is a list of keys.
Each key consist is 128-bit long and is written in hexadecimal:

00000000000000000000000000000000

The parser does not handle blank line and only allows a final newline at the end of the file.
A file is allowed to contain zero (0) keys.