beaconcrypt 0.3.12__tar.gz → 0.4.0__tar.gz

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 (82) hide show
  1. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/.github/workflows/go.yml +2 -2
  2. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/.github/workflows/release.yml +24 -17
  3. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/.github/workflows/rust.yml +2 -0
  4. beaconcrypt-0.4.0/.gitmodules +3 -0
  5. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/Cargo.lock +16 -14
  6. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/Cargo.toml +18 -2
  7. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/PKG-INFO +1 -1
  8. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/README.md +36 -5
  9. beaconcrypt-0.4.0/beaconcrypt.go +443 -0
  10. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/beaconcrypt.pyi +20 -5
  11. beaconcrypt-0.4.0/beaconcrypt_test.go +1385 -0
  12. beaconcrypt-0.4.0/bindings.h +152 -0
  13. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/build.rs +0 -1
  14. beaconcrypt-0.4.0/doc/multi-opening-fixture.md +217 -0
  15. beaconcrypt-0.4.0/doc/persistence.md +92 -0
  16. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/doc/protocol.md +26 -21
  17. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/doc/threat_model.md +7 -1
  18. beaconcrypt-0.4.0/doc/wycheproof.md +55 -0
  19. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/examples/c/main.c +44 -24
  20. beaconcrypt-0.4.0/examples/go/README.md +11 -0
  21. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/examples/go/go.mod +2 -2
  22. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/examples/go/main.go +18 -9
  23. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/examples/python/.gitignore +1 -0
  24. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/examples/python/main.py +20 -9
  25. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/examples/python/pyproject.toml +2 -0
  26. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/examples/rust/main.rs +36 -23
  27. beaconcrypt-0.4.0/go.mod +7 -0
  28. beaconcrypt-0.4.0/go.sum +4 -0
  29. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/pyproject.toml +2 -4
  30. beaconcrypt-0.4.0/scripts/derive_multi_opening.py +245 -0
  31. beaconcrypt-0.4.0/scripts/generate_kat_vectors.go +317 -0
  32. beaconcrypt-0.4.0/scripts/generate_kat_vectors.py +238 -0
  33. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/scripts/generate_python_stubs.py +0 -1
  34. beaconcrypt-0.4.0/src/beacon.rs +6 -0
  35. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/src/cbinds.rs +135 -64
  36. beaconcrypt-0.4.0/src/deser.rs +746 -0
  37. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/src/lib.rs +4 -5
  38. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/src/pqxdh.rs +249 -144
  39. beaconcrypt-0.4.0/src/pybinds.rs +209 -0
  40. beaconcrypt-0.4.0/src/schema/cryptoframe.capnp +12 -0
  41. beaconcrypt-0.4.0/src/ser.rs +309 -0
  42. beaconcrypt-0.4.0/src/server.rs +82 -0
  43. beaconcrypt-0.4.0/src/shared.rs +1597 -0
  44. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/tests/beacon.rs +4 -3
  45. beaconcrypt-0.4.0/tests/protocol.rs +1466 -0
  46. beaconcrypt-0.4.0/tests/server.rs +240 -0
  47. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/tests/test_encryption.py +71 -50
  48. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/tests/test_registration.py +1 -0
  49. beaconcrypt-0.4.0/tests/test_server_state.py +209 -0
  50. beaconcrypt-0.4.0/tests/wycheproof.rs +475 -0
  51. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/uv.lock +32 -0
  52. beaconcrypt-0.3.12/beaconcrypt.go +0 -279
  53. beaconcrypt-0.3.12/beaconcrypt_test.go +0 -691
  54. beaconcrypt-0.3.12/bindings.h +0 -463
  55. beaconcrypt-0.3.12/examples/go/README.md +0 -6
  56. beaconcrypt-0.3.12/examples/python/uv.lock +0 -176
  57. beaconcrypt-0.3.12/go.mod +0 -3
  58. beaconcrypt-0.3.12/src/beacon.rs +0 -309
  59. beaconcrypt-0.3.12/src/pybinds.rs +0 -130
  60. beaconcrypt-0.3.12/src/schema/cryptoframe.capnp +0 -11
  61. beaconcrypt-0.3.12/src/schema/protogram.capnp +0 -10
  62. beaconcrypt-0.3.12/src/server.rs +0 -286
  63. beaconcrypt-0.3.12/src/shared.rs +0 -1038
  64. beaconcrypt-0.3.12/tests/protocol.rs +0 -362
  65. beaconcrypt-0.3.12/tests/server.rs +0 -44
  66. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/.cargo/config.toml +0 -0
  67. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/.github/workflows/codeql.yml +0 -0
  68. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/.github/workflows/python.yml +0 -0
  69. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/.gitignore +0 -0
  70. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/LICENSE +0 -0
  71. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/clippy.toml +0 -0
  72. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/doc/rationale.md +0 -0
  73. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/examples/c/CMakeLists.txt +0 -0
  74. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/examples/c/README.md +0 -0
  75. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/examples/go/.gitignore +0 -0
  76. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/examples/go/go.sum +0 -0
  77. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/examples/python/README.md +0 -0
  78. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/examples/rust/README.md +0 -0
  79. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/rustfmt.toml +0 -0
  80. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/src/error.rs +0 -0
  81. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/src/schema/phase1.capnp +0 -0
  82. {beaconcrypt-0.3.12 → beaconcrypt-0.4.0}/src/schema/phase2.capnp +0 -0
