Editing Kirk
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 934: | Line 934: | ||
== Command 0xF: Seed RNG buffer == | == Command 0xF: Seed RNG buffer == | ||
This function seeds the Kirk | This function seeds the Kirk RNG buffer used to generate all the random data coming from Kirk. | ||
It takes as an input and output data of size 0x1c: | It takes as an input and output data of size 0x1c: | ||
* 0x00 - | * 0x00 - unknown - modified by an unknown opcode | ||
* 0x08 - seed data | * 0x04 - counter - increased by 1 in the output | ||
* 0x08 - seed data - used for seeding, and contains fresh reseeded data for the output | |||
Seeding works this way: | Seeding works this way: | ||
# | # Increase input counter and do unknown operation on offset 0x00 | ||
# Set | # Set the PRNG seed to the input seed data, XOR'ed with a SHA1 of data coming from a true random number generator | ||
# Initialize | # Initialize RNG buffer to two empty words, and then output data at offsets 0x00 and 0x04 | ||
# Do a reseeding | # Do a reseeding | ||
# Output | # Output resulting buffer. | ||
Reseeding is then done by all operations requiring random data and works this way: | Reseeding is then done by all operations requiring random data and works this way: | ||
# Encrypt RNG buffer with AES per-console key with seed 6 | # Encrypt RNG buffer with AES per-console key with seed 6 | ||
# | # Reseed the PRNG with the RNG buffer | ||
# Regenerate data with the PRNG | # Regenerate data with the PRNG | ||
== Command 0x10: ECDSA signature generation == | == Command 0x10: ECDSA signature generation == |