6 ms·
I know very little about C, C++, or Rust, so I want to ask this to understand why C++ was picked for this. My limited understanding is that people were tolerati
by ancarda 8y ago
I know very little about C, C++, or Rust, so I want to ask this to understand why C++ was picked for this. My limited understanding is that people were tolerating C++ libraries like OpenSSL, but that new crypto or security code would likely be written in Rust for safety.
The blog doesn't say much (to me) about the choice:
In addition to having no external dependencies, Microsoft SEAL
is written in standard C++, making it easy to compile in many
different environments.
Is Rust unsuitable for this project? If anyone here worked on SEAL, I'd love to learn more about this -- did the SEAL team consider using Rust?
- wrs 8y agoRust is great, but its adoption is minuscule compared to C++. Given the point of this release is to encourage wide scale adoption of certain algorithms, C++ is the realistic choice at this time.
- dpark 8y ago> My limited understanding is that ... that new crypto or security code would likely be written in Rust for safety. Where did you get that impression? The creators of Rust would undoubtedly love that to be the case, but Rust is still essentially in its infancy. To my knowledge there are almost no major projects released that have been built in Rust. It's ranked below such heavy hitters as Ada and Prolog for popularity on the TIOBE index[1]. It's pretty unlikely that Rust will become the standard language for everything crypo- or security-related anytime soon (or ever, but it could happen). [1] https://www.tiobe.com/tiobe-index/ https://www.tiobe.com/tiobe-index/
- steveklabnik 8y ago> there are almost no major projects released that have been built in Rust. https://news.ycombinator.com/item?id=18545373 https://news.ycombinator.com/item?id=18545373 This includes Microsoft, which I forgot in that post, who uses it in production for their IOT product, and as part of Visual Studio Code. That said, for crypto, there are some less than ideal things. That’s not stopping projects from working on it.
- jakear 8y agoWhere is rust used in Code?
- sasmithjr 8y agoRust isn't directly used in VSCode. VSCode makes use of ripgrep (a Rust-based replacement for grep), though.
- jakear 8y agoOkay that’s what I thought. So that’s not really Microsoft “using Rust in production code” so much as one guy (I know him; he likes coconut la croix; I do too) deciding ripgrep would be a good basis for implementing the FileSearchProvider api.
- steveklabnik 8y agoThe Code situation is the least strong; see the other sibling threads for more.
- dpark 8y agoTo be clear, I did not claim no one was using it. "Almost no major projects" implies there there are a few major projects. It's a small set of projects, though, especially in comparison with something like C++.
- steveklabnik 8y agoYep, that’s very much true. It’s been on a big upward trajectory lately. But that’s easy when you’re starting small :)
- rargulati 8y ago> That’s not stopping projects from working on it. To support that... Grin contains a phenomenal amount of cryptography: https://github.com/mimblewimble/grin https://github.com/mimblewimble/grin Bulletproofs implementation in rust (small proof sizes): https://github.com/dalek-cryptography/bulletproofs https://github.com/dalek-cryptography/bulletproofs ...with tons of really well done cryptography by that group (dalek): https://github.com/dalek-cryptography https://github.com/dalek-cryptography Pairing based crypto library used in the second largest distribution of Ethereum (and maybe zcash?): https://github.com/paritytech/bn https://github.com/paritytech/bn These libraries have prompted me to start learning rust (albeit slowly as I'm using Go and C at work).
- evilduck 8y agoPHP ranks above Swift on Toibe, I should probably use that for writing iOS applications then. Edit: I guess to make the point crystal clear since there's downvotes, "search engine popularity" is not equivalent to "appropriate tool for the job". Tiobe could equally be viewed as "which languages are hardest to use" or "which languages attract the most newcomers" both of which screw with search engine query rankings.
- jontro 8y agoNot sure how your edit makes your point more clear. The intro explains how it's calculated and how you could use the data that tiobe provides. Personally I wouldn't worry too much about such lists, use it as inspiration to find new technologies. The more languages you know the easier it is to switch when the world around you changes.
- dpark 8y agoThe downvotes are likely for the fact that no one made your strawman claim. “Rust isn’t very popular” is not a statement of its suitability for any particular purpose. It’s a response to the idea that somehow it would have already displaced C/C++ for all security-sensitive work.
- titanix2 8y ago> so I want to ask this to understand why C++ was picked for this Probably in-house competence & interoperability: tons of language provide binding to C++ (including Microsoft .net framework). And I guess researchers at MSR have other things to do than to learn a new language for the sole purpose of having the approvement of one or two netizens.
- aiCeivi9 8y agoNot sure about this one but crypto code has some strange requirements (like constant time execution) or storing keys in some "secure" cpu registers/zones that you end up writing parts of code in ASM anyway. Maybe it is easier to mix it with C/C++ than with Rust.
- ComputerGuru 8y agoThis is such an off tanget comment, made worse by the fact that it pretends to me on-topic. This adds nothing of value to the conversation and only distracts from conversations worth having about encryption and practical applications, and shoots down the work that’s gone into this.
- airstrike 8y agoThis is such an off tanget comment, made worse by the fact that it pretends to me on-topic. This adds nothing of value to the conversation and only distracts from conversations worth having about the question asked by the parent, and shoots down the work that’s gone into that comment.
- marshray 8y agoChoice of language is a critical design decision for a real world crypto implementation. One can prove the math is correct, but proving that in actual use it doesn't leave secrets behind in memory or leak information in timing variations requires guarantees that few (if any) languages provide.
- Ar-Curunir 8y agoSEAL was started before or soon after Rust became stable.
- inetknght 8y ago> C++ libraries like OpenSSL OpenSSL is a C library.