@@ -77,14 +77,14 @@ jobs:
77
77
  if: runner.os != 'Windows'
78
78
  env:
79
79
  CGO_ENABLED: 1
80
- run: go test ./...
80
+ run: go test -race ./...
81
81
 
82
82
  - name: Test Go module on Windows
83
83
  if: runner.os == 'Windows'
84
84
  env:
85
85
  CGO_ENABLED: 1
86
86
  CC: gcc
87
- run: go test ./...
87
+ run: go test -race ./...
88
88
 
89
89
  publish:
90
90
  if: startsWith(github.ref, 'refs/tags/')
@@ -1,24 +1,24 @@
1
1
  name: Release
2
2
 
3
3
  on:
4
- push:
5
- tags:
6
- - "v[0-9]*.[0-9]*.[0-9]*"
4
+ push:
7
5
 
8
6
  env:
9
7
  CARGO_TERM_COLOR: always
10
8
 
11
9
  jobs:
12
- ubuntu-build:
10
+ unix-build:
13
11
  strategy:
14
12
  matrix:
15
- os: [ubuntu-latest, ubuntu-24.04-arm]
13
+ os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, macos-15-intel]
16
14
  runs-on: ${{ matrix.os }}
17
15
  permissions:
18
16
  contents: read
19
17
 
20
18
  steps:
21
19
  - uses: actions/checkout@v7
20
+ with:
21
+ submodules: recursive
22
22
  - name: Install cap'n proto
23
23
  run: |
24
24
  curl -O https://capnproto.org/capnproto-c++-1.5.0.tar.gz
@@ -30,17 +30,18 @@ jobs:
30
30
  - name: Build
31
31
  run: |
32
32
  rustup component add rust-src --toolchain nightly
33
- cargo +nightly rustc --release -Z build-std=std,panic_abort --no-default-features --features beacon,server,pqxdh --crate-type=staticlib
33
+ cargo +nightly rustc --release -Z build-std=std,panic_abort --no-default-features --features gobinds --crate-type=staticlib
34
+ mv target/release/libbeaconcrypt.a target/release/libbeaconcrypt-gobinds-${{ matrix.os }}.a
35
+ cargo +nightly rustc --release -Z build-std=std,panic_abort --no-default-features --features beacon --crate-type=staticlib
36
+ mv target/release/libbeaconcrypt.a target/release/libbeaconcrypt-beacon-${{ matrix.os }}.a
34
37
  - name: Run tests
