age plugin: align PQ host protocol with firmware; 1.2.11 packaging/description#90
Open
0c-coder wants to merge 1 commit into
Conversation
…scription - setup.py: enable long_description (markdown), bump 1.2.10 -> 1.2.11 - MANIFEST.in: ship README.md - client.py: prefer hidraw backend (trustcrypto#89) - age_plugin: PQ seed in user ECC slot 101-116 (selectable, validated); key type in buffer[6]; keygen via OKSETPRIV 0xFF trigger; Message-enum framing; multi-packet decapsulation via send_large_message2 (mirrors RSA/ECDH decrypt) - tests: hardware-free ML-KEM/X-Wing crypto + HID wire-framing/multipacket
Author
|
Firmware counterpart: trustcrypto/libraries#29 — enforces the reserved-slot restriction (host may only write user ECC slots 101–116) on-device. Should land together with #29. Companion packaging release: onlykey/lib-agent#18 (onlykey-agent 1.1.16 PyPI description). |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
age plugin: align PQ host protocol with firmware, + 1.2.11 packaging/description
Bundles the PyPI-description/packaging fix with the post-quantum age-plugin
changes that bring the host protocol in line with the OnlyKey firmware.
Packaging / release
setup.py: enablelong_description(fromREADME.md, markdown) andlong_description_content_typeso the PyPI page renders a description(currently shows "The author of this package has not provided a project
description"). Bump
1.2.10→1.2.11(1.2.10 is already published).MANIFEST.in: shipREADME.mdin the sdist.onlykey/client.py: prefer the Linuxhidrawbackend, fall back tohid,to avoid an "open failed" race when the HID interface was just used by another
app (PR Avoid hid open failed #89).
Post-quantum age plugin ↔ firmware alignment
The ML-KEM-768 / X-Wing plugin talked to slot/opcode/transport conventions the
firmware does not implement. Corrected to match
okcore.cpp/okcrypto.cpp:real ECC range 101–116 (selectable via
--slot, validated), not theformer 133/134 which the firmware never handled. 117–132 are reserved.
KEYTYPE_MLKEM768=5/KEYTYPE_XWING=6) inbuffer[6]so the device routes the request.OKSETPRIVwith the all-0xFFgenerate-on-device trigger(not the previous wrong opcode), and frame messages with the
Messageenum.with the multi-packet
send_large_message2protocol, exactly as the CLI sendsRSA/ECDH ciphertext for
OKDECRYPT. Previously a single 64-byte report couldcarry only ~57 bytes, so decrypt could never work. The firmware reads the key
type from the stored key and reassembles the ciphertext. (X-Wing decaps and
RSA decrypt share identical
process_packets/CRYPTO_AUTHbranches infirmware, so this reuses a proven path.)
Tests (hardware-free)
tests/test_age_pq.py— ML-KEM-768 / X-Wing / HPKE software roundtrip andspec-constant checks.
tests/test_age_wire.py— HID wire-framing: slot/key-type placement, theOKSETPRIVgenerate trigger, reserved-slot rejection, and a multi-packetdecaps test that reassembles the 1120-byte ciphertext from the packets.
Notes for hardware verification
set_privatereturns early on
NONENCRYPTEDPROFILE; decaps uses the profile key).reserved ECC slots).