Releases: covidwatchorg/tcn-node
Releases · covidwatchorg/tcn-node
v0.3.1
Many of the Rust tcn crate structs are now exposed via the native addon as JS classes. The instantiated JS objects hold handles to Rust structs under the hood so that we can call the native API's methods on them.
We can now run the the tcn example flow using javascript:
const { ReportAuthorizationKey, MemoType } = require("tcn-node").native;
const assert = require("assert");
// Generate a report authorization key. This key represents the capability
// to publish a report about a collection of derived temporary contact numbers.
let rak = new ReportAuthorizationKey();
// Use the temporary contact key ratchet mechanism to compute a list
// of temporary contact numbers.
let tck = rak.initial_temporary_contact_key(); // tck <- tck_1
let tcns = [];
for (let i = 0; i < 100; i++) {
tcns.push(tck.temporary_contact_number());
tck = tck.ratchet();
}
// Prepare a report about a subset of the temporary contact numbers.
let signed_report = rak.create_report(
MemoType.CoEpiV1, // The memo type
Buffer.from("symptom data"), // The memo data
20, // Index of the first TCN to disclose
90 // Index of the last TCN to check
);
// Verify the source integrity of the report...
let report = signed_report.verify();
// ...allowing the disclosed TCNs to be recomputed.
let recomputed_tcns = report.temporary_contact_numbers();
// Check that the recomputed TCNs match the originals.
// The slice is offset by 1 because tcn_0 is not included.
assert.deepEqual(recomputed_tcns, tcns.slice(20 - 1, 90 - 1));
v0.3.0
tcn-node 0.3.0
v0.3.0-beta.0
- Added the following functions:
- tcnExample
- renamed from tcn_example (the old name still works too but will be deprecated in future)
- signedReportExample
- useful to see the expected format of a SignedReport
- validateReport
- accepts a SignedReport as a JS object (see readme for example) and returns whether the signature is valid
-
Added tests (using Jest) for all of the above
-
Replaced Node v8 support with v14, to be in line with Node's currently officially supported releases.
v0.3.0-alpha.4
- Workaround to allow report.rvk to be specified as a simple 1d array
- Added tcn_example function name back in (as well as tcnExample) to support older library users
v0.3.0-alpha.3
Replace Node v8 support with v14
v0.3.0-alpha.2
- Added automated testing using Jest
- BREAKING API CHANGE: Switched to using camelCase instead of snake_case for all exported functions.
v0.3.0-alpha.1
- Fix build errors by upgrading neon 0.3 -> 0.4
- Check that build works locally before releasing
v0.3.0-alpha.0
adding verification function & type defs...
v0.2.0
- Installing this project as a dependency will now try to get the pre-built binary from github releases page and only build from source as a fallback.
- Releases are published automatically from git version tags