- 
                Notifications
    
You must be signed in to change notification settings  - Fork 4
 
Description
The rp2350 datasheet states in section 5.9.2.2, "HASH_DEF item":
Optional item with information about what how to hash:
Word Bytes Value
0 1 0x47 (size_flag == 0, item_type == PICOBIN_BLOCK_ITEM_1BS_HASH_DEF)
1 0x03 (size_lo)
1 0x00 (pad)
1 0x01 (PICOBIN_HASH_SHA-256)
1 2 Number of words of block hashed (not including HEADER word at the start of the block)
I'm reading "not including HEADER word" to mean that the hashing should start at the word immediately after the HEADER word, or that hashing should start at the HEADER word, but end 4 bytes further than the hash word count.
The correct meaning is that hashing starts at the HEADER word, and end after "number of words of block hashed" words.
I suggest dropping the parenthesized sentence, or replacing it:
Number of words of block hashed (counting from the HEADER word at the start of the block)
A small nit while here:
2 0x0000 (pad)
block_words_hashed must include this item if using this item for a signature.
"block_words_hashed" is formatted as an identifier, but it appears no where else in the document. I suspect it was deleted from the field description above.
The most recent LOAD_MAP item (see Section 5.9.3.2) that defines what to hash.