~spacekookie/public-inbox

keybob: Update miscreant to 0.5.2 v1 PROPOSED

Alyssa Ross: 1
 Update miscreant to 0.5.2

 2 files changed, 6 insertions(+), 6 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~spacekookie/public-inbox/patches/20660/mbox | git am -3
Learn more about email & git

[PATCH keybob] Update miscreant to 0.5.2 Export this patch

0.4.0-beta depends on subtle 0.3.0, which has been yanked.
---
 Cargo.toml     | 4 ++--
 tests/basic.rs | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Cargo.toml b/Cargo.toml
index 3a1cfd4..a960104 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -20,8 +20,8 @@ serde_derive = "1.0"

[dev-dependencies]
serde_json = "1.0"
miscreant = { version = "0.4.0-beta", features = ["aes-soft"] }
miscreant = "0.5.2"
rmp-serde = "0.13.7"
bincode = "1.0"
serde_cbor = "0.8"
toml = "0.4"
\ No newline at end of file
toml = "0.4"
diff --git a/tests/basic.rs b/tests/basic.rs
index 19a7b54..fe87f75 100644
--- a/tests/basic.rs
+++ b/tests/basic.rs
@@ -42,19 +42,19 @@ mod workflow {

    #[test]
    fn miscreant() {
        use workflow::miscreant::aead::{Aes256Siv, Algorithm};
        use workflow::miscreant::{Aes256SivAead, Aead};

        let key = Key::new(KeyType::Aes256);
        let mut aes: Aes256Siv = Aes256Siv::new(key.as_slice());
        let mut aes: Aes256SivAead = Aes256SivAead::new(key.as_slice());

        /* Technically just random data, you can also use a "key" as iv and nonce */
        let iv = Key::new(KeyType::Aes256);
        let nonce = Key::new(KeyType::Aes256);
        let data_in = "This is a message!";

        let encrypted = aes.seal(nonce.as_slice(), iv.as_slice(), data_in.as_bytes());
        let encrypted = aes.encrypt(nonce.as_slice(), iv.as_slice(), data_in.as_bytes());
        let decrypted = aes
            .open(nonce.as_slice(), iv.as_slice(), encrypted.as_slice())
            .decrypt(nonce.as_slice(), iv.as_slice(), encrypted.as_slice())
            .unwrap();
        let data_out = ::std::str::from_utf8(&decrypted.as_slice()).unwrap();

-- 
2.30.0