Code Monkey home page Code Monkey logo

Comments (10)

ProjectInitiative avatar ProjectInitiative commented on August 12, 2024 1

Some more context: trying the use of StdRng still uses the std library during compilation meaning the crate can't be used on embedded systems where std does not exist. I am looking the possibility to make that optional

from cocoon.

ProjectInitiative avatar ProjectInitiative commented on August 12, 2024 1

Just tried out 3.3.3, works well so far, will definitely reach out if I run into something else!

from cocoon.

fadeevab avatar fadeevab commented on August 12, 2024

@ProjectInitiative getrandom comes with aes-gcm, need to try to disable all features for aes-gcm and try to make it compiling

├── aes-gcm v0.10.1
│   ├── aead v0.5.0
│   │   ├── crypto-common v0.1.6
│   │   │   ├── rand_core v0.6.3
│   │   │   │   └── getrandom v0.2.7

from cocoon.

fadeevab avatar fadeevab commented on August 12, 2024

@ProjectInitiative

aes-gcm = {version = "0.10", default-features = false, features = ["aes"]}

It almost makes it work, alas, there is one error should be fixed yet:

error[E0599]: no method named `concat` found for array `[&[u8]; 2]` in the current scope
  --> src/kdf.rs:20:42
   |
20 |         let ext_salt = [b"cocoon", salt].concat();
   |                                          ^^^^^^ method not found in `[&[u8]; 2]`

concat is not defined in the no_std... seems like it worked because of the side-effect of linking std because of aes-gcm.

from cocoon.

fadeevab avatar fadeevab commented on August 12, 2024

@ProjectInitiative https://github.com/fadeevab/cocoon/pull/20/files

It would be great if you're able to build it locally.

Thank you so much for reporting the issue!

from cocoon.

ProjectInitiative avatar ProjectInitiative commented on August 12, 2024

I reviewed the PR, and was able to successfully build the PR locally. Going to try and get a simple example running on a Raspberry Pi pico (RP2040 micro controller)

from cocoon.

ProjectInitiative avatar ProjectInitiative commented on August 12, 2024

I was able to compile an in place encryption with the .encrypt and .decrypt functions. The provided example in the docs is good for a no_std env. Working with a no_std and no_alloc I used the following, and might be useful to include in the docs:

    const MAX_DATA_LEN: usize = 64; // Adjust this size as needed
    let mut data = [0u8; MAX_DATA_LEN];
    let data_str = "my secret data";

    // Copy the string's bytes into the fixed-size array
    let data_len = data_str.len().min(MAX_DATA_LEN);
    data[0..data_len].copy_from_slice(data_str.as_bytes());

from cocoon.

ProjectInitiative avatar ProjectInitiative commented on August 12, 2024

Re-opening until the PR gets merged into mainline

from cocoon.

fadeevab avatar fadeevab commented on August 12, 2024

@ProjectInitiative Thank you, good man 😄 I need time to merge, I want also commit linter fixes, maybe I will add your example as well...

from cocoon.

fadeevab avatar fadeevab commented on August 12, 2024

@ProjectInitiative I just published v0.3.3 (https://crates.io/crates/cocoon) try it out!

P.S.: And please, don't hesitate to open an issue in case of any improvement requests.

from cocoon.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.