RSSAmplifier

Blog

dramforever's blog

dramforever's blog

dram.pageRSS feed ↗29 posts

Latest posts

Cryptography 30 years apart: Ascon on an HP-16C

Ascon ( NIST , Wikipedia ) is a set of lightweight cryptographic algorithms intended for resource constrained applications that nevertheless is intended to produce modern security. It was originally developed in 2014, and was finalized as a standard in August of 2025 as NIST SP 800-232 “Ascon-Based Lightweight Cryptography Standards for Constrained Devices: Authenticated Encryption, Hash, and…

dram.page is now served by grebedoc.dev

That’s it. If you’re seeing this post, your receiving this page from grebedoc.dev . Check it out if you want a way to serve the contents from a git repo over HTTP(S) on the public Internet. The backend server on grebedoc.dev is called git-pages. I’ll probably use the two names interchangably for the rest of this article. (However, I will use “ grebedoc.dev ” to specifically refer to the domain…

Slide rules approximating Vernier scales

Slide rules are amazing. Even though nowadays we carry around in our pockets a computer with power unfathomed in the last century, I still think slide rules are a wonderful way to manipulate proportions in the analog domain. In fact, I regularly carry one in my daily bag. One problem with the slide rule I carry daily (a Faber-Castelle 62/82) is that it’s rather small, about half a foot (around 15…

Threaded code explained in C

At some point in your life you may have decided that it would be a good idea to represent something in term of a “virtual machine”. You know, a relatively simple format of data that encodes things to do, and a simple interpreter reading it and doing the actual thing. I hope what you were intending to implement is actually a programming language, not just something that got to the point of being…

ELF relative relocations explained

Background Consider this code, where one piece of global data is a pointer to another piece of global data: void *foo; void *bar = &foo; During program execution, the memory at bar contains an address of foo . One way to achieve this is to require all the data to be loaded at a certain address. Then the linker can simply pre-calculate the address at link time and fill in the address for bar .…

VisionFive JTAG adventures, Part 1: JH7100 GPIO

Background The research that went into this article began as a simple technical question: How do I connect to the JTAG debug port on the VisionFive? When luojia asked this very question on the support forum, the only responses were, surprisingly, discouragement. However, for any low-level software development, such a debug port is pretty much the only way to sanely, well, debug anything at all.…

Magic tricks with CRC

An adjustable desk A friend of mine bought a motorized adjustable desk a long time ago and recently got the idea to hook up the controller to the Internet for some reason. They tapped the wire coming from the controls panel with a logic analyzer and was able to capture some packets, hexdumps shown: AAFF 0040 2EEC AAFF 0060 2964 AAFF 0050 2B08 AAFF 040E02 0450 AAFF 050E02 8EDA AAFF 060E02 1D05 AAFF…

The with construct in nix-lang

The Nix package manager comes with its own programming language for, among other things, defining packages. We’re not here to discuss whether that’s a good decision. We’ll call it the Nix language, or nix-lang for short. This article assumes some familiarity with nix-lang. This is not a tutorial. The syntax with A; E Nix-lang has a construct with A; E . Its purpose is to bring the attributes of…

Untitled router:一个路由器的故事

(大概是这一年里做的还算有意义的一件事) 一次命运转折的约饭 2020 年秋季开学之前的什么时候,在一次约饭的时候,正好和一些计算机系专业课的助教说到这学期要参加的一些课程的事情。 根据课程的安排(可参见 也谈课改——以网原为例 一文),两门比较硬核的专业课:计算机组成原理和计算机网络原理(简称 计原 和 网原 而不是什么乱七八糟的东西)作为两门实验项目改动比较大的专业课,现在大概是如下的情况: 从 2020 年开始,计原课程的“奋战三星期,造台计算机”与国际先进技术接轨,又原来的 MIPS 架构改为 RISC-V 架构。当然造机这件事是不变的,三人一组做一个软核。这里有两个小故事: 之前假期的时候在 ICFP 的时候在神秘的 Coffee break room 聊的时候,有人就提到 MIPS 架构已经凉了。虽然还能买到 MIPS 的芯片和产品,但是已经不再有新的发展了。…

Counting empty triangles with number theory

This is a writeup of the Codewars kata ‘Count Empty Triangles in the Future’ . You can see the solution code I submitted if you solve it in C++ (or forfeit…). The problem statement On a grid with width m m and height n n , how many triangles have lattice points as vertices but otherwise have no lattice points on the edges and interiors? (Such triangles are called ‘empty’.) Find the answer modulo…

Heyting algebra made unnecessarily complex

What happens when you foreign import “wrapper”?

6 步搞懂 FFT

Stack-based Clash environment

Bootstrapping Nix

用 2 盏灯也能实现群聊

CPS、ANF、Monad 和 Callback hell

Möbius 反演

有关 monad 的一些想法 (4)

有关 monad 的一些想法 (3)

C 语言注释的妙用

有关 monad 的一些想法 (2)

有关 monad 的一些想法 (1)

表达式归一化和 Traversable, Generics

表达式归一化与 Free Monad

七树归一

Chair Trees (SPOJ MKTHNUM)

Splay 和 Link/cut tree (HDU 2475)

Hello World