|
@@ -379,7 +379,7 @@ func receiveVirtualAddress(sharedSecret [2][32]byte, leaderConn net.Conn) int {
|
|
|
return byteToInt(virtualAddressByte)
|
|
|
}
|
|
|
|
|
|
-func receiveTweets(sharedSecret [2][32]byte, leaderConn net.Conn, getArchive bool) int {
|
|
|
+func receiveTweets(sharedSecret [2][32]byte, leaderConn net.Conn, getArchive bool) {
|
|
|
|
|
|
tmpNeededSubscriptions := neededSubscriptions
|
|
|
if tmpNeededSubscriptions > len(topicList) {
|
|
@@ -413,12 +413,10 @@ func receiveTweets(sharedSecret [2][32]byte, leaderConn net.Conn, getArchive boo
|
|
|
lib.Xor(expandedSharedSecrets[i][:], tweets)
|
|
|
}
|
|
|
|
|
|
- //tweets can be displayed
|
|
|
- split := strings.Split(string(tweets), ";")
|
|
|
- text := split[:len(split)-1]
|
|
|
+ index := strings.Index(string(tweets), ";;")
|
|
|
+ text := string(tweets)[:index]
|
|
|
fmt.Println(text)
|
|
|
}
|
|
|
- return 0
|
|
|
}
|
|
|
|
|
|
//creates a shared secret for each server
|
|
@@ -452,7 +450,6 @@ func createAuditPIRQuery(clientNumber int) ([]byte, []byte) {
|
|
|
copy(pirQuerys[1], pirQuerys[0])
|
|
|
|
|
|
//the positon the virtual address will be taken from
|
|
|
- //todo! invalid argument error
|
|
|
pos := mr.Intn(dbWriteSize)
|
|
|
pirQuerys[0][pos] = 1
|
|
|
pirQuerys[1][pos] = 0
|