beaconcrypt 0.3.5__tar.gz → 0.3.7__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 (44) hide show
  1. beaconcrypt-0.3.7/.github/workflows/codeql.yml +105 -0
  2. {beaconcrypt-0.3.5 → beaconcrypt-0.3.7}/.github/workflows/go.yml +5 -2
  3. {beaconcrypt-0.3.5 → beaconcrypt-0.3.7}/.github/workflows/python.yml +24 -3
  4. {beaconcrypt-0.3.5 → beaconcrypt-0.3.7}/.github/workflows/release.yml +39 -3
  5. {beaconcrypt-0.3.5 → beaconcrypt-0.3.7}/Cargo.lock +1 -1
  6. {beaconcrypt-0.3.5 → beaconcrypt-0.3.7}/Cargo.toml +2 -1
  7. {beaconcrypt-0.3.5 → beaconcrypt-0.3.7}/PKG-INFO +1 -1
  8. {beaconcrypt-0.3.5 → beaconcrypt-0.3.7}/README.md +4 -4
  9. beaconcrypt-0.3.7/beaconcrypt_test.go +690 -0
  10. {beaconcrypt-0.3.5 → beaconcrypt-0.3.7}/bindings.h +0 -9
  11. {beaconcrypt-0.3.5 → beaconcrypt-0.3.7}/doc/protocol.md +4 -4
  12. {beaconcrypt-0.3.5 → beaconcrypt-0.3.7}/pyproject.toml +6 -0
  13. {beaconcrypt-0.3.5 → beaconcrypt-0.3.7}/src/beacon.rs +14 -18
  14. {beaconcrypt-0.3.5 → beaconcrypt-0.3.7}/src/lib.rs +18 -31
  15. {beaconcrypt-0.3.5 → beaconcrypt-0.3.7}/src/pqxdh.rs +27 -18
  16. {beaconcrypt-0.3.5 → beaconcrypt-0.3.7}/src/server.rs +12 -12
  17. {beaconcrypt-0.3.5 → beaconcrypt-0.3.7}/src/shared.rs +22 -23
  18. {beaconcrypt-0.3.5 → beaconcrypt-0.3.7}/tests/beacon.rs +4 -4
  19. beaconcrypt-0.3.7/tests/protocol.rs +360 -0
  20. beaconcrypt-0.3.7/tests/test_encryption.py +298 -0
  21. beaconcrypt-0.3.7/tests/test_registration.py +71 -0
  22. {beaconcrypt-0.3.5 → beaconcrypt-0.3.7}/uv.lock +1 -1
  23. beaconcrypt-0.3.5/beaconcrypt_test.go +0 -366
  24. beaconcrypt-0.3.5/tests/protocol.rs +0 -119
  25. beaconcrypt-0.3.5/tests/test_encryption.py +0 -168
  26. beaconcrypt-0.3.5/tests/test_registration.py +0 -38
  27. {beaconcrypt-0.3.5 → beaconcrypt-0.3.7}/.cargo/config.toml +0 -0
  28. {beaconcrypt-0.3.5 → beaconcrypt-0.3.7}/.github/workflows/rust.yml +0 -0
  29. {beaconcrypt-0.3.5 → beaconcrypt-0.3.7}/.gitignore +0 -0
  30. {beaconcrypt-0.3.5 → beaconcrypt-0.3.7}/LICENSE +0 -0
  31. {beaconcrypt-0.3.5 → beaconcrypt-0.3.7}/beaconcrypt.go +0 -0
  32. {beaconcrypt-0.3.5 → beaconcrypt-0.3.7}/build.rs +0 -0
  33. {beaconcrypt-0.3.5 → beaconcrypt-0.3.7}/clippy.toml +0 -0
  34. {beaconcrypt-0.3.5 → beaconcrypt-0.3.7}/doc/rationale.md +0 -0
  35. {beaconcrypt-0.3.5 → beaconcrypt-0.3.7}/doc/threat_model.md +0 -0
  36. {beaconcrypt-0.3.5 → beaconcrypt-0.3.7}/go.mod +0 -0
  37. {beaconcrypt-0.3.5 → beaconcrypt-0.3.7}/rustfmt.toml +0 -0
  38. {beaconcrypt-0.3.5 → beaconcrypt-0.3.7}/src/cnsa2.rs +0 -0
  39. {beaconcrypt-0.3.5 → beaconcrypt-0.3.7}/src/error.rs +0 -0
  40. {beaconcrypt-0.3.5 → beaconcrypt-0.3.7}/src/schema/cryptoframe.capnp +0 -0
  41. {beaconcrypt-0.3.5 → beaconcrypt-0.3.7}/src/schema/phase1.capnp +0 -0
  42. {beaconcrypt-0.3.5 → beaconcrypt-0.3.7}/src/schema/phase2.capnp +0 -0
  43. {beaconcrypt-0.3.5 → beaconcrypt-0.3.7}/src/schema/protogram.capnp +0 -0
  44. {beaconcrypt-0.3.5 → beaconcrypt-0.3.7}/tests/server.rs +0 -0
@@ -0,0 +1,105 @@
1
+ # For most projects, this workflow file will not need changing; you simply need
2
+ # to commit it to your repository.
3
+ #
4
+ # You may wish to alter this file to override the set of languages analyzed,
5
+ # or to provide custom queries or build logic.
6
+ #
7
+ # ******** NOTE ********
8
+ # We have attempted to detect the languages in your repository. Please check
9
+ # the `language` matrix defined below to confirm you have the correct set of
10
+ # supported CodeQL languages.
11
+ #
12
+ name: "CodeQL"
13
+
14
+ on:
15
+ push:
16
+ branches: [ "main" ]
17
+ pull_request:
18
+ branches: [ "main" ]
19
+ schedule:
20
+ - cron: '41 12 * * 5'
21
+
22
+ jobs:
23
+ analyze:
24
+ name: Analyze (${{ matrix.language }})
25
+ # Runner size impacts CodeQL analysis time. To learn more, please see:
26
+ # - https://gh.io/recommended-hardware-resources-for-running-codeql
27
+ # - https://gh.io/supported-runners-and-hardware-resources
28
+ # - https://gh.io/using-larger-runners (GitHub.com only)
29
+ # Consider using larger runners or machines with greater resources for possible analysis time improvements.
30
+ runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
31
+ permissions:
32
+ # required for all workflows
33
+ security-events: write
34
+
35
+ # required to fetch internal or private CodeQL packs
36
+ packages: read
37
+
38
+ # only required for workflows in private repositories
39
+ actions: read
40
+ contents: read
41
+
42
+ strategy:
43
+ fail-fast: false
44
+ matrix:
45
+ include:
46
+ - language: actions
47
+ build-mode: none
48
+ - language: go
49
+ build-mode: autobuild
50
+ - language: python
51
+ build-mode: none
52
+ - language: rust
53
+ build-mode: none
54
+ # CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
55
+ # Use `c-cpp` to analyze code written in C, C++ or both
56
+ # Use 'java-kotlin' to analyze code written in Java, Kotlin or both
57
+ # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
58
+ # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
59
+ # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
60
+ # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
61
+ # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
62
+ steps:
63
+ - name: Checkout repository
64
+ uses: actions/checkout@v7
65
+
66
+ # Add any setup steps before running the `github/codeql-action/init` action.
67
+ # This includes steps like installing compilers or runtimes (`actions/setup-node`
68
+ # or others). This is typically only required for manual builds.
69
+ # - name: Setup runtime (example)
70
+ # uses: actions/setup-example@v1
71
+
72
+ # Initializes the CodeQL tools for scanning.
73
+ - name: Initialize CodeQL
74
+ uses: github/codeql-action/init@v4
75
+ with:
76
+ languages: ${{ matrix.language }}
77
+ build-mode: ${{ matrix.build-mode }}
78
+ # If you wish to specify custom queries, you can do so here or in a config file.
79
+ # By default, queries listed here will override any specified in a config file.
80
+ # Prefix the list here with "+" to use these queries and those in the config file.
81
+
82
+ # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
83
+ # queries: security-extended,security-and-quality
84
+
85
+ # If the analyze step fails for one of the languages you are analyzing with
86
+ # "We were unable to automatically build your code", modify the matrix above
87
+ # to set the build mode to "manual" for that language. Then modify this step
88
+ # to build your code.
89
+ # ℹ️ Command-line programs to run using the OS shell.
90
+ # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
91
+ - name: Run manual build steps
92
+ if: matrix.build-mode == 'manual'
93
+ shell: bash
94
+ run: |
95
+ echo 'If you are using a "manual" build mode for one or more of the' \
96
+ 'languages you are analyzing, replace this with the commands to build' \
97
+ 'your code, for example:'
98
+ echo ' make bootstrap'
99
+ echo ' make release'
100
+ exit 1
101
+
102
+ - name: Perform CodeQL Analysis
103
+ uses: github/codeql-action/analyze@v4
104
+ with:
105
+ category: "/language:${{matrix.language}}"
@@ -2,6 +2,8 @@ name: Go Module
2
2
 
3
3
  on:
4
4
  push:
5
+ branches:
6
+ - main
5
7
  tags:
6
8
  - "[0-9]*.[0-9]*.[0-9]*"
7
9
 
@@ -59,7 +61,7 @@ jobs:
59
61
 
60
62
  - name: Build native library
61
63
  if: runner.os != 'Windows'
62
- run: cargo build --verbose
64
+ run: cargo build --verbose --features gobinds
63
65
 
64
66
  - name: Build native library on Windows
65
67
  if: runner.os == 'Windows'
@@ -67,7 +69,7 @@ jobs:
67
69
  CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER: gcc
68
70
  run: |
69
71
  rustup target add x86_64-pc-windows-gnu
70
- cargo build --verbose --target x86_64-pc-windows-gnu
72
+ cargo build --verbose --target x86_64-pc-windows-gnu --features gobinds
71
73
 
72
74
  - name: Test Go module
73
75
  if: runner.os != 'Windows'
@@ -83,6 +85,7 @@ jobs:
83
85
  run: go test ./...
84
86
 
85
87
  publish:
88
+ if: startsWith(github.ref, 'refs/tags/')
86
89
  needs: test
87
90
  runs-on: ubuntu-latest
88
91
  permissions:
@@ -10,6 +10,8 @@ name: Upload Python Package
10
10
 
11
11
  on:
12
12
  push:
13
+ branches:
14
+ - main
13
15
  tags:
14
16
  - "[0-9]*.[0-9]*.[0-9]*"
15
17
 
@@ -17,7 +19,7 @@ permissions:
17
19
  contents: read
18
20
 
19
21
  jobs:
20
- sdist:
22
+ test:
21
23
  runs-on: ubuntu-latest
22
24
 
23
25
  steps:
@@ -33,8 +35,24 @@ jobs:
33
35
 
34
36
  - name: Run Python tests
35
37
  run: |
36
- uv run --group dev maturin develop --bindings pyo3 --features pybinds
37
- uv run --group dev pytest tests
38
+ uv run maturin develop --uv
39
+ uv run pytest tests
40
+
41
+ sdist:
42
+ if: startsWith(github.ref, 'refs/tags/')
43
+ needs: test
44
+ runs-on: ubuntu-latest
45
+
46
+ steps:
47
+ - uses: actions/checkout@v7
48
+
49
+ - name: Install uv
50
+ uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
51
+ - name: Set up Python
52
+ run: uv python install 3.14
53
+ - name: Install cap'n proto
54
+ run: |
55
+ sudo apt install capnproto
38
56
 
39
57
  - name: Build source distribution
40
58
  run: uvx maturin sdist --out dist
@@ -46,6 +64,8 @@ jobs:
46
64
  path: dist/
47
65
 
48
66
  wheels:
67
+ if: startsWith(github.ref, 'refs/tags/')
68
+ needs: test
49
69
  name: Build wheels on ${{ matrix.os }}
50
70
  runs-on: ${{ matrix.os }}
51
71
  strategy:
@@ -74,6 +94,7 @@ jobs:
74
94
  path: dist/
75
95
 
76
96
  pypi-publish:
97
+ if: startsWith(github.ref, 'refs/tags/')
77
98
  runs-on: ubuntu-latest
78
99
  needs:
79
100
  - sdist
@@ -28,7 +28,7 @@ jobs:
28
28
  - name: Build
29
29
  run: |
30
30
  rustup component add rust-src --toolchain nightly
31
- cargo +nightly rustc --release -Z build-std=std,panic_abort --crate-type=staticlib
31
+ cargo +nightly rustc --release -Z build-std=std,panic_abort --no-default-features --features beacon,server,pqxdh --crate-type=staticlib
32
32
  - name: Run tests
33
33
  run: cargo test --verbose
34
34
  - name: Rename
@@ -56,7 +56,7 @@ jobs:
56
56
  run: |
57
57
  $env:Path = "$env:Path;$(join-path $pwd '\capnproto-c++-win32-1.5.0\capnproto-tools-win32-1.5.0')"
58
58
  rustup component add rust-src --toolchain nightly-msvc
59
- cargo +nightly rustc --release -Z build-std=std,panic_abort --crate-type=staticlib
59
+ cargo +nightly rustc --release -Z build-std=std,panic_abort --no-default-features --features beacon,server,pqxdh --crate-type=staticlib
60
60
  ls target/release
61
61
  - name: Run tests
62
62
  run: |
@@ -71,8 +71,44 @@ jobs:
71
71
  path: target/release/beaconcrypt-${{ matrix.os }}.lib
72
72
  retention-days: 7
73
73
 
74
+ windows-mingw-build:
75
+ runs-on: windows-latest
76
+
77
+ steps:
78
+ - uses: actions/checkout@v7
79
+ - name: Set up MinGW
80
+ uses: msys2/setup-msys2@v2
81
+ with:
82
+ install: mingw-w64-x86_64-gcc
83
+ - name: Install cap'n proto
84
+ run: |
85
+ "C:\msys64\mingw64\bin" >> $env:GITHUB_PATH
86
+ curl.exe -O https://capnproto.org/capnproto-c++-win32-1.5.0.zip
87
+ Expand-Archive capnproto-c++-win32-1.5.0.zip
88
+ "$pwd\capnproto-c++-win32-1.5.0\capnproto-tools-win32-1.5.0" >> $env:GITHUB_PATH
89
+ - name: Build
90
+ env:
91
+ CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER: gcc
92
+ run: |
93
+ rustup target add x86_64-pc-windows-gnu --toolchain nightly
94
+ rustup component add rust-src --toolchain nightly
95
+ cargo +nightly rustc --release -Z build-std=std,panic_abort --target x86_64-pc-windows-gnu --no-default-features --features beacon,server,pqxdh --crate-type=staticlib
96
+ ls target/x86_64-pc-windows-gnu/release
97
+ - name: Run tests
98
+ env:
99
+ CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER: gcc
100
+ run: cargo test --verbose --target x86_64-pc-windows-gnu
101
+ - name: Rename
102
+ run: mv target/x86_64-pc-windows-gnu/release/libbeaconcrypt.a target/x86_64-pc-windows-gnu/release/libbeaconcrypt-windows-mingw-x86_64.a
103
+ - name: Upload release artifact
104
+ uses: actions/upload-artifact@v7
105
+ with:
106
+ name: beaconcrypt-static-windows-mingw-x86_64
107
+ path: target/x86_64-pc-windows-gnu/release/libbeaconcrypt-windows-mingw-x86_64.a
108
+ retention-days: 7
109
+
74
110
  release:
75
- needs: [ubuntu-build, windows-build]
111
+ needs: [ubuntu-build, windows-build, windows-mingw-build]
76
112
  runs-on: ubuntu-latest
77
113
  permissions:
78
114
  contents: write
@@ -84,7 +84,7 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
84
84
 
85
85
  [[package]]
86
86
  name = "beaconcrypt"
87
- version = "0.3.5"
87
+ version = "0.3.7"
88
88
  dependencies = [
89
89
  "capnp",
90
90
  "capnpc",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "beaconcrypt"
3
- version = "0.3.5"
3
+ version = "0.3.7"
4
4
  edition = "2024"
5
5
  license-file = "LICENSE"
6
6
  readme = "README.md"
@@ -31,6 +31,7 @@ server = []
31
31
  beacon = []
32
32
  cnsa2 = ["dep:libcrux-ml-dsa", "dep:libcrux-ml-kem", "dep:libcrux-aesgcm"]
33
33
  pqxdh = []
34
+ gobinds = ["beacon", "server", "pqxdh"]
34
35
  pybinds = ["dep:pyo3"]
35
36
 
36
37
  [profile.release]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: beaconcrypt
3
- Version: 0.3.5
3
+ Version: 0.3.7
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -58,10 +58,10 @@ For windows, I prefer building with stable-gnu for normal usage, and nightly-gnu
58
58
  Build and run all tests:
59
59
  ```bash
60
60
  cargo test
61
- cargo build --target x86_64-pc-windows-gnu
61
+ cargo build --features gobinds --target x86_64-pc-windows-gnu
62
62
  go test ./...
63
- uv run maturin build --features pybinds --uv
64
- uv run --no-sync pytest tests
63
+ uv run maturin develop --uv
64
+ uv run pytest tests
65
65
  ```
66
66
 
67
67
  ## Profiles
@@ -72,7 +72,7 @@ The reference implementation has two profiles: `PQXDH` and `CNSA2`. Profiles are
72
72
  ## Usage
73
73
  The reference implementation is a library that can currently be used either from rust or through C FFI. The C interface is currently not tested.
74
74
 
75
- From rust, usage is mostly just instanciating `CryptoProvider` objects. When using the C FFI, the library creates a global `CryptoProvider` object, whose methods are wrapped by the various functions in the interface. Look at tests for examples.
75
+ From rust, usage is mostly just instanciating `CryptoProvider` objects. When using the C FFI, the library creates a global `CryptoProvider` object, whose methods are wrapped by the various functions in the interface. When using the C FFI, 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.
76
76
 
77
77
  # Copyright
78
78
  This work is dedicated to the public domain.