|
@@ -60,9 +60,9 @@ var archiveTopicAmount int
|
|
|
const roundsBeforeUpdate = 5
|
|
|
const neededSubscriptions = 1
|
|
|
const numThreads = 12
|
|
|
-const dataLength = 64
|
|
|
+const dataLength = 128
|
|
|
|
|
|
-var dbWriteSize int = 4
|
|
|
+var dbWriteSize int = 100
|
|
|
var maxTimePerRound time.Duration = 5 * time.Second
|
|
|
|
|
|
//counts the number of rounds
|
|
@@ -169,7 +169,7 @@ func main() {
|
|
|
for {
|
|
|
clientConnection, err := lnClients.Accept()
|
|
|
if err != nil {
|
|
|
- fmt.Println(err)
|
|
|
+ fmt.Println("error", err)
|
|
|
}
|
|
|
clientConnection.SetDeadline(time.Time{})
|
|
|
|
|
@@ -182,7 +182,7 @@ func main() {
|
|
|
//send leader publicKey
|
|
|
_, err = clientConnection.Write(leaderPublicKey[:])
|
|
|
if err != nil {
|
|
|
- fmt.Println(err)
|
|
|
+ fmt.Println("error", err)
|
|
|
clientConnection.Close()
|
|
|
break
|
|
|
}
|
|
@@ -190,7 +190,7 @@ func main() {
|
|
|
//send follower publicKey
|
|
|
_, err = clientConnection.Write(followerPublicKey[:])
|
|
|
if err != nil {
|
|
|
- fmt.Println(err)
|
|
|
+ fmt.Println("error", err)
|
|
|
clientConnection.Close()
|
|
|
break
|
|
|
}
|
|
@@ -200,7 +200,7 @@ func main() {
|
|
|
//gets publicKey from client
|
|
|
_, err = clientConnection.Read(tmpClientPublicKey[:])
|
|
|
if err != nil {
|
|
|
- fmt.Println(err)
|
|
|
+ fmt.Println("error", err)
|
|
|
clientConnection.Close()
|
|
|
break
|
|
|
}
|
|
@@ -233,7 +233,7 @@ func main() {
|
|
|
startTime = time.Now()
|
|
|
phase[0] = 1
|
|
|
|
|
|
- fmt.Println("Phase 1")
|
|
|
+ fmt.Println("Phase 1 Round", round)
|
|
|
|
|
|
//creates a new write Db for this round
|
|
|
for i := 0; i < dbWriteSize; i++ {
|
|
@@ -1051,7 +1051,8 @@ func handlePirQuery(clientKeys clientKeys, clientConnection net.Conn, followerCo
|
|
|
copy(decryptNonce[:], leaderBox[:24])
|
|
|
decrypted, ok := box.Open(nil, leaderBox[24:], &decryptNonce, clientPublicKey, leaderPrivateKey)
|
|
|
if !ok {
|
|
|
- panic("pirQuery decryption not ok")
|
|
|
+ fmt.Println("pirQuery decryption not ok")
|
|
|
+ return clientKeys, nil, true
|
|
|
}
|
|
|
|
|
|
//if sharedSecret is send
|
|
@@ -1164,7 +1165,7 @@ func writeToWError(connection net.Conn, array []byte, followerConnection net.Con
|
|
|
if err != nil {
|
|
|
//lets follower know that client has disconnected unexpectedly
|
|
|
if connection.RemoteAddr().String() != follower {
|
|
|
- fmt.Println(err)
|
|
|
+ fmt.Println("error", err)
|
|
|
array := make([]byte, size)
|
|
|
array[0] = 1
|
|
|
_, err = followerConnection.Write(array)
|
|
@@ -1187,7 +1188,7 @@ func readFrom(connection net.Conn, size int, followerConnection net.Conn, sizeEr
|
|
|
if err != nil {
|
|
|
//lets follower know that client has disconnected unexpectedly
|
|
|
if connection.RemoteAddr().String() != follower {
|
|
|
- fmt.Println(err)
|
|
|
+ fmt.Println("error", err)
|
|
|
array := make([]byte, sizeError)
|
|
|
array[0] = 1
|
|
|
_, err = followerConnection.Write(array)
|