1
0
Fork 0
forked from len0rd/rockbox
foxbox/utils/atj2137/atjboottool
Nikita Burnashev e232f69214 atjboottool: gzipped fw files, option for big-endian fw, clarify ECIES in fwu
Added fw modifications required to unpack real world player dumps.


Documented more fwu header fields, magic numbers and finite field arithmetics (extended Euclidean for inverse, long division for reducing modulo field_poly).

v3 encryption used is standard RC4 with the key additionally ciphered by the Elliptic Curve Integrated Encryption Scheme.

Either sect233k1 (NIST K-233) or sect163r2 (NIST B-163) curves can be used, with the former overwhelmingly prevailing, being hardwired in SDK's maker.exe. Using a private/public key scheme is superfluous because both are stored in the firmware, with the added level of complexity likely serving the purpose of obfuscation. The private key is generated at random with each invokation.

None of KDF or MAC from ECIES are used, RC4 key is directly xored with the shared secret. The random number r used to calculate rG isn't stored, but that's unimportant since only krG == rkG is actually used in the encryption.

Change-Id: Ieacf8cc744bc90c7c5582dd724b2c10a41bfc191
2023-05-17 13:19:31 -04:00
..
afi.c atjboottool: put afi and fw code in its own files 2017-09-29 18:22:30 +02:00
afi.h atjboottool: put afi and fw code in its own files 2017-09-29 18:22:30 +02:00
atj_tables.c atjboottool: gzipped fw files, option for big-endian fw, clarify ECIES in fwu 2023-05-17 13:19:31 -04:00
atj_tables.h atjboottool: gzipped fw files, option for big-endian fw, clarify ECIES in fwu 2023-05-17 13:19:31 -04:00
atjboottool.c atjboottool: gzipped fw files, option for big-endian fw, clarify ECIES in fwu 2023-05-17 13:19:31 -04:00
fw.c atjboottool: gzipped fw files, option for big-endian fw, clarify ECIES in fwu 2023-05-17 13:19:31 -04:00
fw.h atjboottool: gzipped fw files, option for big-endian fw, clarify ECIES in fwu 2023-05-17 13:19:31 -04:00
fwu.c atjboottool: gzipped fw files, option for big-endian fw, clarify ECIES in fwu 2023-05-17 13:19:31 -04:00
fwu.h atjboottool: split fwu code into its own file 2017-09-29 17:56:04 +02:00
Makefile atjboottool: gzipped fw files, option for big-endian fw, clarify ECIES in fwu 2023-05-17 13:19:31 -04:00
misc.c atjboottool: split fwu code into its own file 2017-09-29 17:56:04 +02:00
misc.h atjboottool: split fwu code into its own file 2017-09-29 17:56:04 +02:00