Skip to content

Releases: covidwatchorg/tcn-node

v0.3.1

04 May 13:09
Compare
Choose a tag to compare

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

27 Apr 15:02
Compare
Choose a tag to compare

tcn-node 0.3.0

v0.3.0-beta.0

26 Apr 08:43
Compare
Choose a tag to compare
v0.3.0-beta.0 Pre-release
Pre-release
  1. 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
  1. Added tests (using Jest) for all of the above

  2. Replaced Node v8 support with v14, to be in line with Node's currently officially supported releases.

v0.3.0-alpha.4

26 Apr 08:01
Compare
Choose a tag to compare
v0.3.0-alpha.4 Pre-release
Pre-release
  • 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

24 Apr 10:57
Compare
Choose a tag to compare
v0.3.0-alpha.3 Pre-release
Pre-release

Replace Node v8 support with v14

v0.3.0-alpha.2

24 Apr 10:27
Compare
Choose a tag to compare
v0.3.0-alpha.2 Pre-release
Pre-release
  • 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

15 Apr 21:29
Compare
Choose a tag to compare
v0.3.0-alpha.1 Pre-release
Pre-release
  • Fix build errors by upgrading neon 0.3 -> 0.4
  • Check that build works locally before releasing

v0.3.0-alpha.0

15 Apr 04:30
Compare
Choose a tag to compare
v0.3.0-alpha.0 Pre-release
Pre-release

adding verification function & type defs...

v0.2.0

15 Apr 01:46
Compare
Choose a tag to compare
  • 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

v0.1.0

14 Apr 23:13
0237c79
Compare
Choose a tag to compare

Neon proof of concept