Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions LowCostDP3T.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,3 +277,23 @@ def next_day(self):

def next_epoch(self):
self.ctmgr.process_epoch()

# Generate test vectors
if __name__ == "__main__":
def hex(y):
return ''.join( [ "%02x" % x for x in y ] )

ks = KeyStore()
ks.SKt.insert(0, b"\0" * 32)
print("sk0", hex(ks.SKt[0]))
e = ks.create_ephIDs(ks.SKt[0])
print("ephID[0]", hex(e[0]))
print("ephID[1]", hex(e[1]))
print("ephID[95]", hex(e[95]))

ks.rotate_SK()
print("sk1", hex(ks.SKt[0]))
e = ks.create_ephIDs(ks.SKt[0])
print("ephID[0]", hex(e[0]))
print("ephID[1]", hex(e[1]))
print("ephID[95]", hex(e[95]))
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@ and `rotate_ephIDs` which creates the set of `ephIDs` for the new day. These
methods are straight forward implementations of the description in the
whitepaper.

LowCostDP3T.py, when run standalone, will generate test vectors to help
other implementors check their work:

```
$ python3 ./LowCostDP3T.py
sk0 0000000000000000000000000000000000000000000000000000000000000000
ephID[0] 8fd521e6c47060efcbfdb9b801c30743
ephID[1] d86e56bb702117b8cf20dc4aadd42310
ephID[95] f38403173134f2c65682ee799e817ef3
sk1 66687aadf862bd776c8fc18b8e9f8e20089714856ee233b3902a591d0d5f2925
ephID[0] fda0fff97c5566886c5afcb0c7333f73
ephID[1] 1d1ae795488b0ad0e4aba33d4bed3f4a
ephID[95] b832b76cb203226cd7297f8483c60b76
```

## Contact tracing: `ContactManager`

Expand Down