Skip to content

Commit

Permalink
packages: Add lakers-python
Browse files Browse the repository at this point in the history
  • Loading branch information
chrysn committed May 14, 2024
1 parent 7e1b136 commit afbab7c
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages/lakers-python/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package:
name: lakers-python
version: 0.3.0
top-level:
- lakers
source:
url: https://files.pythonhosted.org/packages/29/93/5d70b035f987a48dd854c1afc21025fb8446aae4d43c685b68691175623c/lakers_python-0.3.0.tar.gz
sha256: 009fc5e31b5a9a276216ff43ffd097004396a2a9131359a1da35d464e599cd1c
build:
script: |
cargo update -p proc-macro2 --precise 1.0.60
requirements:
executable:
- rustup
about:
home: https://github.com/openwsn-berkeley/lakers/
PyPI: https://pypi.org/project/lakers-python/
summary: An implementation of EDHOC (RFC 9528)
license: BSD-3-Clause
18 changes: 18 additions & 0 deletions packages/lakers-python/test_cbor_diag.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from pytest_pyodide import run_in_pyodide

@run_in_pyodide(packages=["lakers-python"])
def test_lakers_python(selenium_standalone):
import lakers

# Running an exchange needs some keys and credentials; those are from the EDHOC test vectors.
R = bytes.fromhex("72cc4761dbd4c78f758931aa589d348d1ef874a7e303ede2f140dcf3e6aa4aac")
CRED_R = bytes.fromhex("A2026008A101A5010202410A2001215820BBC34960526EA4D32E940CAD2A234148DDC21791A12AFBCBAC93622046DD44F02258204519E257236B2A0CE2023F0931F1F386CA7AFDA64FCDE0108C224C51EABF6072")

initiator = lakers.EdhocInitiator()
responder = lakers.EdhocResponder(R, CRED_R)

message_1 = initiator.prepare_message_1()
responder.process_message_1(message_1)
_message_2 = responder.prepare_message_2(lakers.CredentialTransfer.ByReference, None, None)

# There's a lot more that can be tested, but if this runs through, we've covered the most critical kinds of operations.

0 comments on commit afbab7c

Please sign in to comment.