Category Archives: Rust
Zero Knowledge Proof – Chaum-Pedersen Protocol
Zero Knowledge Proofs (ZKP) are a mechanism of computing a mathematically verifiable cryptographic proof of a true statement without actually revealing any amount of information about the statement other than it holds true. For instance, bank could use ZKP of your credit score to give you the loan without asking for your bank statements, ID,…
What a month! 5 events, 8 awards and 10 new team mates
November was not supposed to be this tectonic and yet here I am, with a huge grin on my face, trying to let all of the impression sink in. This is the list of events I’ve participated in: Event Date Location Prize 1. NASA SpaceApp 2023 Challenge 16th of October 2023 Online – 2. European…
Rust – Fast manipulation of a vector behind a HashMap using RefCell
Let’s analyze a function which maintains some 3×1 f64 vectors for plotting. There are multiple vectors and each of them is behind an enum key of a HashMap. Hasmap is a member property of a struct, so it looks something like this: We have a function log_debug_data which will record the current position of a…
Rust’s Copy trait – An example of a Vec inside a struct
While implementing a very primitive molecular dynamics simulator from scratch in Rust, I have encountered an interesting corner case I believe is worth sharing with anyone learning Rust. Among other artifacts, I have set up a primitive model class for storing some information about a single Particle in a file particle.rs: Nothing fancy, just some…
Leetcode 39 – Combination Sum
Source: https://leetcode.com/problems/combination-sum/ Problem statement Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen numbers sum to target. You may return the combinations in any order. The same number may be chosen from candidates an unlimited number of times. Two combinations…
Rust Internal Mutability – Part 1 – Cell
Rust is known by some very strict rules when it comes to references and compile-time value integrity. This is the one of the main reasons why it was voted for the most loved language in the last 6 years by developers on StackOverflow (TODO: INSERT LINK HERE). In fact, if you try to compile the…