dc740 has quit [Remote host closed the connection]
explore has joined #rust-embedded
GenTooMan has quit [Ping timeout: 244 seconds]
GenTooMan has joined #rust-embedded
neceve has joined #rust-embedded
brazuca has quit [Quit: Client closed]
neceve has quit [Ping timeout: 252 seconds]
crabbedhaloablut has quit [Quit: No Ping reply in 180 seconds.]
crabbedhaloablut has joined #rust-embedded
crabbedhaloablut has quit [Write error: Connection reset by peer]
crabbedhaloablut has joined #rust-embedded
neceve has joined #rust-embedded
<re_irc>
<skylardive1> Hello, I am trying to port this code to my no_std project, but it appears it was written in 2018. I am relatively new to Rust, so I'm not familiar with methods like std::heap (which doesn't exist anymore) - https://github.com/gnzlbg/libc_mallocator/blob/master/src/lib.rs
<re_irc>
<diondokter> skylardive1: I don't know much about the current allocator API's, but maybe have a look at this one for inspiration: https://crates.io/crates/linked_list_allocator
<re_irc>
<skylardive1> diondokter: that one is well used?
<re_irc>
<diondokter> Well, it has almost 400K downloads, so at least it's not little used ;)
<re_irc>
<skylardive1> does this work on Linux or is it for bare metal only?
<re_irc>
<diondokter> Its main use is bare metal. Idk if it can be used on Linux. But why would you not use the normal allocator on Linux?
<re_irc>
<skylardive1> well, i am using malloc
<re_irc>
<skylardive1> error[E0015]: cannot call non-const fn `malloc` in statics
<re_irc>
The C version is still better if you need to use the configuration in the header file. The only real benefit of the rust re-write is that is doesn't require an external assembler/compiler.
<re_irc>
<dirbaio> oh using "global_asm!", so nice
<re_irc>
<dirbaio> i've been using the x25519 asm code from that same author, i'll definitely yoink the idea :D
<re_irc>
<newam> Oooo I didn't know they had x25519 as well
<re_irc>
<newam> > The library uses only 1892 bytes of code space in compiled form, uses 368 bytes of stack and runs one scalar multiplication in 548 873 cycles on Cortex-M4, which is speed record as far as I know.
<re_irc>
Wow faster and smaller than p256
<re_irc>
<dirbaio> yeah curve25519 is the best curve out there, much faster and apparently more secure than the nist curves
<re_irc>
<dirbaio> i've extended that to do ed25519 too
<re_irc>
<newam> The problem is usually finding a fast implementation 😆
<re_irc>
<dirbaio> but i'm a bit scared of opensourcing it because it's not constant time, so it's only really useful for verify, not sign 😓
<re_irc>
<dirbaio> which is all that I needed
<re_irc>
<newam> some day we will all have crypto coprocessors :P
<re_irc>
<dirbaio> "Emill/X25519-Cortex-M4" is allegedly faster than the hardware x25519 in nrf's cc310 crypto coprocessor 😂
<re_irc>
<newam> Wouldn't surprise me, "Emill/P256-Cortex-M4" is faster than ST's hardware PKA:
<re_irc>
<chrysn (@chrysn:matrix.org)> that is impressive. granted, the nRF is not the fastest ECC on the block, but it still outperformed the last reference software algorithms i've seen it compared with by a factor of 5-10 in Kietzmann et al (https://eprint.iacr.org/2021/058.pdf) figure 4
<re_irc>
<thalesfragoso> dirbaio: I wouldn't say that, it has a few points with low order, and that's gets worse because the author says you don't need to care about them, as in, you don't need to validate public keys
<re_irc>
<thalesfragoso> So a good amount of libraries don't
<re_irc>
<thalesfragoso> Some people say it's more secure than nist curves because they do not trust nist
<re_irc>
<newam> thalesfragoso: Do you have a link for that? Would love to read more, always trying to expand my crypto knowledge.
<re_irc>
<thalesfragoso> newam: I like this question as a good start point:
<re_irc>
<thalesfragoso> curve25519 is nice: fast and easier to implement correctly (e.g. with respect to constant time), I just would like that they talked more about the weak keys, but what you usually get is the opposite, people placing "you don't need to validate public keys" as one of the biggest benefits of it.
<re_irc>
<dirbaio> it is true you don't have to, for ECDH
neceve has quit [Ping timeout: 252 seconds]
<re_irc>
<thalesfragoso> dirbaio: Well, the triple handshake attack disagrees with you
<re_irc>
<thalesfragoso> The website disregards contributory behavior as a niche thing, but TLS itself was successfully attacked due to lack of it
bjc has joined #rust-embedded
<re_irc>
<dirbaio> huh, l have to read about it then 😅
<re_irc>
<newam> Does anyone have a crate that uses the "embedded_hal_async" SPI traits for a slave?
<re_irc>
I've forgotten some of the async idioms after not touching it for a year :S
<re_irc>
<dirbaio> for slave mode? the traits are for master mode only
<re_irc>
<newam> Sorry as in a device that uses the traits, rather than a HAL that implements the traits.
<re_irc>
<dirbaio> ah so for a driver
<re_irc>
<newam> 🤦♂️ yeah, driver, how did I suddenly loose that word from my vocabulary?