The vulnerability is caused by an off-by-one error in the tkeyclient.go file within the internal loadApp function. When constructing the data frame to send to the TKey hardware, the code sets a boolean flag at index 6 of a byte array (tx[6] = 1) to indicate that a User Supplied Secret (USS) is included. However, it then copies the 32-byte hash of the USS starting at the same index (copy(tx[6:], uss[:])), causing the first byte of the hash to overwrite the flag. If the first byte of the USS hash happens to be zero (a 1 in 256 chance), the flag is overwritten to 0, and the TKey device proceeds as if no USS was provided. This leads to the generation of a predictable Compound Device Identifier (CDI), undermining the security purpose of the USS. The patch corrects the destination index for the copy operation from 6 to 7, ensuring the flag is not overwritten. The primary user-facing functions that trigger this vulnerable logic are LoadApp and its wrapper LoadAppFromFile.