-
Notifications
You must be signed in to change notification settings - Fork 0
/
powha_range.code
15 lines (12 loc) · 947 Bytes
/
powha_range.code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import "./functions/location_integrity.code" as location_integrity
import "./functions/time_closeness.code" as time_closeness
import "./functions/farawayness.code" as farawayness
// I prove that I have three pair of points with hamming distance greater than x, and
// between each of these three pairs there is a distance smaller than y.
def main(private field loc_one, private field timestamp_1, private field loc_two, private field timestamp_2, private field[2] R_1, private field S_1, private field[2] R_2, private field S_2, field[2] A, field location_distance, field time_distance, field current_time) -> (field):
location_integrity(0, 0, timestamp_1, loc_one, R_1, S_1, A) == 1
location_integrity(0, 0, timestamp_2, loc_two, R_2, S_2, A) == 1
time_closeness(timestamp_1, current_time, time_distance) == 1
time_closeness(timestamp_2, current_time, time_distance) == 1
farawayness(location_distance, loc_one, loc_two) == 1
return 1