-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
83 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# dapf (DAP functions) | ||
|
||
This binary provides various functions that can be called to interact with DAP | ||
deployments. | ||
|
||
It several subcommands and their function can be consulted with the built in | ||
help pages the CLI provides. | ||
|
||
|
||
## Examples | ||
|
||
Here are some examples of common functionality of dapf. To avoid installing the | ||
tool replace all instances of `dapf` with `cargo run --bin dapf`. | ||
|
||
### Generate an hpke config | ||
|
||
With the default algorithm | ||
``` | ||
dapf hpke generate | ||
``` | ||
|
||
With a specific algorithm | ||
``` | ||
dapf hpke generate x25519_hkdf_sha256 | ||
``` | ||
|
||
This will output the config twice | ||
``` | ||
{ | ||
"config": { | ||
"id": 131, | ||
"kem_id": "x25519_hkdf_sha256", | ||
"kdf_id": "hkdf_sha256", | ||
"aead_id": "aes128_gcm", | ||
"public_key": "3ccc3ada22dc0b3367d031ea4b02876a77a59ef32b5a1c06109552a51a739a13" | ||
}, | ||
"private_key": "PRIVATE_KEY" | ||
} | ||
hpke config prio encoded and base64 encoded: gwAgAAEAAQAgPMw62iLcCzNn0DHqSwKHanelnvMrWhwGEJVSpRpzmhM | ||
``` | ||
|
||
First as JSON and second as a prio encoded + base64 encoded string which can be | ||
used when issuing requests to `internal/test/add_task` | ||
|
||
|
||
### Decoding responses from aggregators | ||
|
||
|
||
#### Decoding aggregate shares | ||
Once you've collected from the leader you may want to see what the result of the | ||
aggregation was, for that you can use the `decode` subcommand | ||
|
||
```sh | ||
dapf decode ./aggregate_share collection \ | ||
--vdaf-config '{"prio3": { "sum": { "bits": 8 } } }' \ | ||
--task-id "THE_TASK_ID" \ | ||
--hpke-config-path ./hpke-config.json \ | ||
--report-count 2 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters