# Hashing choices and ownership
Toko Tooling owns the approved algorithm/purpose inventory; consumers own their bytes,
domain separation, budgets and versioned formats. A common import facade is not
required. Use root workspace dependency declarations and inherit them in members.
Use approved hash implementations directly in their owning crates. Preserve protocol bytes when changing imports.
| SHA-256 (`sha2`) | Existing content digests, artifact identities, schema/continuation identities and protocol commitments across Auth, Backup, Blob, Canic, Tooling and IcyDB. Default for new cryptographic content digests. |
| SHA-224 (`sha2`) | Established IC Principal/account derivation at Platform Types; not a second general application default. |
| BLAKE3 (`blake3`) | Existing IcyDB predicate fingerprints, SQL generator/reference and integration qualification data. Preserve these algorithms and bytes when changing imports. |
| XXH3 (`xxhash-rust`) | Existing IcyDB non-security value hashing. Never use it as a cryptographic integrity, authentication or adversarial-collision boundary. |
| HMAC-SHA-256 (`hmac`, `sha2`) | Existing keyed diagnostic fingerprints in Canic Host. Preserve key custody and domain separation. |
| CRC32 (`crc32fast`) | Existing external Principal/account checksum formats. Not cryptographic integrity or authentication. |
Before adding an algorithm, hash implementation
package, or new purpose, obtain explicit maintainer agreement and update this
shared inventory with the reason, owner and relevant tests. Prefer an existing
approved choice. Different crate versions of SHA-256 are not different algorithms;
do not require coordinated releases just to align harmless implementation versions.
Keep signatures, key custody, certification and runtime operations with their protocol owner.
The existing Cargo boundary check with `--external-ic` loads
`ci/hash-dependencies.json`. It refuses known review-required direct hashing or
general crypto packages, including aliases, optional, target, build and dev
dependencies. Consumer allowlists cannot relax that common decision, including
inside Platform. Approved packages still obey stricter consumer ownership rules.
The reviewed adapter inventory admits Platform’s optional, portable, normal
`digest` ^0.10.7 dependency with defaults and extra features disabled. It only
forwards the external BLS curve’s Digest interface into the approved SHA-2 0.11
provider; it introduces no algorithm.
Other owners, versions, build/dev/target edges and consumer relaxations remain
refused; stricter consumer rules still apply.
Transitive packages used by TLS, signature implementations or upstream protocols
are not automatically violations and do not require replacement with SHA-256.
The inventory is a known-package guard, not universal algorithm discovery. It
does not identify unknown package names, algorithms selected inside `sha2`,
browser/WebCrypto choices, copied code or generic hashing through `std::hash`.
Review dependency and source diffs for those cases, and explicitly select every
independent Cargo workspace when checking. Ordinary HashMap hashing is distinct
from a stored or transmitted identity. New direct general crypto dependencies
require review even when only one approved hash is intended.
Changing an algorithm, domain tag, seed, canonical input encoding or digest length
is a separate contract change. Preserve golden vectors and review persisted data,
signatures, cache keys and cross-language consumers before migrating it. Moving
an import must retain existing outputs and bounds; never silently rehash stored
or protocol identities to simplify the dependency graph.