TCNCoalition / TCN

Specification and reference implementation of the TCN Protocol for decentralized, privacy-preserving contact tracing.
MIT License
263 stars 33 forks source link

Possible fix for tck_0 used in first reports #76

Closed ivnsch closed 4 years ago

ivnsch commented 4 years ago

I noticed that tck_0 is being used for the first 2 generated reports, which seems invalid, as tck_0 can't generate TCNs. The repetition of the key, by coercing 0 to 1, seems problematic too.

This change increases j1 always by 1, offsetting the entire keys sequence. I'm not quite sure about the implications, so it's very experimental. Mostly just an attempt to understand the problem. Maybe it's useful.

I adjusted the generate_temporary_contact_numbers_and_report_them unit test. match_btreeset is failing. It's better to clear up first whether this change makes sense before continuing working on it.

ivnsch commented 4 years ago

Increasing the index actually doesn't solve the problem that the first reports will have the same TCK. In at least the Android implementation, j1 is truncated to 0 until a specific distance to j2 is reached (which is currently the count of 15 mins segments in 14 days), which makes all the reports generated in this period have the same TCK.

Edit: I missed the timer in the app libraries that update the TCN (and with that ratchet the TCK) periodically. Still (unless I'm missing something else), until the first 14 days transcur, we will be using the same TCK.

ivnsch commented 4 years ago

Closing this because this approach is invalid. For some reason I though that it was "forbidden" to use tck_0 to generate reports, but this is not the case. Incrementing j1 always also doesn't seem a good idea in general. We're working on a better fix.