When calculating the cSHAKE128 hash the code tries to unhexlify a bit string.
|
h_orchid_left = unhexlify(b_prefix + b_hid + b_ogaid) |
This produces 32 bytes of meaningless data instead of 8 bytes the 64 bits represent. You can confirm this by adding some debug logging.
print("XXX org:", b_prefix + b_hid + b_ogaid)
h_orchid_left = unhexlify(b_prefix + b_hid + b_ogaid)
print("XXX unhexlified:", h_orchid_left)
$ python3 ../csr-gen.py --keyname=raa16376 --serialnumber=x2344 --keynameexists=N --raa 16376 --hda 20 | grep XXX
XXX org: 0010000000000001000000000011111111111110000000000001010000000101
XXX unhexlified: b'\x00\x10\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x11\x11\x11\x11\x11\x11\x10\x00\x00\x00\x00\x00\x01\x01\x00\x00\x00\x01\x01'
When calculating the cSHAKE128 hash the code tries to unhexlify a bit string.
drip-scripts/csr-gen.py
Line 46 in 6dd9da1
This produces 32 bytes of meaningless data instead of 8 bytes the 64 bits represent. You can confirm this by adding some debug logging.