Skip to content

Implementation of the Apple and Google contact tracing cryptographic specification.

Notifications You must be signed in to change notification settings

fewstera/contact-tracing-crypto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cryptographic contact tracing implementation

Implementation of the Apple and Google contact tracing cryptographic specification.

Why?

I wondered how well the specification would scale, SHA-256 (and therefore HMAC-SHA265) is relatively slow, so given a large amount of daily keys it could take a lot of processing power to generate all the proximity keys to check for matches.

I wanted to test how long it would take to generate proximity keys for a list of daily keys.

Findings

Please note:

⚠️ The number of infected people and the number of daily keys uploaded per person were not chosen using scientific methods.

⚠️ This implementation is not the most efficient.

⚠️ The implementation may not be correct, I believe I've followed the specification, but I can't find any examples to test against.

I assumed that 81,000 new people would be infected and for each infected person the daily keys for the past 14 days would be published.

On a Macbook Pro

I ran the test on my 2019 Macbook Pro (Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz).

When running on all CPUs it takes around 28 seconds to generate all of the proximity keys.

When running on a single processor it took around 120 seconds.

On an iPhone Xs

Running the same test on my iPhone Xs took 122 seconds.

To run the test I compiled the Go files into an iOS framework, then imported the framework and ran the App on my device.

About

Implementation of the Apple and Google contact tracing cryptographic specification.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages