===================
== Andrew's Site ==
===================

Cycle Detection using Floyd's Tortoise and Hare

algo
Finding cycles in graphs is an important problem in computer science. I’m ripping straight from wikipedia, but you can use it to check for infinite loops (e.g. function calls accidentally loop, which is a cycle in the call graph) or checking cryptographic hash functions (since they should be close to random functions, we can calculate statistics of random functions, and if the hash function we are testing is too far off, we have problems)1. Read more...

Can't Stop Them All

security side channels
Here’s a security belief: we can mitigate side channels in cryptographic sofware. I don’t hold this belief. The story that repeats over and over goes something like this: engineers want fast crypto algorithms1. Eventually, some researcher finds that these algorithms leak state via software or hardware optimizations, rendering the cryto vulnerable. Since hardware is basically fixed for the near future, we have to rewrite the algs to avoid leakage, which we do. Read more...

Don't forget the null bytes

c programming system exploit
Just a link to a good post. Why do I care about this? It’s because null bytes are not just string terminators. They may also terminate arrays, e.g. terminating the argv array. So, say you are overwriting a buffer, preparing it to be argv for an execve syscall. Make sure to put a null byte or execve will return an error and you’ll never get the result of the execve command you worked so hard for. Read more...

Play with Cpp features

c++ stl programming
C++ is the first language that I seriously learned. I like it alot. However, C++ changed a lot since I first learned it! There was no std::move, r-value references, auto, etc. Most of these are fine, but CTAD/template guide definitely muddies the water, at least for me. I can’t tell you how many times I try to use a constructor, only for the compiler to spit out an error I don’t understand. Read more...

Read generatingfunctionology by Herbert Wilf

See the title. You may want read about a background probability/cs problem to get some motivation (e.g. just look up the Catalan numbers). Either way, the techniques are great.

Updated Site

I moved hosting from github to sourcehut. I like sourcehut thus far, and I’m slowly moving all my repos from github. Sourcehut’s simplicity (lack of fancy css/images)1 is great. Seriously, when I spend most of the day in the terminal, and need to look at the browser for something technical, I don’t want to see useless ads/images. This also applies to non-technical text: when I want to read, I want to look at mainly text, not ads, not headers, and barely images. Read more...

Cuda-gdb errors

cuda
I’ve been spending a lot of time modifying cuda applications to run in a GPU Simulator, GPGPU-Sim. Sometimes this can lead to errors that don’t make sense, especially if you’re not careful when using cuda-gdb. Example: cudaMalloc was returning 0x9c inside cuda-gdb. For some reason, the recommended api error checking method wasn’t working, and weirdly, it didn’t trigger outside of cuda-gdb. Also, what the heck is 0x9c? To find out, grep through the cuda/include folder for the value. Read more...

Analog Searching of Memory

DRAM analog
When I took Fourier Analysis as a undergraduate mathematics student, I remember naively thinking that this could enable “continuous processing”. I thought that physically manipulating signals corresponded exactly (or at least pretty close) to some operators in analysis. Of course, what I was missing was that signals (at least in computers) aren’t usually used for analog. They are used digitally. I then “believed” that all computer processing was digital. Enter this paper: Energy Efficient Data Encoding in DRAM channels exploiting Data Value Similarity. Read more...

Understanding Bitcoin

bitcoin crypto
Mastering Bitcoin is a good book to completely understand bitcoin. It’s not super technical, but it’s a good start to learning about bitcoin. It’s excellent, especially if supplemented with other articles and papers on the more technical aspects.

The zig-zag trick

math algebra
This is the zig-zag trick. The inspiration is a post from a friend’s blog. The “trick” is just the proof of the statement in the post: “ring homomorphisms out of the rationals that agree on the integers must agree everywhere.” Let f,g: ℚ ──> R be two ring homomorphisms such that f| ℤ = g| Now, let x ∈ℚ be arbitrary. Thus, ∃y,z ∈ℤ ℤ z such that x = ─. Read more...
1 of 2 Next Page