35
38
  run: cargo test --verbose
36
- - name: Rename
37
- run: mv target/release/libbeaconcrypt.a target/release/libbeaconcrypt-${{ matrix.os }}.a
38
39
  - name: Upload release artifact
39
40
  uses: actions/upload-artifact@v7
40
41
  with:
41
42
  name: beaconcrypt-static-${{ matrix.os }}
42
- path: target/release/libbeaconcrypt-${{ matrix.os }}.a
43
- retention-days: 7
43
+ path: target/release/libbeaconcrypt-*.a
44
+ retention-days: 1
44
45
 
45
46
  windows-build:
46
47
  strategy:
@@ -52,6 +53,8 @@ jobs:
52
53
 
53
54
  steps:
54
55
  - uses: actions/checkout@v7
56
+ with:
57
+ submodules: recursive
55
58
  - name: Install cap'n proto
56
59
  run: |
57
60
  curl.exe -O https://capnproto.org/capnproto-c++-win32-1.5.0.zip
@@ -60,20 +63,21 @@ jobs:
60
63
  run: |
61
64
  $env:Path = "$env:Path;$(join-path $pwd '\capnproto-c++-win32-1.5.0\capnproto-tools-win32-1.5.0')"
62
65
  rustup component add rust-src --toolchain nightly-msvc
63
- cargo +nightly rustc --release -Z build-std=std,panic_abort --no-default-features --features beacon,server,pqxdh --crate-type=staticlib
66
+ cargo +nightly rustc --release -Z build-std=std,panic_abort --no-default-features --features gobinds --crate-type=staticlib
67
+ mv target/release/beaconcrypt.lib target/release/beaconcrypt-gobinds-${{ matrix.os }}.lib
68
+ cargo +nightly rustc --release -Z build-std=std,panic_abort --no-default-features --features beacon --crate-type=staticlib
69
+ mv target/release/beaconcrypt.lib target/release/beaconcrypt-beacon-${{ matrix.os }}.lib
64
70
  ls target/release
65
71
  - name: Run tests
66
72
  run: |
67
73
  $env:Path = "$env:Path;$(join-path $pwd '\capnproto-c++-win32-1.5.0\capnproto-tools-win32-1.5.0')"
68
74
  cargo test --verbose
69
- - name: Rename
70
- run: mv target/release/beaconcrypt.lib target/release/beaconcrypt-${{ matrix.os }}.lib
71
75
  - name: Upload release artifact
72
76
  uses: actions/upload-artifact@v7
73
77
  with:
74
78
  name: beaconcrypt-static-${{ matrix.os }}
75
- path: target/release/beaconcrypt-${{ matrix.os }}.lib
76
- retention-days: 7
79
+ path: target/release/beaconcrypt-*.lib
80
+ retention-days: 1
77
81
 
78
82
  windows-mingw-build:
79
83
  runs-on: windows-latest
@@ -82,6 +86,8 @@ jobs:
82
86
 
83
87
  steps:
84
88
  - uses: actions/checkout@v7
89
+ with:
90
+ submodules: recursive
85
91
  - name: Set up MinGW
86
92
  uses: msys2/setup-msys2@v2
87
93
  with:
@@ -112,10 +118,11 @@ jobs:
112
118
  with:
113
119
  name: beaconcrypt-static-windows-mingw-x86_64
114
120
  path: target/x86_64-pc-windows-gnu/release/libbeaconcrypt-*.a
115
- retention-days: 7
121
+ retention-days: 1
116
122
 
117
123
  release:
118
- needs: [ubuntu-build, windows-build, windows-mingw-build]
124
+ needs: [unix-build, windows-build, windows-mingw-build]
125
+ if: ${{ github.ref_type == 'tag' }}
119
126
  runs-on: ubuntu-latest
120
127
  permissions:
121
128
  contents: write
