A saved cursor older than the request's since_server_version is left
from a download that began lower, as a repair from version zero does.
Daochi refuses such a cursor, so every later sync failed with
AUTH_REQUEST_FAILED. The download now starts again at the position.
daochi_client/record_codec packs JSON before encryption and unpacks it only
after authentication, within the app's record limit, beside the released
identity ciphertext. Entity's records already import it; this is the part
of that work that was left uncommitted.
Every host of an account, including those without libsodium, can now
write the account's entity records: the daochi-record-v1 envelope with
the record key of its kind, as the sync request carries it, checked
byte for byte against libsodium.
SHA-256 copied every byte into its block buffer and called a function for
each rotation. Verifying a 13 MB app package this way took most of a
phone's startup. Whole blocks are now hashed where they lie, with the
rotations written inline, as the Crypto package does; the known-answer
vectors still pass.
SignAccountKeysHex now wipes its decoded private key and raw signature,
and the passphrase-encrypted key file functions wipe the plaintext, the
derived key and the sealed copy, on every return path. Inner Breeze's
copy of this code already did; its test moves here and observes each
wipe through Oqs's Cleanse.
keys_test.c creates keys, round-trips the plain, legacy and
passphrase-encrypted key files, refuses truncated buffers, and checks
signatures with liboqs directly. It comes from Inner Breeze, which now
uses keys.zi instead of its own copy of this code.
release.zi reads a daochi-zib-release-v2 release: app, sequence, version,
runtime and APIs, artifacts and sorted dependencies, each bounded, and
checks its Ed25519 signature over the canonical message through the
application's own verify callback. DaochiSha256Matches checks downloaded
bytes. Applications keep their policy: which app, runtime, API range and
dependencies they accept. This comes from Inner Breeze's package code.
SHA-256, HMAC, PBKDF2, ChaCha20-Poly1305 and hex now have known-answer
vectors here. They come from Inner Breeze, whose copies of this code are
replaced by this package.
Add record.zi: canonical daochi-record-v1 metadata AAD and sealed
envelopes with fresh XChaCha20-Poly1305 nonces over the existing native
provider. Photos and Harmony already exchange this profile; native
clients can now build it without app-local crypto. Tests open every
envelope with the libsodium reference and refuse escaped or moved
metadata.
keys.zi imported the Oqs module unqualified, which only worked in module
path builds; a project depending on Daochi Client could not resolve it.
It now imports oqs/Oqs, and the keys test builds as a project.
keys.zi creates an ML-DSA-44 account key pair with its SHA-256 public id,
signs messages (SignAccountMessage fits Identity's signer), and reads and
writes the plain account-key-v1 and passphrase-encrypted
ksync-account-key-v2 key files byte for byte as Inbe does. crypto.zi holds
the SHA-256, HMAC, PBKDF2, and ChaCha20-Poly1305 they use. Both moved from
Inbe so every Daochi app shares one implementation; signing goes through
the Oqs package. The app still stores the keys.
Also pin Ziran 300cbe8; the old pin no longer built.