forked from pyodide/pyodide
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
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. |