basic client

it's able to join the world and perform basic state updates. packet parsing is very primitive.
This commit is contained in:
Jakob Gillich 2022-02-26 21:34:36 +01:00
parent bfedba07d7
commit 0d4a5ad40e
5 changed files with 454 additions and 72 deletions

View file

@ -9,9 +9,9 @@ import java.security.SecureRandom
case class DiffieHellman(p: Array[Byte], g: Array[Byte]) {
import DiffieHellman._
private val _p = BigInt(1, p)
private val _g = BigInt(1, g)
private val privateKey: BigInt = BigInt(128, random)
private val _p = BigInt(1, p)
private val _g = BigInt(1, g)
private val privateKey = BigInt(128, random)
val publicKey: Array[Byte] = bytes(_g.modPow(privateKey, _p))