-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: for mbedtls update #58
Conversation
@thekuwayama Two notes:
|
42fbed2
to
b95e864
Compare
@ivmarkov Thank you for comments.
OK!
The related commit is the following: Some functions now require his RNG argument. - pub fn private_from_ec_components(
+ pub fn private_from_ec_components<F: Random>(
+ rng: &mut F,
mut curve: EcGroup,
private_key: Mpi
) -> Result<Pk> { - pub fn mul(
+ pub fn mul<F: crate::rng::Random>(
&self,
group: &mut EcGroup,
k: &Mpi
+ rng: &mut F
) -> Result<EcPoint> { And authenticated encryption/decryption functions have been updated the arguments. pub fn encrypt_auth_inplace(
mut self,
ad: &[u8],
- data: &mut [u8],
- tag: &mut [u8],
+ data_with_tag: &mut [u8],
+ tag_len: usize,
) -> Result<(usize, Cipher<Encryption, Authenticated, Finished>)> { pub fn decrypt_auth_inplace(
mut self,
ad: &[u8],
- data: &mut [u8],
- tag: &[u8],
+ data_with_tag: &mut [u8],
+ tag_len: usize,
) -> Result<(usize, Cipher<Decryption, Authenticated, Finished>)> {
If we try to build |
Of course! In retrospective, this is so obvious - sorry for asking dumb questions! However the crux is we should actually not depend on the latest unstable main branch of any crate. Besides unanticipated breakages, depending on git repos means we cannot publish @kedars Was there any specific reason why we depend on the latest, unreleased @thekuwayama Shall we - as part of this PR - also switch to the latest published Last but not least, let's also remind ourselves that the need to actually use
|
Maybe one important detail: I think depending on GIT crates was OK, as long as when you publish, the build that you do during publishing does not depend on these crates (i.e., these crates are hidden behind non-default features, which is exactly the case with Still - fixing |
Yes, I think so. This update is needed even if you specify |
If it is no longer the case, I also think better to specify |
@ivmarkov the reason to depend on mbedtls git repo was that for 2 years the mbedtls crate hadn't had an update and a number of my fixes for making Matter work were part of the mbedtls git repo (ref: fortanix/rust-mbedtls#196) Same was the case with OpenSSL. I see that mbedtls has had a number of updates recently, so yes, we can now move to the create instead of the git repo @ivmarkov @thekuwayama @bjoernQ having said that, I think yeah, we could move to Rust Crypto instead of the these crates and reduce the support burden. The only thing I wanted to check was that when different crypto crates were used (as opposed to mbedTLS and OpenSSL), some of the common things like SHA ended up getting pulled in from various sources, depending on what the next level dependencies were of the individual crypto libraries. While most of this is flash overhead, some was in-memory as well. |
@kedars cc: @ivmarkov Thank you very much for the response! Then,
And we can close this PR. What do you guys think? |
Hi!
This PR would modify matter/ for interface change due to mbedtls update.
I have not added rev for mbedtls in Cargo.toml .
Please comments if you need to add it.
Thanks.