Skip to content

Commit

Permalink
use 8 bytes as the QPP PRNG entropy
Browse files Browse the repository at this point in the history
  • Loading branch information
xtaci committed Dec 17, 2024
1 parent 6166590 commit 336e01c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crypt.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,14 @@ func NewQPPCrypt(key []byte) (BlockCrypt, error) {

func (c *qppCrypt) Encrypt(dst, src []byte) {
copy(dst, src)
prng := c.quantum.CreatePRNG(dst[:16])
c.quantum.EncryptWithPRNG(dst[16:], prng)
prng := c.quantum.CreatePRNG(dst[:8])
c.quantum.EncryptWithPRNG(dst[8:], prng)
}

func (c *qppCrypt) Decrypt(dst, src []byte) {
copy(dst, src)
prng := c.quantum.CreatePRNG(dst[:16])
c.quantum.DecryptWithPRNG(dst[16:], prng)
prng := c.quantum.CreatePRNG(dst[:8])
c.quantum.DecryptWithPRNG(dst[8:], prng)
}

// packet encryption with local CFB mode
Expand Down

0 comments on commit 336e01c

Please sign in to comment.