Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@ specific to hash.

## Cautions

- Every C library is upstream code, unchanged except where CODING-GUIDELINES.md chapter 5 rule 1
allows a security fix on the mirror's `webcpp` branch (BearSSL: 32381d6, ECDSA's nonce
decoding); a moved pin carries that commit. A moved pin is a change of its own (rule 12).
- Every C library is upstream code (CODING-GUIDELINES.md chapter 5 rule 1): never modify
third-party code; a defect found in a dependency is reported to the owner, who submits the fix
upstream, and until upstream applies it the pin may point at our fork's branch carrying exactly
that patch. BearSSL is ae63032 of webcpporg/bearssl's branch
upstream/ecdsa-bits2int-constant-time: upstream 7bea48e and the ECDSA nonce fix submitted
upstream, which does not touch hashing; the pin returns to upstream once the patch is applied.
A moved pin is a change of its own (rule 12).
- A test is declared through `hash-run` in `test/Jamfile`, which runs it with exceptions and
without.
- Every function that computes on a key, a password or a key derivation's secret input holds
Expand All @@ -31,11 +35,14 @@ specific to hash.
holds the guard and gets its call in that backend's `test/timing_coverage_<backend>_test.cpp`,
which fails until it does. The seam support (`test/support/timing_seam.hpp`) counts hash's own
guards by their file, under `include/webcpp/hash/`, in `timing_entries`, and every guard in
`timing_all_entries`.
`timing_all_entries`. `checksums::double_sha256` is the one unkeyed hash that holds the guard
(codecs runs it on a WIF key's payload), and is checked in `test/checksums_test.cpp`.
- Every wipe of a secret or of a failed output is `secure::erase_secret` over a span
(`<webcpp/secure/erase_secret.hpp>`); a test sees each one through secure's seam
`WEBCPP_SECURE_TEST_WIPE_RECORD` (`test/support/wipe_record.hpp`). hash depends on config and
secure, no other webcpp library.
secure, and, through its one target `/webcpp/hash//base58_with_checksum`, on codecs: only
`include/webcpp/hash/base58_with_checksum.hpp` includes a codecs header (an include boundary),
so that `checksums.hpp`, which `hash.hpp` includes, needs none.
- `include/webcpp/hash/detail/canary.h` is a C header: it is in neither the headers-alone list nor
`meta/include-boundaries.json`.
- Every local and parameter of a C++ function in `include/` takes two words, the role then the kind
Expand Down
6 changes: 6 additions & 0 deletions build.jam
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ alias hash : : : : <include>include <library>/boost//headers <library>/webcpp/co
<library>/webcpp/secure//secure ;
# end::hash[]

# tag::base58_with_checksum[]
# Base58Check, hash::formats::base58_with_checksum: hash, and codecs, whose
# header it includes.
alias base58_with_checksum : : : : <library>hash <library>/webcpp/codecs//codecs ;
# end::base58_with_checksum[]

# tag::openssl[]
# OpenSSL, the backend backends::openssl: the superproject's source-built
# OpenSSL 3.5.9 (/webcpp/third_party//openssl, static), the same archives as
Expand Down
6 changes: 4 additions & 2 deletions doc/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ webcpp.doc hash : hash.adoc ;
# The reference reads every header, the backends' and the C libraries'
# included: each library's target gives its define WEBCPP_HASH_HAS_<NAME>
# and its headers' directory, as a program that links it has them; and
# webcpp::asio's, for async.hpp.
# webcpp::asio's, for async.hpp, and webcpp::codecs', for
# base58_with_checksum.hpp.
webcpp.reference hash : <library>/third_party//xkcp
<library>/third_party//blake3 <library>/third_party//sodium
<library>/third_party//bearssl <library>/webcpp/hash//openssl
<library>/third_party//botan <library>/webcpp/asio//asio ;
<library>/third_party//botan <library>/webcpp/asio//asio
<library>/webcpp/codecs//codecs ;

# The guide's generated tables and llms.txt (doc/generated/, doc/llms.txt)
# against their data, capabilities.json, guide.json and measurements.json:
Expand Down
10 changes: 5 additions & 5 deletions doc/backends.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ states about its constant time. The backends:
| every function of its cells

| bearssl
| BearSSL at 32381d6 (webcpporg/bearssl's webcpp branch: upstream 7bea48e (v0.6-39) plus one ECDSA fix that does not touch hashing)
| BearSSL at ae63032 (webcpporg/bearssl's branch upstream/ecdsa-bits2int-constant-time: upstream 7bea48e (v0.6-39) and the ECDSA nonce fix submitted upstream, which does not touch hashing)
| MIT
| `/third_party//bearssl`
| native, wasip2, wasip3, emscripten
Expand Down Expand Up @@ -2212,10 +2212,10 @@ What each backend's upstream states, and where:
* blake3: not stated. BLAKE3 1.8.7: README.md and c/README.md state no constant-time property.
* sodium: not stated. libsodium 1.0.22: its headers state constant time for comparisons (sodium/utils.h) alone, not for its hashing, MAC, key derivation and password hashing functions (crypto_hash_*, crypto_xof_*, crypto_generichash_*, crypto_shorthash_*, crypto_auth_*, crypto_kdf_*, crypto_pwhash_*).
* bearssl: not stated.
** BearSSL upstream 7bea48e (v0.6-39), unchanged in webcpp's pin 32381d6: bearssl_hash.h states constant time for its GHASH implementations alone, not for br_md5_*, br_sha1_*, br_sha224_* to br_sha512_* or br_md5sha1_*.
** BearSSL upstream 7bea48e (v0.6-39), unchanged in webcpp's pin 32381d6: bearssl_kdf.h states no constant-time property for br_shake_*.
** BearSSL upstream 7bea48e (v0.6-39), unchanged in webcpp's pin 32381d6: bearssl_hmac.h states constant time for br_hmac_outCT alone; mac calls br_hmac_out.
** BearSSL upstream 7bea48e (v0.6-39), unchanged in webcpp's pin 32381d6: bearssl_hmac.h states constant time for br_hmac_outCT alone; br_hkdf_* (src/kdf/hkdf.c) and HKDF over pieces call br_hmac_out.
** BearSSL upstream 7bea48e (v0.6-39), unchanged at webcpp's pin ae63032: bearssl_hash.h states constant time for its GHASH implementations alone, not for br_md5_*, br_sha1_*, br_sha224_* to br_sha512_* or br_md5sha1_*.
** BearSSL upstream 7bea48e (v0.6-39), unchanged at webcpp's pin ae63032: bearssl_kdf.h states no constant-time property for br_shake_*.
** BearSSL upstream 7bea48e (v0.6-39), unchanged at webcpp's pin ae63032: bearssl_hmac.h states constant time for br_hmac_outCT alone; mac calls br_hmac_out.
** BearSSL upstream 7bea48e (v0.6-39), unchanged at webcpp's pin ae63032: bearssl_hmac.h states constant time for br_hmac_outCT alone; br_hkdf_* (src/kdf/hkdf.c) and HKDF over pieces call br_hmac_out.
* openssl: not stated.
** OpenSSL 3.5.9: doc/man7/EVP_MD-*.pod, doc/man3/EVP_DigestInit.pod and providers/implementations/digests/ state no constant-time property.
** OpenSSL 3.5.9: doc/man3/EVP_MAC.pod, doc/man7/EVP_MAC-HMAC.pod, EVP_MAC-KMAC.pod, EVP_MAC-BLAKE2.pod, EVP_MAC-Siphash.pod and providers/implementations/macs/ state no constant-time property.
Expand Down
Loading
Loading