<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Notes on Aashutosh Poudel</title><link>https://atosh502.github.io/notes/</link><description>Recent content in Notes on Aashutosh Poudel</description><generator>Hugo</generator><language>en-US</language><copyright>Copyright © \b20\d{2}\b, Aashutosh Poudel.</copyright><lastBuildDate>Tue, 10 Mar 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://atosh502.github.io/notes/index.xml" rel="self" type="application/rss+xml"/><item><title>On benchmarking crimes</title><link>https://atosh502.github.io/notes/benchmarking-crimes/</link><pubDate>Tue, 10 Mar 2026 00:00:00 +0000</pubDate><guid>https://atosh502.github.io/notes/benchmarking-crimes/</guid><description>&lt;p&gt;Links&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=lJ8ydIuPFeU"&gt;&amp;ldquo;How NOT to Measure Latency&amp;rdquo; by Gil Tene&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gernot-heiser.org/benchmarking-crimes.html"&gt;Systems Benchmarking Crimes | Gernot Heiser&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://trustworthy.systems/publications/full_text/vanderKouwe_HABG_19.pdf"&gt;SoK: Benchmarking Flaws in Systems Security&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://arxiv.org/pdf/1801.02381"&gt;Benchmarking Crimes: An Emerging Threat in Systems Security&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://uvdn7.github.io/littles-law-and-service-latency/"&gt;Little&amp;rsquo;s Law&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://rpubs.com/jrauser/percentiles"&gt;You CAN average percentiles!**&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>On post-quantum crypto</title><link>https://atosh502.github.io/notes/pqc-related/</link><pubDate>Tue, 10 Mar 2026 00:00:00 +0000</pubDate><guid>https://atosh502.github.io/notes/pqc-related/</guid><description>&lt;ul&gt;
&lt;li&gt;&lt;a href="https://atosh502.github.io/log/pq-playbook-by-symbolic-software/"&gt;Post Quantum Playbook by Symbolic Software&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://kubernetes.io/blog/2025/07/18/pqc-in-k8s/"&gt;Post-Quantum Cryptography in Kubernetes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://blog.cloudflare.com/bootstrap-mtc/"&gt;https://blog.cloudflare.com/bootstrap-mtc/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>On constant-time crypto</title><link>https://atosh502.github.io/notes/const-crypto/</link><pubDate>Sun, 04 Jan 2026 00:00:00 +0000</pubDate><guid>https://atosh502.github.io/notes/const-crypto/</guid><description>&lt;p&gt;Some notes on learning/using constant-time cryptography.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://eprint.iacr.org/2021/1121.pdf"&gt;Constant-Time Arithmetic for Safer Cryptography&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;constant-time arbitrary-precision arithmetic operations&lt;/li&gt;
&lt;li&gt;constant-time programs - operations vary in time based only on public values&lt;/li&gt;
&lt;li&gt;examples
&lt;ul&gt;
&lt;li&gt;replacing branches with bitwise operations&lt;/li&gt;
&lt;li&gt;avoiding array accesses with secret indices&lt;/li&gt;
&lt;li&gt;making sure that loops have a fixed number of iterations&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;modern crypto
&lt;ul&gt;
&lt;li&gt;finite fields with fixed parameters (eg. ECC)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;traditional crypto
&lt;ul&gt;
&lt;li&gt;not fixed parameter (eg. RSA)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;saferith&lt;/code&gt; as a constant-time alternative to Go&amp;rsquo;s &lt;code&gt;big.Int&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;problem: traditional libraries store numbers without zero padding&lt;/li&gt;
&lt;li&gt;solution: pad numbers to different public sizes
&lt;ul&gt;
&lt;li&gt;leaks public sizes, while still keeping values hidden&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://rdist.root.org/2009/05/28/timing-attack-in-google-keyczar-library/"&gt;Timing attack in Google&amp;rsquo;s Keyczar lib&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;Example of constant-time string comparison
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;1&lt;/span&gt;&lt;span&gt; correctMac &lt;span style="color:#666"&gt;=&lt;/span&gt; &lt;span style="color:#007020"&gt;self&lt;/span&gt;&lt;span style="color:#666"&gt;.&lt;/span&gt;Sign(msg)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;2&lt;/span&gt;&lt;span&gt; &lt;span style="color:#007020;font-weight:bold"&gt;if&lt;/span&gt; &lt;span style="color:#007020"&gt;len&lt;/span&gt;(correctMac) &lt;span style="color:#666"&gt;!=&lt;/span&gt; &lt;span style="color:#007020"&gt;len&lt;/span&gt;(sig_bytes):
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;3&lt;/span&gt;&lt;span&gt; &lt;span style="color:#007020;font-weight:bold"&gt;return&lt;/span&gt; &lt;span style="color:#007020;font-weight:bold"&gt;False&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;4&lt;/span&gt;&lt;span&gt; result &lt;span style="color:#666"&gt;=&lt;/span&gt; &lt;span style="color:#40a070"&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;5&lt;/span&gt;&lt;span&gt; &lt;span style="color:#007020;font-weight:bold"&gt;for&lt;/span&gt; x, y &lt;span style="color:#007020;font-weight:bold"&gt;in&lt;/span&gt; &lt;span style="color:#007020"&gt;zip&lt;/span&gt;(correctMac, sig_bytes):
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;6&lt;/span&gt;&lt;span&gt; result &lt;span style="color:#666"&gt;|=&lt;/span&gt; &lt;span style="color:#007020"&gt;ord&lt;/span&gt;(x) &lt;span style="color:#666"&gt;^&lt;/span&gt; &lt;span style="color:#007020"&gt;ord&lt;/span&gt;(y)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;7&lt;/span&gt;&lt;span&gt; &lt;span style="color:#007020;font-weight:bold"&gt;return&lt;/span&gt; result &lt;span style="color:#666"&gt;==&lt;/span&gt; &lt;span style="color:#40a070"&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/veorq/cryptocoding"&gt;Guidelines for low-level cryptography software | Cryptocoding | Jean-Philippe Aumasson &lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;Go&amp;rsquo;s &lt;a href="https://pkg.go.dev/crypto/subtle"&gt;crypto/subtle&lt;/a&gt; library: implements functions that are often useful in cryptographic code but require careful thought to use correctly&lt;/li&gt;
&lt;li&gt;Select between a and b without using &lt;code&gt;if-else&lt;/code&gt;.
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-c" data-lang="c"&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt; 1&lt;/span&gt;&lt;span&gt;&lt;span style="color:#60a0b0;font-style:italic"&gt;/* Conditionally return a or b depending on whether bit is set */&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt; 2&lt;/span&gt;&lt;span&gt;&lt;span style="color:#60a0b0;font-style:italic"&gt;/* Equivalent to: return bit ? a : b */&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt; 3&lt;/span&gt;&lt;span&gt;&lt;span style="color:#902000"&gt;unsigned&lt;/span&gt; &lt;span style="color:#06287e"&gt;select&lt;/span&gt; (&lt;span style="color:#902000"&gt;unsigned&lt;/span&gt; a, &lt;span style="color:#902000"&gt;unsigned&lt;/span&gt; b, &lt;span style="color:#902000"&gt;unsigned&lt;/span&gt; bit)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt; 4&lt;/span&gt;&lt;span&gt;{
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt; 5&lt;/span&gt;&lt;span&gt; &lt;span style="color:#902000"&gt;unsigned&lt;/span&gt; isnonzero &lt;span style="color:#666"&gt;=&lt;/span&gt; (bit &lt;span style="color:#666"&gt;|&lt;/span&gt; &lt;span style="color:#666"&gt;-&lt;/span&gt;bit) &lt;span style="color:#666"&gt;&amp;gt;&amp;gt;&lt;/span&gt; (&lt;span style="color:#007020;font-weight:bold"&gt;sizeof&lt;/span&gt;(&lt;span style="color:#902000"&gt;unsigned&lt;/span&gt;) &lt;span style="color:#666"&gt;*&lt;/span&gt; CHAR_BIT &lt;span style="color:#666"&gt;-&lt;/span&gt; &lt;span style="color:#40a070"&gt;1&lt;/span&gt;);
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt; 6&lt;/span&gt;&lt;span&gt; &lt;span style="color:#60a0b0;font-style:italic"&gt;/* -0 = 0, -1 = 0xff....ff */&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt; 7&lt;/span&gt;&lt;span&gt; &lt;span style="color:#902000"&gt;unsigned&lt;/span&gt; mask &lt;span style="color:#666"&gt;=&lt;/span&gt; &lt;span style="color:#666"&gt;-&lt;/span&gt;isnonzero;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt; 8&lt;/span&gt;&lt;span&gt; &lt;span style="color:#902000"&gt;unsigned&lt;/span&gt; ret &lt;span style="color:#666"&gt;=&lt;/span&gt; mask &lt;span style="color:#666"&gt;&amp;amp;&lt;/span&gt; (b&lt;span style="color:#666"&gt;^&lt;/span&gt;a);
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt; 9&lt;/span&gt;&lt;span&gt; ret &lt;span style="color:#666"&gt;=&lt;/span&gt; ret &lt;span style="color:#666"&gt;^&lt;/span&gt; b;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;10&lt;/span&gt;&lt;span&gt; &lt;span style="color:#007020;font-weight:bold"&gt;return&lt;/span&gt; ret;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;11&lt;/span&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;Only if bit is 0, the (bit | -bit) will result in MSB (isnonzero) equal to 0. In all other cases, MSB (isnonzero) is equal to 1.&lt;/li&gt;
&lt;li&gt;If mask is 0 we return b, else if mask is 1 we return a.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Avoid secret-dependent loop bounds
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://heartbleed.com/"&gt;https://heartbleed.com/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Clean memory of secret data
&lt;ul&gt;
&lt;li&gt;Unfortunately, there&amp;rsquo;s virtually no way to reliably clean secret data in garbage-collected languages (such as Go), nor in language with immutable strings.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/cronokirby/saferith"&gt;https://github.com/cronokirby/saferith&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;More links&lt;/p&gt;</description></item><item><title>Claude Code usage notes</title><link>https://atosh502.github.io/notes/claude-code/</link><pubDate>Fri, 03 Jan 2025 00:00:00 +0000</pubDate><guid>https://atosh502.github.io/notes/claude-code/</guid><description>&lt;p&gt;I had been meaning to looking into coding agents seriously for some time. Thanks to Claude Code gift pass from &lt;a href="https://x.com/npankaj365"&gt;@npankaj365&lt;/a&gt; and &lt;a href="https://x.com/karpathy/status/2004607146781278521?s=20"&gt;@karpathy&amp;rsquo;s post&lt;/a&gt;, I was finally able to do it.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;general&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;ask Claude to summarize a project, trace how events/requests are handled, code organization&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;editor&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;use backward slash (&lt;code&gt;\ + Enter&lt;/code&gt;) for multiline inputs&lt;/li&gt;
&lt;li&gt;use @ to tag files or folders&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;modes&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;shift + tab&lt;/code&gt; to enter &amp;ldquo;Plan Mode&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Thinking spectrum (from shallow to deep): &lt;code&gt;&amp;quot;Think&amp;quot;, &amp;quot;Think more&amp;quot;, &amp;quot;Think a lot&amp;quot;, &amp;quot;Think longer&amp;quot;, &amp;quot;Ultrathink&amp;quot;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;context &amp;amp; memory&lt;/p&gt;</description></item></channel></rss>