Skip to content

Commit 62133ce

Browse files
committed
Revert "xrcp: use SHA3-256 in hybrid key agreement (#1302)"
This reverts commit 67d3809.
1 parent 3b50e1f commit 62133ce

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

protocol/xrcp.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ In pseudo-code:
250250
```
251251
// session 1
252252
hostHelloSecret(1) = dhSecret(1)
253-
sessionSecret(1) = sha3-256(dhSecret(1) || kemSecret(1)) // to encrypt session 1 data, incl. controller hello
253+
sessionSecret(1) = sha256(dhSecret(1) || kemSecret(1)) // to encrypt session 1 data, incl. controller hello
254254
dhSecret(1) = dh(hostHelloDhKey(1), controllerInvitationDhKey(1))
255255
kemCiphertext(1) = enc(kemSecret(1), kemEncKey(1))
256256
// kemEncKey is included in host HELLO, kemCiphertext - in controller HELLO
@@ -262,7 +262,7 @@ dhSecret(n') = dh(hostHelloDhKey(n - 1), controllerDhKey(n))
262262
263263
// session n
264264
hostHelloSecret(n) = dhSecret(n)
265-
sessionSecret(n) = sha3-256(dhSecret(n) || kemSecret(n)) // to encrypt session n data, incl. controller hello
265+
sessionSecret(n) = sha256(dhSecret(n) || kemSecret(n)) // to encrypt session n data, incl. controller hello
266266
dhSecret(n) = dh(hostHelloDhKey(n), controllerDhKey(n))
267267
// controllerDhKey(n) is either from invitation or from multicast announcement
268268
kemCiphertext(n) = enc(kemSecret(n), kemEncKey(n))

src/Simplex/Messaging/Crypto/SNTRUP761.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
module Simplex.Messaging.Crypto.SNTRUP761 where
66

7-
import Crypto.Hash (Digest, SHA3_256, hash)
7+
import Crypto.Hash (Digest, SHA256, hash)
88
import Data.ByteArray (ScrubbedBytes)
99
import qualified Data.ByteArray as BA
1010
import Data.ByteString (ByteString)
@@ -28,4 +28,4 @@ kcbEncrypt (KEMHybridSecret k) = sbEncrypt_ k
2828
kemHybridSecret :: PublicKeyX25519 -> PrivateKeyX25519 -> KEMSharedKey -> KEMHybridSecret
2929
kemHybridSecret k pk (KEMSharedKey kem) =
3030
let DhSecretX25519 dh = C.dh' k pk
31-
in KEMHybridSecret $ BA.convert (hash $ BA.convert dh <> kem :: Digest SHA3_256)
31+
in KEMHybridSecret $ BA.convert (hash $ BA.convert dh <> kem :: Digest SHA256)

0 commit comments

Comments
 (0)