confium 0.2.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +152 -0
  3. data/Cargo.lock +2634 -0
  4. data/Cargo.toml +9 -0
  5. data/README.adoc +114 -14
  6. data/Rakefile +11 -6
  7. data/confium.gemspec +50 -29
  8. data/ext/confium_native/Cargo.toml +63 -0
  9. data/ext/confium_native/build.rs +72 -0
  10. data/ext/confium_native/extconf.rb +10 -0
  11. data/ext/confium_native/src/attributes.rs +88 -0
  12. data/ext/confium_native/src/audit.rs +169 -0
  13. data/ext/confium_native/src/composite.rs +302 -0
  14. data/ext/confium_native/src/deployment.rs +176 -0
  15. data/ext/confium_native/src/ers.rs +93 -0
  16. data/ext/confium_native/src/lib.rs +56 -0
  17. data/ext/confium_native/src/openpgp.rs +55 -0
  18. data/ext/confium_native/src/path.rs +118 -0
  19. data/ext/confium_native/src/pki.rs +431 -0
  20. data/ext/confium_native/src/tc.rs +420 -0
  21. data/ext/confium_native/src/transparency.rs +343 -0
  22. data/ext/confium_native/src/util.rs +201 -0
  23. data/lib/confium/audit.rb +125 -0
  24. data/lib/confium/cfm.rb +4 -5
  25. data/lib/confium/crypto.rb +50 -0
  26. data/lib/confium/digest.rb +11 -9
  27. data/lib/confium/errors/coerce.rb +47 -0
  28. data/lib/confium/errors/crypto_error.rb +15 -0
  29. data/lib/confium/errors/index_error.rb +15 -0
  30. data/lib/confium/errors/not_found_error.rb +15 -0
  31. data/lib/confium/errors/parse_error.rb +15 -0
  32. data/lib/confium/errors/policy_violation_error.rb +15 -0
  33. data/lib/confium/errors/threshold_error.rb +16 -0
  34. data/lib/confium/errors/unresolved_signer_error.rb +14 -0
  35. data/lib/confium/errors/validation_error.rb +17 -0
  36. data/lib/confium/errors/verification_error.rb +15 -0
  37. data/lib/confium/errors.rb +26 -0
  38. data/lib/confium/ffi.rb +23 -0
  39. data/lib/confium/lib.rb +18 -56
  40. data/lib/confium/openpgp.rb +34 -0
  41. data/lib/confium/pki/certificate_builder.rb +60 -0
  42. data/lib/confium/pki/cms/signed_data_builder.rb +92 -0
  43. data/lib/confium/pki/cms.rb +15 -0
  44. data/lib/confium/pki/cnml.rb +80 -0
  45. data/lib/confium/pki.rb +13 -0
  46. data/lib/confium/policy.rb +138 -0
  47. data/lib/confium/secure_bytes.rb +126 -0
  48. data/lib/confium/tc/coordinator.rb +68 -0
  49. data/lib/confium/tc/session.rb +51 -0
  50. data/lib/confium/tc/session_stub.rb +43 -0
  51. data/lib/confium/tc/share_file.rb +87 -0
  52. data/lib/confium/tc.rb +17 -0
  53. data/lib/confium/transparency/ots.rb +63 -0
  54. data/lib/confium/version.rb +1 -1
  55. data/lib/confium.rb +50 -20
  56. metadata +142 -25
  57. data/CODE_OF_CONDUCT.md +0 -84
  58. data/Gemfile +0 -10
  59. data/sig/confium.rbs +0 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6d39e1a2e73e52614bf8b6d41c3f0f798b794c08d575cd67ddbfc7f1935a47ef
4
- data.tar.gz: 21fdba648e4d72df7a3ceda358481778bbcfd741dc31bba35fe31cc8147c5c16
3
+ metadata.gz: 975eebface92795a6a5493274a696fae3bd9bc451fdd8011be74af8ab5bf7b9b
4
+ data.tar.gz: a0b92a831f5391175e789fbc02ad5e674d097b20d92e1fd7059cc91890a9fbc8
5
5
  SHA512:
