Repository: openwsn-berkeley/lakers (language: python)

Issue:
Rename final remnants of `edhoc-rs` to `lakers`
e.g. see https://github.com/openwsn-berkeley/lakers/blob/main/Cargo.toml#L54


Discussion / hints:

Fix patch:
diff --git a/Cargo.toml b/Cargo.toml
index cbab365b..b5671562 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -11,8 +11,8 @@ members = [
   "crypto/lakers-crypto-rustcrypto",
   "crypto/lakers-crypto-cryptocell310-sys",
   "examples/coap",
-  "examples/edhoc-rs-no_std",
-  "examples/edhoc-rs-cc2538",
+  "examples/lakers-no_std",
+  "examples/lakers-cc2538",
   "lakers-c",
 ]
 
@@ -35,7 +35,7 @@ resolver = "2"
 
 [workspace.package]
 version = "0.4.1"
-repository = "https://github.com/openwsn-berkeley/edhoc-rs/"
+repository = "https://github.com/openwsn-berkeley/lakers/"
 license = "BSD-3-Clause"
 readme = "shared/README.md"
 
@@ -52,7 +52,7 @@ lakers-crypto-hacspec = { path = "crypto/lakers-crypto-hacspec/" }
 lakers-crypto-psa = { path = "crypto/lakers-crypto-psa/" }
 lakers-crypto-rustcrypto = { package = "lakers-crypto-rustcrypto", path = "crypto/lakers-crypto-rustcrypto/", version = "^0.4.1" }
 
-edhoc-rs = { package = "lakers", path = "lib/", version = "^0.4.1", default-features = false }
+lakers = { package = "lakers", path = "lib/", version = "^0.4.1", default-features = false }
 
 [patch.crates-io]
 hacspec-lib = { git = "https://github.com/malishav/hacspec", branch = "aesccm" }
