Skip to content

jia-kai/cryptopals-rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cryptopals

My solutions to the cryptopals crypto challenges.

This is also a practice for rust, so the code does not represent good practice.

Why is this project abandoned?

I set out to learn some interesting and useful new programming language, meanwhile solving the crypto challenges. Rust seemed like a good choice. However, after about 6 days' rust experience (3 weekends), I decided to abandon rust and also this project (at least for now). I don't think rust has made a good trade-off between "safety" and convenience for me, and it's also evolving kind of too slowly. For example, I encountered issues like #479, #22741 and #29625, which are almost 1 year old and still unresolved, thus really frustrating for new users like me. Specifically, I also found the following defects (or features):

  1. Index must return a reference, which is really a pain for custom math code. (So I can only implement an .index method but can not utilize the [] operator)
  2. Rust does not allow impl non-local traits on bare local type parameters (for example, impl<T:S> ::std::ops::Add<i32> for T for some local trait S). So I can not write several structs and impl some std trait for them in a unified way.
  3. Rust lacks auto return type deduction like decltype(auto) in C++14, forcing me to write a U8IterRefRm in bytearray.rs. Luckily, a relevant RFC for impl Trait has recently been merged (but it still can not solve my case).
  4. It's sometimes difficult to manage lifetime; see my SO question.

In summary, rust concepts like explicit ownership, lifetime parameters and enforced move-assignment are interesting and inspiring. The document is also well-organized and effective to search/browse. However I think some of the design considerations are overemphasized and get in the way of writing concise code or code that even compiles. In these days I spent most of my time fighting with the compiler or skimming unresolved RFCs/issues, and had little time for actually thinking about the problem that I want to solve. It is fun to learn, but not productive enough for me in real-world projects.

So, I still can not find an alternative for the C++/python combination. And I am going to continue on cryptopals with python :)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages