ratchetkit 1.2.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 (99) hide show
  1. ratchetkit-1.2.0/.github/workflows/publish.yml +62 -0
  2. ratchetkit-1.2.0/.gitignore +15 -0
  3. ratchetkit-1.2.0/LICENSE +661 -0
  4. ratchetkit-1.2.0/PKG-INFO +268 -0
  5. ratchetkit-1.2.0/README.md +241 -0
  6. ratchetkit-1.2.0/example/README.md +58 -0
  7. ratchetkit-1.2.0/example/__init__.py +1 -0
  8. ratchetkit-1.2.0/example/client.py +123 -0
  9. ratchetkit-1.2.0/example/common.py +155 -0
  10. ratchetkit-1.2.0/example/run_demo.py +93 -0
  11. ratchetkit-1.2.0/example/server.py +137 -0
  12. ratchetkit-1.2.0/example/suite_config.py +39 -0
  13. ratchetkit-1.2.0/pyproject.toml +55 -0
  14. ratchetkit-1.2.0/ratchetkit/__init__.py +3 -0
  15. ratchetkit-1.2.0/ratchetkit/algorithms/__init__.py +1 -0
  16. ratchetkit-1.2.0/ratchetkit/algorithms/cipher/__init__.py +17 -0
  17. ratchetkit-1.2.0/ratchetkit/algorithms/cipher/aes128.py +15 -0
  18. ratchetkit-1.2.0/ratchetkit/algorithms/cipher/aes256.py +15 -0
  19. ratchetkit-1.2.0/ratchetkit/algorithms/cipher/base.py +65 -0
  20. ratchetkit-1.2.0/ratchetkit/algorithms/cipher/camellia128.py +18 -0
  21. ratchetkit-1.2.0/ratchetkit/algorithms/cipher/camellia256.py +18 -0
  22. ratchetkit-1.2.0/ratchetkit/algorithms/cipher/chacha20.py +17 -0
  23. ratchetkit-1.2.0/ratchetkit/algorithms/hash/__init__.py +17 -0
  24. ratchetkit-1.2.0/ratchetkit/algorithms/hash/base.py +30 -0
  25. ratchetkit-1.2.0/ratchetkit/algorithms/hash/blake2b.py +26 -0
  26. ratchetkit-1.2.0/ratchetkit/algorithms/hash/sha256.py +26 -0
  27. ratchetkit-1.2.0/ratchetkit/algorithms/hash/sha3256.py +26 -0
  28. ratchetkit-1.2.0/ratchetkit/algorithms/hash/sha384.py +26 -0
  29. ratchetkit-1.2.0/ratchetkit/algorithms/hash/sha512.py +26 -0
  30. ratchetkit-1.2.0/ratchetkit/algorithms/kem/__init__.py +12 -0
  31. ratchetkit-1.2.0/ratchetkit/algorithms/kem/base.py +63 -0
  32. ratchetkit-1.2.0/ratchetkit/algorithms/kem/ec_base.py +104 -0
  33. ratchetkit-1.2.0/ratchetkit/algorithms/kem/mlkem1024.py +15 -0
  34. ratchetkit-1.2.0/ratchetkit/algorithms/kem/mlkem768.py +15 -0
  35. ratchetkit-1.2.0/ratchetkit/algorithms/kem/mlkem_base.py +97 -0
  36. ratchetkit-1.2.0/ratchetkit/algorithms/kem/rsa2048.py +10 -0
  37. ratchetkit-1.2.0/ratchetkit/algorithms/kem/rsa4096.py +10 -0
  38. ratchetkit-1.2.0/ratchetkit/algorithms/kem/rsa_base.py +151 -0
  39. ratchetkit-1.2.0/ratchetkit/algorithms/kem/secp256r1.py +12 -0
  40. ratchetkit-1.2.0/ratchetkit/algorithms/kem/secp384r1.py +12 -0
  41. ratchetkit-1.2.0/ratchetkit/algorithms/kem/secp521r1.py +12 -0
  42. ratchetkit-1.2.0/ratchetkit/algorithms/kem/x25519.py +107 -0
  43. ratchetkit-1.2.0/ratchetkit/algorithms/kem/x448.py +107 -0
  44. ratchetkit-1.2.0/ratchetkit/errors.py +61 -0
  45. ratchetkit-1.2.0/ratchetkit/handshake/__init__.py +15 -0
  46. ratchetkit-1.2.0/ratchetkit/handshake/message.py +177 -0
  47. ratchetkit-1.2.0/ratchetkit/handshake/pqxdh.py +251 -0
  48. ratchetkit-1.2.0/ratchetkit/handshake/x3dh.py +301 -0
  49. ratchetkit-1.2.0/ratchetkit/kdf.py +70 -0
  50. ratchetkit-1.2.0/ratchetkit/keys/__init__.py +5 -0
  51. ratchetkit-1.2.0/ratchetkit/keys/chain.py +57 -0
  52. ratchetkit-1.2.0/ratchetkit/keys/identity.py +36 -0
  53. ratchetkit-1.2.0/ratchetkit/keys/keypair.py +98 -0
  54. ratchetkit-1.2.0/ratchetkit/keys/message.py +87 -0
  55. ratchetkit-1.2.0/ratchetkit/keys/prekey.py +372 -0
  56. ratchetkit-1.2.0/ratchetkit/keys/root.py +102 -0
  57. ratchetkit-1.2.0/ratchetkit/packing.py +154 -0
  58. ratchetkit-1.2.0/ratchetkit/py.typed +0 -0
  59. ratchetkit-1.2.0/ratchetkit/ratchet/__init__.py +22 -0
  60. ratchetkit-1.2.0/ratchetkit/ratchet/chains.py +68 -0
  61. ratchetkit-1.2.0/ratchetkit/ratchet/header.py +51 -0
  62. ratchetkit-1.2.0/ratchetkit/ratchet/limits.py +35 -0
  63. ratchetkit-1.2.0/ratchetkit/ratchet/message/__init__.py +11 -0
  64. ratchetkit-1.2.0/ratchetkit/ratchet/message/base.py +44 -0
  65. ratchetkit-1.2.0/ratchetkit/ratchet/message/double.py +65 -0
  66. ratchetkit-1.2.0/ratchetkit/ratchet/message/triple.py +91 -0
  67. ratchetkit-1.2.0/ratchetkit/ratchet/protocol/__init__.py +11 -0
  68. ratchetkit-1.2.0/ratchetkit/ratchet/protocol/base.py +49 -0
  69. ratchetkit-1.2.0/ratchetkit/ratchet/protocol/double.py +504 -0
  70. ratchetkit-1.2.0/ratchetkit/ratchet/protocol/triple.py +258 -0
  71. ratchetkit-1.2.0/ratchetkit/ratchet/skipped.py +123 -0
  72. ratchetkit-1.2.0/ratchetkit/ratchet/spqr.py +555 -0
  73. ratchetkit-1.2.0/ratchetkit/scka/__init__.py +18 -0
  74. ratchetkit-1.2.0/ratchetkit/scka/chunk.py +124 -0
  75. ratchetkit-1.2.0/ratchetkit/scka/kem_scka.py +410 -0
  76. ratchetkit-1.2.0/ratchetkit/session.py +235 -0
  77. ratchetkit-1.2.0/ratchetkit/suite/__init__.py +33 -0
  78. ratchetkit-1.2.0/ratchetkit/suite/algs.py +94 -0
  79. ratchetkit-1.2.0/ratchetkit/suite/double.py +135 -0
  80. ratchetkit-1.2.0/ratchetkit/suite/triple.py +118 -0
  81. ratchetkit-1.2.0/scripts/bench.py +247 -0
  82. ratchetkit-1.2.0/tests/cipher/test_aes256.py +18 -0
  83. ratchetkit-1.2.0/tests/hash/test_sha256.py +10 -0
  84. ratchetkit-1.2.0/tests/kem/test_mlkem1024.py +16 -0
  85. ratchetkit-1.2.0/tests/kem/test_mlkem768.py +16 -0
  86. ratchetkit-1.2.0/tests/kem/test_rsa2048.py +15 -0
  87. ratchetkit-1.2.0/tests/kem/test_x25519.py +15 -0
  88. ratchetkit-1.2.0/tests/test_adversarial.py +473 -0
  89. ratchetkit-1.2.0/tests/test_kdf.py +118 -0
  90. ratchetkit-1.2.0/tests/test_libsignal_parity.py +374 -0
  91. ratchetkit-1.2.0/tests/test_pqxdh.py +198 -0
  92. ratchetkit-1.2.0/tests/test_ratchet.py +66 -0
  93. ratchetkit-1.2.0/tests/test_scka.py +72 -0
  94. ratchetkit-1.2.0/tests/test_security.py +404 -0
  95. ratchetkit-1.2.0/tests/test_session.py +195 -0
  96. ratchetkit-1.2.0/tests/test_spqr.py +57 -0
  97. ratchetkit-1.2.0/tests/test_suites.py +115 -0
  98. ratchetkit-1.2.0/tests/test_triple.py +115 -0
  99. ratchetkit-1.2.0/tests/test_x3dh.py +57 -0