6
- metadata.gz: 77f5d64871d7870c749f1ead130665433ee6a60bfd5382238f10281e9c473c547a7571e227e27ccbae116530eb812755ce9304bd42a83f5b3d4e9e4b2618ba45
7
- data.tar.gz: 77010b37fd365b3bb6189d49c8561763640986794e755d92df1a621ad0b7652fda226cac5f7a9fd570dbdc1f56d8fddf144d52f960a271da0cfe27f211903a69
6
+ metadata.gz: 244d4c7edcafe5cc22234cc3ad58676f765e8b840c22b1427817d3ed6e33f22cb5f57415cc2fdc7dccf7faa2bad217ec50ede0ea6a4bfd859ae3ea61ed6e5c25
7
+ data.tar.gz: 8a71c86a8b467209b49e1526d0be8a9c35d528e339851db5703e7a0e64993c70d6d68ea8198c8c22649daa1e3688fabaad8d9d2eb8a32dfb2502ca225e4fb38e
data/CHANGELOG.md ADDED
@@ -0,0 +1,152 @@
1
+ # Changelog
2
+
3
+ ## [0.3.1] — 2026-08-21
4
+
5
+ Native platform gems (linux x86_64/aarch64, macOS x86_64/arm64,
6
+ Windows x64-mingw-ucrt) ship alongside the source gem — `gem install`
7
+ no longer needs a Rust toolchain on those platforms.
8
+
9
+ ### Added
10
+
11
+ - ERS archival binding (`Confium::EvidenceRecord`, RFC 4998) and the
12
+ `CONFIUM_LIB` explicit dylib path override.
13
+ - Audit log bindings with sign-triggered autofire and an Enumerable
14
+ `MemorySink`.
15
+ - Typed error hierarchy across all subsystems with native-error
16
+ coercion.
17
+ - CMP20/GG18 in-process threshold ECDSA (`Confium::TC::Cmp20`,
18
+ `Confium::TC::Gg18`) and TC share files with the documented
19
+ envelope shape.
20
+ - Twenty worked examples plus the examples and CNML-profile guides.
21
+
22
+ ### Fixed
23
+
24
+ - The PKI CSR spec no longer shells out to the openssl CLI (it
25
+ generated its fixture with a key file that was never created).
26
+ - CI: first `.rubocop.yml`, Ruby-3.1-compatible lockfile, and a test
27
+ matrix matching the shipped platforms.
28
+
29
+ ## [0.3.0] — 2026-08-04
30
+
31
+ Synced with Confium Rust workspace v0.3.0 (product restructuring).
32
+
33
+ ### Changed
34
+
35
+ - **Rust edition bumped to 2024** (was 2021). Requires Rust 1.85+.
36
+ - **All confium dependencies now from crates.io** (removed path deps for
37
+ `confium-tc-cmp20` and `confium-tc-gg18`). `gem install confium` now works
38
+ without a local workspace checkout.
39
+ - **Version synced to 0.3.0** (was 0.1.0) to match the workspace version.
40
+
41
+ ### Added
42
+
43
+ - Dependencies on newly published shared crypto crates:
44
+ `confium-tc-core`, `confium-crypto-vss`, `confium-crypto-zk`,
45
+ `confium-privacy`, `confium-observability`.
46
+
47
+ ### Migration from 0.1.0
48
+
49
+ - Update `Gemfile`: `gem "confium", "~> 0.3"`
50
+ - Ensure Rust 1.85+ is installed (`rustup update stable`)
51
+ - Run `bundle exec rake compile` to rebuild the native extension
52
+
53
+ ## [0.1.0] — 2026-07-27
54
+
55
+ First public release of the Ruby bindings. Replaces the previous FFI-based
56
+ prototype with a Rust native extension built via `rb_sys` + `magnus`
57
+ (parsanol-ruby pattern). The extension is compiled at `gem install` time
58
+ and exposes the high-value Confium subsystems directly to Ruby.
59
+
60
+ ### Added
61
+
62
+ - **Native extension scaffold** (`ext/confium_native/`). cdylib built via
63
+ `rb_sys` and `magnus`; required by `lib/confium.rb` at load time.
64
+ `Confium::Native.version`, `Confium::Native.loaded?`, and
65
+ `Confium.core_version` provide a smoke-test surface.
66
+
67
+ - **`Confium::Transparency::MerkleTree`** — append-only RFC 6962 Merkle
68
+ tree. `#append(artifact_hash)`, `#root`, `#length`, `#empty?`,
69
+ `#inclusion_proof(seq)`. `Confium::Transparency::InclusionProof` with
70
+ `#sequence`, `#steps`, `#verify(root)`.
71
+
72
+ - **`Confium::Composite`** — PQ-migration composite signatures.
73
+ `.generate_ed25519_keypair`, `.sign_ed25519(private_key, message)`.
74
+ `Confium::Composite::Signature.new(components)` + `#verify(message)` +
75
+ `#component_count` + `#algorithms`.
76
+ `Confium::Composite::VerificationResult#all_verified?` + `#per_component`.
77
+
78
+ - **`Confium::Attributes`** — attribute-based threshold-signing policy DSL.
79
+ `.parse(expr)` + `Confium::Attributes::Predicate#satisfied_by?(signers)`.
80
+ `Confium::Attributes::Signer.new` + `#add(key, value)` + `#has?(key)` +
81
+ `#values(key)`. DSL covers `min_count`, `min_distinct`, `any`, `all`,
82
+ `none`, `and`, `or`, `not`.
83
+
84
+ - **`Confium::PKI::Certificate`** — X.509 v3 certificate parse + inspect.
85
+ `.from_der(binary)` / `.from_pem(string)`. `#to_der`, `#to_pem`,
86
+ `#fingerprint_sha256`, `#serial_hex`, `#not_before`, `#not_after`,
87
+ `#valid_at?(iso8601)`, `#public_key_bytes`.
88
+
89
+ - **`Confium::PKI::CSR`** — PKCS#10 certificate signing request.
90
+ `.from_der` / `.from_pem` / `#to_der` / `#to_pem`.
91
+
92
+ - **`Confium::PKI::CMS::SignedData`** — JSON-backed RFC 5652 model.
93
+ `.from_json` / `#to_json` / `#signer_count` / `#content_type` /
94
+ `#content` / `#certificate_count` / `#certificate_at(index)`.
95
+
96
+ - **`Confium::PKI::CMS::Content`** — value object for optional content.
97
+ `#bytes`, `#length`.
98
+
99
+ - **`Confium::PKI::XMLDSig`** — Canonical XML (RFC 3076) and Exclusive
100
+ C14N. `.canonicalize(xml)`, `.canonicalize_exclusive(xml)`.
101
+
102
+ - **`Confium::Identity::Actor`** — actor identity from JSON.
103
+ `.from_json` / `#to_json` / `#actor_id` / `#actor_type` / `#quorum_id` /
104
+ `#registered_at` / `#expires_at` / `#certificate_count`.
105
+ `Confium::Identity.actor_types` returns the six canonical role strings
106
+ (`manufacturer`, `testing_lab`, `issuing_authority_officer`,
107
+ `biml_director`, `quorum_coordinator`, `verifier`).
108
+
109
+ - **`Confium::Config::Manifest`** — deployment manifest parse + validate.
110
+ `.from_toml` / `#deployment_name` / `#operator` / `#manifest_version` /
111
+ `#tier_count` / `#tier_name_at` / `#quorum_count` / `#validate` /
112
+ `#valid?`.
113
+
114
+ - **`Confium::TC::FrostP256`** — real P-256 Shamir + ECDSA.
115
+ `.generate_keypair`, `.split_secret(secret, t, n)`,
116
+ `.recover_secret([{x:, y:}, ...])`, `.sign(private_key, message)`.
117
+ `Confium::TC::FrostP256::Share#x` / `#y_bytes`.
118
+
119
+ - **`Confium::TC::ElGamalP256`** — threshold ElGamal-P256 KEM.
120
+ `.encapsulate(public_key)` → `{ ciphertext: { c1:, c2: }, shared_secret: }`,
121
+ `.partial_decrypt(party_index, share_bytes, ciphertext)`,
122
+ `.aggregate_partials(partials, threshold, ciphertext)`.
123
+
124
+ ### Changed
125
+
126
+ - `confium.gemspec` switched from `ffi` (pure-Ruby FFI to C ABI) to
127
+ `rb_sys` (Rust native extension). Required Ruby version bumped to 3.1.
128
+ - `lib/confium.rb` now requires `confium_native/confium_native` instead
129
+ of declaring autoloads for hand-written FFI wrappers.
130
+ - All binary inputs and outputs use `Encoding::ASCII_8BIT` Strings
131
+ (binary), the idiomatic Ruby shape for cryptographic data.
132
+
133
+ ### Removed
134
+
135
+ - The `ffi`-based modules (`Confium::FFI`, `Confium::CFM`, `Confium::Lib`,
136
+ `Confium::Crypto`, `Confium::Digest`) — replaced by the magnus-based
137
+ classes above. Old spec files deleted.
138
+
139
+ ### Known limitations
140
+
141
+ - v0.1.0 ships as a **source gem** — `gem install` requires Rust + cargo
142
+ on the host. Cross-platform binary gems for Linux/Windows via
143
+ `rake-compiler-dock` will follow in v0.2.0.
144
+ - The threshold-cryptography surface covers Shamir + Lagrange + ECDSA +
145
+ threshold ElGamal. Full multi-party FROST/CMP20/GG18 session
146
+ orchestration (the async coordinator) is not yet exposed — lands in
147
+ v0.2.0.
148
+ - The composite-signature surface verifies Ed25519 components only.
149
+ ML-DSA-65 / SLH-DSA verifiers will land when the underlying Rust
150
+ crates ship.
151
+ - RBS type signatures in `sig/` are not yet provided — planned for v0.2.0
152
+ once the API stabilizes.