aboutsummaryrefslogtreecommitdiff
path: root/c/test.py
diff options
context:
space:
mode:
authorJack O'Connor <[email protected]>2021-02-28 19:46:33 -0500
committerJack O'Connor <[email protected]>2021-02-28 20:05:40 -0500
commit320affafc11132d92f5274ae82dde37f3db3ef58 (patch)
tree8eea2f53418f66781fa67cd652b25d019d0f237c /c/test.py
parent71d67e081028972790d4b56e23dc57805aa78a85 (diff)
rename the "context string" to the "purpose string"purpose_string
Apart from being pretty ambiguous in general, the term "context string" has the specific problem that it isn't clear whether it should be describing the input or the output. In fact, it's quite important that it describes the output, because the whole point is to domain-separate different outputs that derive from the *same* input. To make that clearer, rename the "context string" to the "purpose string" in documentation.
Diffstat (limited to 'c/test.py')
-rwxr-xr-xc/test.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/c/test.py b/c/test.py
index b0b1929..3c3aca1 100755
--- a/c/test.py
+++ b/c/test.py
@@ -36,7 +36,7 @@ def main():
input_len = case["input_len"]
input = make_test_input(input_len)
hex_key = hexlify(TEST_VECTORS["key"].encode())
- context_string = TEST_VECTORS["context_string"]
+ purpose_string = TEST_VECTORS["purpose_string"]
expected_hash_xof = case["hash"]
expected_hash = expected_hash_xof[:64]
expected_keyed_hash_xof = case["keyed_hash"]
@@ -76,7 +76,7 @@ def main():
input_len, expected_keyed_hash_xof, line)
# Test the default derive key.
- test_derive_key = run_blake3(["--derive-key", context_string], input)
+ test_derive_key = run_blake3(["--derive-key", purpose_string], input)
for line in test_derive_key.splitlines():
assert expected_derive_key == line, \
"derive_key({}): {} != {}".format(
@@ -85,7 +85,7 @@ def main():
# Test the extended derive key.
xof_len = len(expected_derive_key_xof) // 2
test_derive_key_xof = run_blake3(
- ["--derive-key", context_string, "--length",
+ ["--derive-key", purpose_string, "--length",
str(xof_len)], input)
for line in test_derive_key_xof.splitlines():
assert expected_derive_key_xof == line, \