diff --git a/README.md b/README.md
index aa5e636e..290e16fc 100644
--- a/README.md
+++ b/README.md
@@ -49,7 +49,7 @@ To build an example application that works on the [nrf52840dk](https://www.nordi
 
 ```bash
 # head to the example `no_std` example
-cd ./examples/edhoc-rs-no_std
+cd ./examples/lakers-no_std
 
 # build using the cryptocell310 crypto backend (hardware-accelerated)
 cargo build --target="thumbv7em-none-eabihf" --release
diff --git a/crypto/lakers-crypto-rustcrypto/src/lib.rs b/crypto/lakers-crypto-rustcrypto/src/lib.rs
index f2ff09f6..c15bdf25 100644
--- a/crypto/lakers-crypto-rustcrypto/src/lib.rs
+++ b/crypto/lakers-crypto-rustcrypto/src/lib.rs
@@ -116,7 +116,7 @@ impl<Rng: rand_core::RngCore + rand_core::CryptoRng> CryptoTrait for Crypto<Rng>
             1.into(), /* Y coordinate choice does not matter for ECDH operation */
         )
         // While this can actually panic so far, the proper fix is in
-        // https://github.com/openwsn-berkeley/edhoc-rs/issues/93 which will justify this to be a
+        // https://github.com/openwsn-berkeley/lakers/issues/93 which will justify this to be a
         // panic (because after that, public key validity will be an invariant of the public key
         // type)
         .expect("Public key is not a good point");
diff --git a/crypto/src/lib.rs b/crypto/src/lib.rs
index 3a44920e..b31de25c 100644
--- a/crypto/src/lib.rs
+++ b/crypto/src/lib.rs
@@ -1,7 +1,7 @@
-//! Cryptography dispatch for the edhoc-rs crate
+//! Cryptography dispatch for the lakers crate
 //!
-//! This crate is used by edhoc-rs to decide which cryptographic back-end to use. Its presence
-//! avoids the need for all edhoc-rs types to be generic over a back-end, which would then be
+//! This crate is used by lakers to decide which cryptographic back-end to use. Its presence
+//! avoids the need for all lakers types to be generic over a back-end, which would then be
 //! provided by the user at initialization time. On the long run, its type may turn into a
 //! default associated type.
 #![no_std]
diff --git a/examples/coap/Cargo.toml b/examples/coap/Cargo.toml
index f6dbe433..778d5af2 100644
--- a/examples/coap/Cargo.toml
+++ b/examples/coap/Cargo.toml
@@ -4,7 +4,7 @@ version = "0.1.0"
 edition = "2021"
 
 [dependencies]
-edhoc-rs = { package = "lakers", path = "../../lib", features = ["ead-authz"] }
+lakers = { package = "lakers", path = "../../lib", features = ["ead-authz"] }
 lakers-crypto = { path = "../../crypto/", features = [ "hacspec" ] }
 hexlit = "0.5.3"
 coap = { version = "0.13" }
diff --git a/examples/coap/src/bin/coapclient.rs b/examples/coap/src/bin/coapclient.rs
index 23ffe178..c04bd695 100644
--- a/examples/coap/src/bin/coapclient.rs
+++ b/examples/coap/src/bin/coapclient.rs
@@ -1,7 +1,7 @@
 use coap::CoAPClient;
 use coap_lite::ResponseType;
-use edhoc_rs::*;
 use hexlit::hex;
+use lakers::*;
 use std::time::Duration;
 
 const _ID_CRED_I: &[u8] = &hex!("a104412b");
diff --git a/examples/coap/src/bin/coapserver-coaphandler.rs b/examples/coap/src/bin/coapserver-coaphandler.rs
index 37c3c787..7d6dccf8 100644
--- a/examples/coap/src/bin/coapserver-coaphandler.rs
+++ b/examples/coap/src/bin/coapserver-coaphandler.rs
@@ -1,5 +1,5 @@
-use edhoc_rs::*;
 use hexlit::hex;
+use lakers::*;
 use lakers_crypto::Crypto;
 
 use embedded_nal::UdpFullStack;
diff --git a/examples/coap/src/bin/coapserver.rs b/examples/coap/src/bin/coapserver.rs
index 57af48be..328610c3 100644
--- a/examples/coap/src/bin/coapserver.rs
+++ b/examples/coap/src/bin/coapserver.rs
@@ -1,6 +1,6 @@
 use coap_lite::{CoapRequest, Packet, ResponseType};
-use edhoc_rs::*;
 use hexlit::hex;
+use lakers::*;
 use std::net::UdpSocket;
 
 const ID_CRED_I: &[u8] = &hex!("a104412b");
diff --git a/examples/edhoc-rs-cc2538/.cargo/config.toml b/examples/lakers-cc2538/.cargo/config.toml
similarity index 100%
rename from examples/edhoc-rs-cc2538/.cargo/config.toml
rename to examples/lakers-cc2538/.cargo/config.toml
diff --git a/examples/edhoc-rs-cc2538/Cargo.toml b/examples/lakers-cc2538/Cargo.toml
similarity index 85%
rename from examples/edhoc-rs-cc2538/Cargo.toml
rename to examples/lakers-cc2538/Cargo.toml
index e3785102..754f8f84 100644
--- a/examples/edhoc-rs-cc2538/Cargo.toml
+++ b/examples/lakers-cc2538/Cargo.toml
@@ -4,10 +4,10 @@ version = "0.1.0"
 edition = "2021"
 authors = ["Mališa Vučinić <malisa.vucinic@inria.fr>"]
 license.workspace = true
-description = "edhoc-rs example on CC2538 SoC"
+description = "lakers example on CC2538 SoC"
 
 [dependencies]
-edhoc-rs = { package = "lakers", path = "../../lib", default-features = false }
+lakers = { package = "lakers", path = "../../lib", default-features = false }
 lakers-crypto = { path = "../../crypto", default-features = false }
 # depend on an allocator
 embedded-alloc = "0.5.0"
diff --git a/examples/edhoc-rs-cc2538/build.rs b/examples/lakers-cc2538/build.rs
similarity index 100%
rename from examples/edhoc-rs-cc2538/build.rs
rename to examples/lakers-cc2538/build.rs
diff --git a/examples/edhoc-rs-cc2538/flash.sh b/examples/lakers-cc2538/flash.sh
similarity index 100%
rename from examples/edhoc-rs-cc2538/flash.sh
rename to examples/lakers-cc2538/flash.sh
diff --git a/examples/edhoc-rs-cc2538/gdb.sh b/examples/lakers-cc2538/gdb.sh
similarity index 100%
rename from examples/edhoc-rs-cc2538/gdb.sh
rename to examples/lakers-cc2538/gdb.sh
diff --git a/examples/edhoc-rs-cc2538/gdb_commands.gdb b/examples/lakers-cc2538/gdb_commands.gdb
similarity index 100%
rename from examples/edhoc-rs-cc2538/gdb_commands.gdb
rename to examples/lakers-cc2538/gdb_commands.gdb
diff --git a/examples/edhoc-rs-cc2538/jlink_commands.jlink b/examples/lakers-cc2538/jlink_commands.jlink
similarity index 100%
rename from examples/edhoc-rs-cc2538/jlink_commands.jlink
rename to examples/lakers-cc2538/jlink_commands.jlink
diff --git a/examples/edhoc-rs-cc2538/jlink_server.sh b/examples/lakers-cc2538/jlink_server.sh
similarity index 100%
rename from examples/edhoc-rs-cc2538/jlink_server.sh
rename to examples/lakers-cc2538/jlink_server.sh
diff --git a/examples/edhoc-rs-cc2538/memory.x b/examples/lakers-cc2538/memory.x
similarity index 100%
rename from examples/edhoc-rs-cc2538/memory.x
rename to examples/lakers-cc2538/memory.x
diff --git a/examples/edhoc-rs-cc2538/rtt.sh b/examples/lakers-cc2538/rtt.sh
similarity index 100%
rename from examples/edhoc-rs-cc2538/rtt.sh
rename to examples/lakers-cc2538/rtt.sh
diff --git a/examples/edhoc-rs-cc2538/rust-toolchain b/examples/lakers-cc2538/rust-toolchain
similarity index 100%
rename from examples/edhoc-rs-cc2538/rust-toolchain
rename to examples/lakers-cc2538/rust-toolchain
diff --git a/examples/edhoc-rs-cc2538/sections_remote.x b/examples/lakers-cc2538/sections_remote.x
similarity index 100%
rename from examples/edhoc-rs-cc2538/sections_remote.x
rename to examples/lakers-cc2538/sections_remote.x
diff --git a/examples/edhoc-rs-cc2538/src/main.rs b/examples/lakers-cc2538/src/main.rs
similarity index 98%
rename from examples/edhoc-rs-cc2538/src/main.rs
rename to examples/lakers-cc2538/src/main.rs
index fadf362f..9a7cf81a 100644
--- a/examples/edhoc-rs-cc2538/src/main.rs
+++ b/examples/lakers-cc2538/src/main.rs
@@ -16,8 +16,8 @@ use cc2538_hal::crypto::aes_engine::keys::{AesKey, AesKeySize, AesKeys};
 use cc2538_hal::{crypto::*, sys_ctrl::*};
 use cc2538_pac as pac;
 
-use edhoc_rs::{EDHOCError, EdhocInitiator, EdhocResponder, EdhocState};
 use hexlit::hex;
+use lakers::{EDHOCError, EdhocInitiator, EdhocResponder, EdhocState};
 
 extern crate alloc;
 
diff --git a/examples/edhoc-rs-no_std/.cargo/config.toml b/examples/lakers-no_std/.cargo/config.toml
similarity index 100%
rename from examples/edhoc-rs-no_std/.cargo/config.toml
rename to examples/lakers-no_std/.cargo/config.toml
diff --git a/examples/edhoc-rs-no_std/Cargo.toml b/examples/lakers-no_std/Cargo.toml
similarity index 80%
rename from examples/edhoc-rs-no_std/Cargo.toml
rename to examples/lakers-no_std/Cargo.toml
index 1647a60d..3325fd87 100644
--- a/examples/edhoc-rs-no_std/Cargo.toml
+++ b/examples/lakers-no_std/Cargo.toml
@@ -1,11 +1,11 @@
 [package]
-name = "edhoc-rs-no_std"
+name = "lakers-no_std"
 authors = ["Kaspar Schleiser <kaspar@schleiser.de>"]
 version = "0.1.0"
 edition = "2021"
 
 [dependencies]
-edhoc-rs = { package = "lakers", path = "../../lib", default-features = false }
+lakers = { package = "lakers", path = "../../lib", default-features = false }
 lakers-crypto = { path = "../../crypto", default-features = false }
 hexlit = "0.5.3"
 
@@ -25,5 +25,5 @@ default = [ "rtt", "crypto-cryptocell310", "ead-none" ]
 rtt = [ ]
 crypto-psa = [ "lakers-crypto/psa-baremetal" ]
 crypto-cryptocell310 = [ "lakers-crypto/cryptocell310" ]
-ead-none = [ "edhoc-rs/ead-none" ]
-ead-authz = [ "edhoc-rs/ead-authz" ]
+ead-none = [ "lakers/ead-none" ]
+ead-authz = [ "lakers/ead-authz" ]
diff --git a/examples/edhoc-rs-no_std/Embed.toml b/examples/lakers-no_std/Embed.toml
similarity index 100%
rename from examples/edhoc-rs-no_std/Embed.toml
rename to examples/lakers-no_std/Embed.toml
diff --git a/examples/edhoc-rs-no_std/README.md b/examples/lakers-no_std/README.md
similarity index 92%
rename from examples/edhoc-rs-no_std/README.md
rename to examples/lakers-no_std/README.md
index 3b5077cd..59f4aeb2 100644
--- a/examples/edhoc-rs-no_std/README.md
+++ b/examples/lakers-no_std/README.md
@@ -1,7 +1,7 @@
 # Introduction
 
 This folder contains a bare metal (no_std) application for Cortex-M, intended
-to be used to test edhoc-rs on no_std targets.
+to be used to test lakers on no_std targets.
 
 It's configured to work on the lm3s6965evb (Cortex-M3) board, which happens to
 be supported by QEMU's system emulation.
diff --git a/examples/edhoc-rs-no_std/build.rs b/examples/lakers-no_std/build.rs
similarity index 100%
rename from examples/edhoc-rs-no_std/build.rs
rename to examples/lakers-no_std/build.rs
diff --git a/examples/edhoc-rs-no_std/memory.x b/examples/lakers-no_std/memory.x
similarity index 100%
rename from examples/edhoc-rs-no_std/memory.x
rename to examples/lakers-no_std/memory.x
diff --git a/examples/edhoc-rs-no_std/rust-toolchain b/examples/lakers-no_std/rust-toolchain
similarity index 100%
rename from examples/edhoc-rs-no_std/rust-toolchain
rename to examples/lakers-no_std/rust-toolchain
diff --git a/examples/edhoc-rs-no_std/src/main.rs b/examples/lakers-no_std/src/main.rs
similarity index 98%
rename from examples/edhoc-rs-no_std/src/main.rs
rename to examples/lakers-no_std/src/main.rs
index 1e54e2a3..80f2da81 100644
--- a/examples/edhoc-rs-no_std/src/main.rs
+++ b/examples/lakers-no_std/src/main.rs
@@ -13,7 +13,7 @@ use panic_semihosting as _;
 #[cfg(feature = "rtt")]
 use rtt_target::{rprintln as println, rtt_init_print};
 
-use edhoc_rs::*;
+use lakers::*;
 use lakers_crypto::{default_crypto, CryptoTrait};
 
 extern crate alloc;
@@ -52,12 +52,12 @@ fn main() -> ! {
     }
 
     // testing output
-    println!("Hello, edhoc-rs!");
+    println!("Hello, lakers!");
 
     // testing asserts
     assert!(1 == 1);
 
-    // edhoc-rs test code
+    // lakers test code
     use hexlit::hex;
 
     const _ID_CRED_I: &[u8] = &hex!("a104412b");
diff --git a/lakers-c/Cargo.toml b/lakers-c/Cargo.toml
index cfe53834..5c78cc2a 100644
--- a/lakers-c/Cargo.toml
+++ b/lakers-c/Cargo.toml
@@ -9,7 +9,7 @@ readme.workspace = true
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
 
 [dependencies]
-edhoc-rs = { package = "lakers", path = "../lib", default-features = false }
+lakers = { package = "lakers", path = "../lib", default-features = false }
 lakers-crypto = { path = "../crypto", default-features = false }
 hexlit = "0.5.3"
 
@@ -26,8 +26,8 @@ crypto-rustcrypto = [ "lakers-crypto/rustcrypto", "critical-section" ]
 crypto-psa = [ "lakers-crypto/psa", "critical-section" ]
 crypto-psa-baremetal = [ "lakers-crypto/psa-baremetal" ]
 crypto-cryptocell310 = [ "lakers-crypto/cryptocell310" ]
-ead-none = [ "edhoc-rs/ead-none" ]
-ead-authz = [ "edhoc-rs/ead-authz" ]
+ead-none = [ "lakers/ead-none" ]
+ead-authz = [ "lakers/ead-authz" ]
 
 [lib]
 crate-type = ["staticlib"]
diff --git a/lakers-c/src/initiator.rs b/lakers-c/src/initiator.rs
index 6117e73b..8aa7d27a 100644
--- a/lakers-c/src/initiator.rs
+++ b/lakers-c/src/initiator.rs
@@ -1,6 +1,6 @@
 use core::slice;
 
-use edhoc_rs::*;
+use lakers::*;
 use lakers_crypto::{default_crypto, CryptoTrait};
 
 use crate::*;
diff --git a/lakers-c/src/lib.rs b/lakers-c/src/lib.rs
index bad3a560..4712cd52 100644
--- a/lakers-c/src/lib.rs
+++ b/lakers-c/src/lib.rs
@@ -6,7 +6,7 @@
 ///
 /// Example command to compile this module for the nRF52840:
 /// cargo build --target='thumbv7em-none-eabihf' --no-default-features --features="crypto-cryptocell310"
-use edhoc_rs::*;
+use lakers::*;
 use lakers_crypto::{default_crypto, CryptoTrait};
 
 pub mod ead_authz;
@@ -115,12 +115,8 @@ pub extern "C" fn p256_generate_key_pair_from_c(out_private_key: *mut u8, out_pu
         core::ptr::copy_nonoverlapping(
             private_key.as_ptr(),
             out_private_key,
-            edhoc_rs::P256_ELEM_LEN,
-        );
-        core::ptr::copy_nonoverlapping(
-            public_key.as_ptr(),
-            out_public_key,
-            edhoc_rs::P256_ELEM_LEN,
+            lakers::P256_ELEM_LEN,
         );
+        core::ptr::copy_nonoverlapping(public_key.as_ptr(), out_public_key, lakers::P256_ELEM_LEN);
     }
 }
diff --git a/shared/src/crypto.rs b/shared/src/crypto.rs
index 6c67659f..8de9b8bd 100644
--- a/shared/src/crypto.rs
+++ b/shared/src/crypto.rs
@@ -2,7 +2,7 @@
 
 use super::*;
 
-/// Interface between the edhoc-rs crate and any implementations of the required crypto primitives.
+/// Interface between the lakers crate and any implementations of the required crypto primitives.
 ///
 /// Sending cryptographic operations through a trait gives the library the flexibility to use
 /// hardware acceleration on microcontrollers, implementations that facilitate hacspec/hax


Test patch:
diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml
index a6af8b7a..02326061 100644
--- a/.github/workflows/build-and-test.yml
+++ b/.github/workflows/build-and-test.yml
@@ -127,7 +127,7 @@ jobs:
       run: sudo apt-get -y install qemu-system-arm
 
     - name: Run tests in QEMU
-      run: cd examples/edhoc-rs-no_std && cargo run --target="thumbv7m-none-eabi" --no-default-features --features="${{ matrix.crypto_backend }}, ${{ matrix.ead }}" --release
+      run: cd examples/lakers-no_std && cargo run --target="thumbv7m-none-eabi" --no-default-features --features="${{ matrix.crypto_backend }}, ${{ matrix.ead }}" --release
 
 
   build-example-for-cortex-m4:
@@ -150,7 +150,7 @@ jobs:
       run: sudo apt-get -y update && sudo apt-get -y install gcc-arm-none-eabi
 
     - name: Build example
-      run: cd examples/edhoc-rs-no_std && cargo build --target="thumbv7em-none-eabihf" --no-default-features --features="${{ matrix.crypto_backend }}, ${{ matrix.ead }}, rtt" --release
+      run: cd examples/lakers-no_std && cargo build --target="thumbv7em-none-eabihf" --no-default-features --features="${{ matrix.crypto_backend }}, ${{ matrix.ead }}, rtt" --release
 
 
   build-coap-example: