mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-15 08:25:09 +01:00
Fix major crypto bug
`cryptKeyTruncByte` was incorrectly typed as a byte when 1 was added. This caused `cryptKeyTruncByte` to wrap around to 0 when it was 0xFF, resulting in an incorrect multiplication by zero, breaking [en|de]cryption entirely.
This commit is contained in:
@@ -28,7 +28,7 @@ func _generalCrypt(data []byte, rotKey uint32, cryptType int, overrideByteKey *b
|
||||
cryptKeyTruncByte = *overrideByteKey
|
||||
}
|
||||
|
||||
derivedCryptKey := int32((uint32(len(data)) * uint32(cryptKeyTruncByte+1)) & 0xFFFFFFFF)
|
||||
derivedCryptKey := int32((uint32(len(data)) * (uint32(cryptKeyTruncByte) + 1)) & 0xFFFFFFFF)
|
||||
sharedBufIdx := byte(1)
|
||||
accumulator0 := uint32(0)
|
||||
accumulator1 := uint32(0)
|
||||
|
||||
Reference in New Issue
Block a user