Use dc indexes accordingly

This commit is contained in:
9seconds
2021-03-24 10:30:09 +03:00
parent 4da2a4f10f
commit 02aa969d6c
6 changed files with 21 additions and 18 deletions
@@ -3,6 +3,8 @@ package obfuscated2
import "encoding/binary"
const (
DefaultDC = 2
handshakeFrameLen = 64
handshakeFrameLenKey = 32
@@ -41,11 +43,11 @@ func (h *handshakeFrame) dc() int {
switch {
case idx > 0:
return int(idx) - 1
return int(idx)
case idx < 0:
return -int(idx + 1)
return -int(idx)
default:
return 0
return DefaultDC
}
}