diff --git a/lib/src/packet/key/ecdh_session_key_params.dart b/lib/src/packet/key/ecdh_session_key_params.dart index 9723317b..1031827d 100644 --- a/lib/src/packet/key/ecdh_session_key_params.dart +++ b/lib/src/packet/key/ecdh_session_key_params.dart @@ -68,7 +68,10 @@ class ECDHSessionKeyParams extends SessionKeyParams { final privateKey = nacl.PrivateKey.fromSeed( Helper.secureRandom().nextBytes(TweetNaCl.seedSize), ); - ephemeralKey = privateKey.publicKey.asTypedList.toBigIntWithSign(1); + ephemeralKey = Uint8List.fromList([ + 0x40, + ...privateKey.publicKey.asTypedList, + ]).toBigIntWithSign(1); sharedKey = TweetNaCl.crypto_scalarmult( Uint8List(TweetNaCl.sharedKeyLength), privateKey.asTypedList,