@@ -18,6 +18,8 @@ jobs:
18
18
 
19
19
  steps:
20
20
  - uses: actions/checkout@v7
21
+ with:
22
+ submodules: recursive
21
23
  - name: Install cap'n proto
22
24
  run: sudo apt update && sudo apt install capnproto
23
25
  - name: Build
@@ -0,0 +1,3 @@
1
+ [submodule "wycheproof"]
2
+ path = wycheproof
3
+ url = https://github.com/C2SP/wycheproof.git
@@ -78,13 +78,15 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
78
78
 
79
79
  [[package]]
80
80
  name = "beaconcrypt"
81
- version = "0.3.12"
81
+ version = "0.4.0"
82
82
  dependencies = [
83
83
  "capnp",
84
84
  "capnpc",
85
85
  "cbindgen",
86
86
  "libsodium-rs",
87
87
  "pyo3",
88
+ "serde",
89
+ "serde_json",
88
90
  "zeroize",
89
91
  ]
90
92
 
@@ -145,9 +147,9 @@ dependencies = [
145
147
 
146
148
  [[package]]
147
149
  name = "cc"
148
- version = "1.3.0"
150
+ version = "1.4.0"
149
151
  source = "registry+https://github.com/rust-lang/crates.io-index"
150
- checksum = "c89588d05638b5b4594a3348a2d6c20277e43a7f5c5202b05cc56888475a47b8"
152
+ checksum = "5add81bb678e6cb321aff7fa0dc7689ad82b112dbc032cea19f91d6b8e3582b9"
151
153
  dependencies = [
152
154
  "find-msvc-tools",
153
155
  "shlex",
@@ -161,9 +163,9 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
161
163
 
162
164
  [[package]]
163
165
  name = "clap"
164
- version = "4.6.3"
166
+ version = "4.6.4"
165
167
  source = "registry+https://github.com/rust-lang/crates.io-index"
166
- checksum = "0fb99565819980999fb7b4a1796046a5c949e6d4ff132cf5fadf5a641e20d776"
168
+ checksum = "d91e0c145792ef73a6ad36d27c75ac09f1832222a3c209689d90f534685ee5b7"
167
169
  dependencies = [
168
170
  "clap_builder",
169
171
  ]
@@ -379,15 +381,15 @@ checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
379
381
 
380
382
  [[package]]
381
383
  name = "libc"
382
- version = "0.2.188"
384
+ version = "0.2.189"
383
385
  source = "registry+https://github.com/rust-lang/crates.io-index"
384
- checksum = "22053b6a34f84abc97f9129e61334f40174659a1b9bd18c970b83db6a9a6348b"
386
+ checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2"
385
387
 
386
388
  [[package]]
387
389
  name = "libflate"
388
- version = "2.3.0"
390
+ version = "2.3.1"
389
391
  source = "registry+https://github.com/rust-lang/crates.io-index"
390
- checksum = "cd96e993e5f3368b0cb8497dae6c860c22af8ff18388c61c6c0b86c58d86b5df"
392
+ checksum = "a4da9b700e758e57152a1fd1c52cbdc5727c1aa6d8743dc1acda917398f1d76c"
391
393
  dependencies = [
392
394
  "adler32",
393
395
  "crc32fast",
@@ -645,7 +647,7 @@ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
645
647
  dependencies = [
646
648
  "proc-macro2",
647
649
  "quote",
648
- "syn 3.0.2",
650
+ "syn 3.0.3",
649
651
  ]
650
652
 
651
653
  [[package]]
@@ -701,9 +703,9 @@ dependencies = [
701
703
 
702
704
  [[package]]
703
705
  name = "syn"
704
- version = "3.0.2"
706
+ version = "3.0.3"
705
707
  source = "registry+https://github.com/rust-lang/crates.io-index"
706
- checksum = "a207d6d6a2b7fc470b80443726053f18a2481b7e1eee970597051596567987a3"
708
+ checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3"
707
709
  dependencies = [
708
710
  "proc-macro2",
709
711
  "quote",
@@ -786,9 +788,9 @@ dependencies = [
786
788
 
787
789
  [[package]]
788
790
  name = "toml_parser"
789
- version = "1.1.2+spec-1.1.0"
791
+ version = "1.1.3+spec-1.1.0"
790
792
  source = "registry+https://github.com/rust-lang/crates.io-index"
791
- checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526"
793
+ checksum = "1d38ac1cf9b95face32296c0a3ede1fdc270627c9d9c02a7274dd6d960dc4d56"
792
794
  dependencies = [
793
795
  "winnow 1.0.4",
794
796
  ]
@@ -1,12 +1,21 @@
1
1
  [package]
2
2
  name = "beaconcrypt"
3
- version = "0.3.12"
3
+ version = "0.4.0"
4
4
  edition = "2024"
5
5
  license-file = "LICENSE"
6
6
  readme = "README.md"
7
7
  description = "Cryptographic transport for C2 channels"
8
8
  rust-version = "1.96"
9
9
  repository = "https://github.com/0xd6cb6d73/beaconcrypt"
10
+ exclude = [
11
+ "wycheproof/**",
12
+ "!wycheproof/testvectors_v1/chacha20_poly1305_test.json",
13
+ "!wycheproof/testvectors_v1/ed25519_test.json",
14
+ "!wycheproof/testvectors_v1/hkdf_sha512_test.json",
15
+ "!wycheproof/testvectors_v1/mlkem_768_encaps_test.json",
16
+ "!wycheproof/testvectors_v1/mlkem_768_test.json",
17
+ "!wycheproof/testvectors_v1/x25519_test.json",
18
+ ]
10
19
 
11
20
  [lib]
12
21
  name = "beaconcrypt"
@@ -32,6 +41,11 @@ name = "server"
32
41
  path = "tests/server.rs"
33
42
  required-features = ["pqxdh", "beacon", "server"]
34
43
 
44
+ [[test]]
45
+ name = "wycheproof"
46
+ path = "tests/wycheproof.rs"
47
+ required-features = ["pqxdh"]
48
+
35
49
  [build-dependencies]
36
50
  capnpc = "0.26"
37
51
  cbindgen = "0.29"
@@ -41,10 +55,12 @@ capnp = "0.26"
41
55
  libsodium-rs = "0.2"
42
56
  zeroize = "1.9"
43
57
  pyo3 = { version = "0.29.0", features = ["abi3-py311", "experimental-inspect"], optional = true }
58
+ serde = { version = "1", features = ["derive"], optional = true }
59
+ serde_json = { version = "1", optional = true }
44
60
 
45
61
  [features]
46
62
  default = ["beacon", "server", "pqxdh"]
47
- server = ["pqxdh"]
63
+ server = ["pqxdh", "dep:serde", "dep:serde_json"]
48
64
  beacon = ["pqxdh"]
49
65
  pqxdh = []
50
66
  gobinds = ["cbinds"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: beaconcrypt
3
- Version: 0.3.12
3
+ Version: 0.4.0
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -48,7 +48,7 @@ I don't use rust a lot, so the code is probably fairly naive. It provides both a
48
48
 
49
49
  The reference implementation expects that all beacons are compiled with the server's public key, and that beaconcrypt is initialized with it.
50
50
 
51
- The server is currently not very usable as it doesn't support saving the state of any individual beacon. This means that if your server goes down, you will not be able to communicate with any previously-registered beacons anymore. The server doesn't support being initialized with an Ed25519 seed (32 random bytes). Users wishing to use the server in practical cases should use this interface to ensure their server keeps its identity across reboots.
51
+ The server is currently not very usable as it doesn't support saving the state of any individual beacon. This means that if your server goes down, you will not be able to communicate with any previously-registered beacons anymore. The server does support being initialized with an Ed25519 seed (32 random bytes). Users wishing to use the server in practical cases should use this interface to ensure their server keeps its identity across reboots.
52
52
 
53
53
  ## Building
54
54
  You will need [Capn'Proto](https://capnproto.org/install.html) (just the binaries) and a recent version of rust for every build.
@@ -66,18 +66,49 @@ uv run pytest tests
66
66
 
67
67
  The `-a` flag is required after rebuilding the Rust static library because Go's build cache does not detect changes to libraries linked through cgo. `-count=1` also prevents reuse of a cached successful test result.
68
68
 
69
+ ### Reproducing known-answer test vectors
70
+
71
+ The fixed cryptographic values used by the Rust known-answer tests can be
72
+ reproduced independently with Python and Go. Run both generators from the
73
+ repository root:
74
+
75
+ ```bash
76
+ uv run python scripts/generate_kat_vectors.py
77
+ go run scripts/generate_kat_vectors.go
78
+ ```
79
+
80
+ The Python generator uses PyCryptodome. The Go generator uses the Go team's
81
+ crypto packages from `golang.org/x/crypto`. Their output should be identical;
82
+ any difference indicates that the vectors or one of the generators has
83
+ diverged.
84
+
85
+ ### Wycheproof
86
+
87
+ The test suite includes pinned [C2SP Wycheproof](https://github.com/C2SP/wycheproof)
88
+ vectors for X25519, Ed25519, ChaCha20-Poly1305-IETF, HKDF-SHA-512 and
89
+ ML-KEM-768. After cloning, initialize the vector submodule before running the
90
+ normal test suite:
91
+
92
+ ```bash
93
+ git submodule update --init --recursive
94
+ cargo test
95
+ ```
96
+
97
+ See [the Wycheproof test documentation](doc/wycheproof.md) for the coverage
98
+ matrix, result semantics and update procedure.
99
+
69
100
  ## Usage
70
- The reference implementation is a library that can currently be used either from rust, through C FFI, go and python bindings. The C interface is currently not tested.
101
+ The reference implementation is a library that can currently be used either from rust, through C FFI, go and python bindings. The C interface is currently only tested through the go bindings. Note that 0-length messages are explicitly disallowed by the reference implementation, as my feeling is that such messages have no purpose except testing parser edge cases. The library also doesn't handle chnking of any kind and will try to process entire messages at once in memory. It is expected that the caller should handle chunking itself if that is required.
71
102
 
72
103
  From Rust, usage is mostly just instantiating `CryptoProvider` objects. See the [example](examples/rust/main.rs) for usage.
73
104
 
74
105
  From python, you can just use the wheels published to pypi, see the [example](examples/python/main.py) for usage.
75
106
 
76
- There are two C interfaces at the moment. When using the legacy interface (without the `beaconcrypt` prefix) the library creates a global `CryptoProvider` object, whose methods are wrapped by the various functions in the interface. When using this interace, the caller is responsible for the buffers passed into the library. Assume the library does not do any copies, except for initialization functions, and never frees the buffers it is passed.
77
-
78
- Using the [newer](src/cbinds.rs) C interface which emulate the class interface, the caller is responsible for providing a valid state object to every function. See the [example](examples/c/main.c) for usage.
107
+ The [C interface](src/cbinds.rs) emulates the class interface, the caller is responsible for providing a valid state object to every function. See the [example](examples/c/main.c) for usage.
79
108
 
80
109
  Go is unfortunately the worst off as the bindings use cgo and therefore building your binary requires being able to link to a version of the library built with the `gobinds` feature. See the [example](examples/go/main.go) for usage.
81
110
 
82
111
  # Copyright
83
112
  This work is dedicated to the public domain.
113
+
114
+ The C and go bindings, as well as most tests and the GH action code were generated by an LLM. This includes the KAT generation scripts, the ChaCha20-Poly1305 invisible salamanders implementation and its associated documentation.