Comments (10)
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.
Just tried out 3.3.3, works well so far, will definitely reach out if I run into something else!
from cocoon.
@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.
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.
@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.
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.
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.
Re-opening until the PR gets merged into mainline
from cocoon.
@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.
@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)
- Does anyone need a "raw" key encryption instead of password+KDF?
- This crate is broken. Please fix
- Change cocoon's `unwrap` and `wrap` method names to avoid ambiguity HOT 2
- Extend the BorshSerialize with how to deserialize and use the hashmap HOT 3
- Sequential call of `encrypt`/`dump`/`wrap` with the same cocoon object produces the same cipher text HOT 10
- .dump is not recognized when container is passed as an argument! HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cocoon.