@@ -0,0 +1,62 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ build:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+
17
+ - uses: actions/setup-python@v5
18
+ with:
19
+ python-version: "3.12"
20
+
21
+ - name: Install build tools and package
22
+ run: |
23
+ python -m pip install --upgrade pip
24
+ python -m pip install build pytest
25
+ python -m pip install -e .
26
+
27
+ - name: Test
28
+ run: pytest
29
+
30
+ - name: Build
31
+ run: python -m build
32
+
33
+ - name: Check version matches tag
34
+ run: |
35
+ tag="${GITHUB_REF_NAME#v}"
36
+ pkg="$(python -c 'import tomllib; print(tomllib.load(open("pyproject.toml", "rb"))["project"]["version"])')"
37
+ init="$(python -c 'from ratchetkit import __version__; print(__version__)')"
38
+ echo "tag=$tag pyproject=$pkg __init__=$init"
39
+ test "$tag" = "$pkg"
40
+ test "$tag" = "$init"
41
+
42
+ - uses: actions/upload-artifact@v4
43
+ with:
44
+ name: dist
45
+ path: dist/
46
+
47
+ publish:
48
+ needs: build
49
+ runs-on: ubuntu-latest
50
+ environment:
51
+ name: pypi
52
+ url: https://pypi.org/p/ratchetkit
53
+ permissions:
54
+ id-token: write
55
+ steps:
56
+ - uses: actions/download-artifact@v4
57
+ with:
58
+ name: dist
59
+ path: dist/
60
+
61
+ - name: Publish package distributions to PyPI
62
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,15 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *.egg-info/
4
+ .eggs/
5
+ dist/
6
+ build/
7
+ .pytest_cache/
8
+ .venv/
9
+ venv/
10
+ *.so
11
+ .idea/
12
+
13
+ # example runtime
14
+ example/ratchetkit.sock
15
+ example/*.log