C++

C++ Data Structures Notes

In graduate school, I TA'd a course on data structures in C++. I absolutely loved it. As an undergrad, I loved the course, and having the opportunity to really master the material well enough to teach it was a great learning experience. I was a pretty darn good TA too, rated among the best in the department every semester via reviews by the students. Unfortunately, there was a limit on how many semesters you could TA at UIUC, and they kicked me out after my 3rd. Anyways, I put the my discussion notes online because friends of students would ask for them periodically. They lose a lot without whiteboard examples and discussion, but I've been told they are still helpful.

C++ Functor to C Function Pointer Conversion

Pop quiz hotshot: You're on a bus with no Internet connection. You absolutely need to interface some new C++ code with a shoddy old C interface based on function pointers. The new C++ code makes heavy use of functors to carry state between call invocations. The C code must call these C++ functors by way of a function pointer, and only a function pointer. Your function pointer prototype cannot take any additional arguments for the class type. What do you do? What do you do...

RC4 Tinkering

As part of a CS397 project, I did a lot of research into the RC4 Stream Cipher just to try my hand at crypto research. I was supposed to be researching general wireless vulnerabilities, but I was obsessed. I investigated all sorts of attacks, weaknesses, formalisms, etc for the RC4 cipher itself. In the end, I decided the easiest new contribution would be to improve the bounds on the Knudson Attack on RC4 by implementing the state array as a probability distribution in order to find the exact distribution over the state table after the Key Scheduler ran, and then to use this to help Knudson's algorithm generate more accurate guesses. All said and done I discovered exactly what Aurther Roo surmised back in 1995, just months after the RC4 source leaked. This was when I decided that crypto research wasn't for me.

NJAMD: Malloc Debugger

NJAMD (Not Just Another Malloc Debugger) was a project I started after I realized memory issues in C were my biggest source of program bugs and the current solution at the time (Electric Fence) didn't have all the features I wanted. It eventually made it into RedHat, Debian, and a few other distributions, but fell by the wayside once Valgrind came on the scene. My last effort with the project was to rewrite it in C++, just to prove you could write something that low level successfully in C++ and have it still be just as fast, portable, and flexible as plain C. Unfortunately, I never polished or released the C++ code, but you can check it out of sourceforge.

Syndicate content