Loup Vaillant

loup-vaillant.fr · Personal blog · on HN since 2009

Loup Vaillant writes about cryptography, programming language design, parsing, and software design, and is the author of Monocypher.

What HN saysCommenters praise the Monocypher manual and link his Earley parsing tutorial; one is wary of his "Rolling your own crypto" stance.
53HN people shared it
22linked it in comments
73stories submitted
2.3Kstory points
6 months agolast shared
2009people per year2026

Most-shared posts

  1. 1
    The Repeated Deaths of OOP (2015)
    7 people · 154 points · first shared 2015 · 212 comments on HN
  2. 2
    Rolling Your Own Crypto
    6 people · 192 points · first shared 2016 · 150 comments on HN
  3. 3
    The Source of Readability
    6 people · 5 points · first shared 2023 · discussion on HN
  4. 4
    The design of Poly1305
    4 people · 11 points · first shared 2017 · discussion on HN
  5. 5
    A Solid Load of Bull
    4 people · 7 points · first shared 2025 · discussion on HN
  6. 6
    Cryptography is not magic
    3 people · 150 points · first shared 2020 · 69 comments on HN
  7. 7
    How Class-based Programming Sucks (2011)
    3 people · 144 points · first shared 2011 · 139 comments on HN
  8. 8
    Earley Parsing Explained
    3 people · 53 points · first shared 2015 · 15 comments on HN
  9. 9
  10. 10
  11. 11
    How I implemented my own crypto
    2 people · 380 points · first shared 2017 · 386 comments on HN
  12. 12
    The design of Chacha20
    2 people · 260 points · first shared 2017 · 70 comments on HN
  13. 13
    How to Avoid the Assignment Statement (2010)
    2 people · 106 points · first shared 2010 · 101 comments on HN
  14. 14
    Fast Multiplication with Slow Additions
    2 people · 85 points · first shared 2018 · 9 comments on HN
  15. 15
    Lua metacompiler
    2 people · 71 points · first shared 2014 · 6 comments on HN

What HN people wrote when they linked it

loup-vaillant · 2026-05-11
> TPMs are great. TPMs are a fucking mess. TPM 2 at least, I’ve worked with it for a few months. I love me some hardware security module, but I want to control it. And if it must be a standard, please please to something like the TKey, so it can be both much simpler than current ad-hoc standards and future proof. https://loup-vaillant.fr/articles/hsm-done-right
Mawr · 2023-09-05
Writing is very similar to programming indeed: "There is however a way to cheat our way into getting it right the first time: instead of designing a (piece of) program once, we can design it two or three times over, compare, and keep the best approach. Nobody has to know about our embarrassing failures. This takes time and effort, but I believe all significant projects deserve it. That said, I understand why in practice most of the code I see is just a rushed first draft: stopping as soon as it “works” is just too damn tempting." [1] [1]: https://loup-vaillant.fr/articles/source-of-readability
billconan · 2021-08-21
in my implementation, I give each rule a priority. I always choose the one with the highest priority to expand. I basically followed this https://loup-vaillant.fr/tutorials/earley-parsing/parser
FabHK · 2017-02-13
I'm torn about this. Brought to you by the person that wrote "Rolling your own crypto" (see earlier discussion linked below), with the motto "Impossible? Like that would stop me." Some fields of knowledge in certain phases benefit from iconoclasm and Sturm & Drang, but is cryptography one of them? On the other hand, many existing implementations are so crufty that a fresh wind might help (if only by pushing more experienced cryptographers to put out better implementations). At any rate, at least the writer followed through, though I'd not be inclined to use this in production anytime soon. http://loup-vaillant.fr/articles/rolling-your-own-crypto https://news.ycombinator.com/item?id=13221923
jedahan · 2017-02-13
The manual is absolutely amazing. It shows proper and improper use, and explains how and why to the lay person. http://loup-vaillant.fr/projects/monocypher/manual Example from crypto_chacha20_init (grammar aside): "Warning: don't use the same nonce and key twice. You'd expose the XOR of subsequent encrypted messages, and destroying confidentiality."
jean- · 2017-01-10
If you enjoyed the style of this article, I would also recommend you have a look at the brilliant explanation of Earley parsing by the same author: http://loup-vaillant.fr/tutorials/earley-parsing/
AaronFriel · 2015-06-29
Tries ain't easy. It's no surprise that a naive trie is bested by a naive hashtable, especially where the number of entries is dwarfed by the capacity of the hashtable. The gold standard for a trie is probably the Judy array[1], which I've heard has some patents on it, but I can't confirm. Judy arrays obtain their performance by using a myriad range of possible leaf and branch nodes. The goal is to fit as much data that could be used for decision making and branching in the first cache line that would be read. And in the case of very sparse tries this pays off handsomely. That said, hash tables are really hard to beat. They are susceptible to denial of service attacks though. [1] http://judy.sourceforge.net/application/shop_interm.pdf [2] http://loup-vaillant.fr/projects/string-interning/intern_trie.c
palisade · 2017-10-12
The common advice of, "You'll never know enough to use them safely so don't bother trying, just trust us." that has been going around has been proven itself to weaken encryption. Just recently, an amateur programmer with very little background in cryptography discovered a flaw in libsodium in the Argon2 implementation and also in the reference implementation that everyone in the world was trusting without question. My advice is if you're an engineer, don't be afraid to write your own implementation of tried and trusted ciphers. This is how we find bugs and improve. This isn't the only trusted library or algorithm that has been shown flawed in recent times. The strength of your cipher implementation can be tested and proven. We need to stop telling everyone these algorithms are absolutely trustworthy so don't try understanding them or implementing them. Nothing ever advances or improves that way. Buck the trends, create competing libraries, try new things. The ancient ones were not all knowing, they were doing everything wrong. Their designs are full of flaws. Deny them. We need to code ourselves out of the coming cryptographic apocalypse. Do not hide your heads in the sand and hope the world doesn't come crashing down around you. Edit: I found the blog/website of the man I mentioned in this comment who discovered the Argon2 flaw. http://loup-vaillant.fr/articles/implemented-my-own-crypto In his own words, "There's something worrying about this bug: I was the first to…
lilei2 · 2017-05-19
What you're describing is how net neutrality works, not how the Internet works. > First, bandwidth is limited. It's whatever download and upload you sign for. I said that I don't encourage bandwidth limits, not that it wasn't limited. The point is you usually sign a flat fee, you don't have universal access and then pay for traffic, more like in a country like Andorra. > Second, there is no such thin as "full speed access to Netflix" or whatever. It's limited by your own bandwidth at least. It's only limited because the ISP has limited it, it's entirely possible to give someone with a slower overall internet connection a higher speed to certain services. > They don't have to update their infrastructure every time a new web site comes up. As such, access to Netflix, Youtube, or http://loup-vaillant.fr are not separate services. I don't see you point. ISP do peer directly with services, but I never said they had to. You just have to have a separate exchange for full speed services. > ISPs that treat access to particular web sites as separate services are just plain lying. The real "separate service", for which they actually spend money, is the throttling/filtering/censoring infrastructure they have to put in place to charge different web sites differently. Text book malicious features, not unlike DRM. I don't agree with throttling, but "throttling" (or congestion) does occur naturally on the Internet. I think you really don't get my point, so I'll try and explain in…
niftich · 2017-02-13
This project seems to be the culmination of a rhetorial question that the author posed a while ago: if the advice is 'don't roll your own crypto' [1], then how does any crypto ever come into being? [2] So perhaps the marketing is off: I don't view this as a "small, secure, auditable, easy to use crypto library"; I view this as a practical and ongoing study in investigating how to make small, secure, auditable, easy-to-use crypto libraries. To be fair, the page mentions that it's "not ready for production" and needing external review a quarter of the way down, but if the point is to prove that a sufficiently dedicated individual can learn the material, endure some criticism, and produce quality software following the example of well-acclaimed experts, then own this point, bare your disclaimers in the beginning, and make it more prominent. And once you phrase it that way -- which is arguably consistent with the author's previous posts (and HN comments) on the topic, it's suddenly a lot more palatable, and regardless of its ultimate outcome, I can only applaud. [1] I use an interpretation of "don't roll your own crypto" that's slightly less circular than the author's. In my opinion, it's shorthand for 'defer to the opinion of experts, use ready-made constructs when possible, and if not, then exercise caution when hooking crypto primitives together in unproven ways'. Originally posted here: [3] [2] http://loup-vaillant.fr/articles/rolling-your-own-crypto [3]…
bmn_ · 2014-12-22
LR parsers like yacc are obsoleted by Earley parsers, which Cox apparently didn't know about in 2010. Quoting <http://loup-vaillant.fr/tutorials/earley-parsing/what-and-why#Why>: The biggest advantage of Earley Parsing is its accessibility. Most other tools such as parser generators, parsing expression grammars, or combinator libraries feature restrictions that often make them hard to use. Use the wrong kind of grammar, and your PEG will enter an infinite loop. Use another wrong kind of grammar, and most parser generators will fail. To a beginner, these restrictions feel most arbitrary: it looks like it should work, but it doesn't. There are workarounds of course, but they make these tools more complex. Earley parsing Just Works™. On the flip side, to get this generality we must sacrifice some speed. Earley parsing cannot compete with speed demons such as Flex/Bison in terms of raw speed. It's not that bad, however: • Earley parsing is cubic in the worst cases, which is the state of the art (and possibly the best we can do). The speed demons often don't work at all for those worst cases. Other parsers are prone to exponential combinatorial explosion. • Most simple grammars can be parsed in linear time. • Even the worst unambiguous grammars can be parsed in quadratic time. My advice would be to use Earley parsing by default, and only revert to more specific methods…
walterbell · 2024-05-22
A couple of metacompiler experiments with Lua and Haskell, https://loup-vaillant.fr/projects/metacompilers/
jghn · 2023-07-10
Depends on how you view OOP. For instance "The Repeated Deaths of OOP" (2015) [1] notes how the definition of OOP has been morphing over time to match current realities. [1] https://loup-vaillant.fr/articles/deaths-of-oop
ghoward · 2022-06-22
Not GP, but a wannabe level 3 [1] cryptographer. Why does TLS make you twitch? Does that apply to TLS 1.3? [1]: https://loup-vaillant.fr/articles/rolling-your-own-crypto
bmn__ · 2020-03-29
Much more complete discussion of the problem, with strategy variants and code: http://loup-vaillant.fr/tutorials/monty-hall Author is also a HNer: https://news.ycombinator.com/user?id=loup-vaillant
bitshift955 · 2017-09-05
Very glad to see "Falsehoods Programmers Believe About Names" included in this list [1]. I still struggle to always get this right. One thing I'd suggest including is something about not rolling your own crypto in the security section. Does anyone know a canonical article for this? I've got [2] bookmarked but not sure if a guide with the pitfalls of designing your own crypto scheme is right for this list. [1] http://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-abo… [2] http://loup-vaillant.fr/articles/rolling-your-own-crypto
kazinator · 2015-09-16
Unfortunately, there is a catch: http://loup-vaillant.fr/tutorials/earley-parsing/parser Once you have a successful parse, extracting the tree from it is a little bit like pulling teeth. You have to perform searches on the Early set data, and deal with ambiguities at that point. None of the mainstream method have any major difficulty with popping out abstract syntax trees in a straightforward syntax-directed manner.
dalke · 2015-02-10
Link should go to http://loup-vaillant.fr/articles/deaths-of-oop not http://loup-vaillant.fr/articles/deaths-of-oop/ . The trailing '/' gives a 404 Not Found. Edit: Also, "Test Driven Development for instance, was invented by users of these dynamic languages. Most probably to compensate the weaknesses of dynamic type systems, by the way" isn't true. TDD in its current incarnation started out of the xUnit framework for Smalltalk, and not 'Python, Ruby, JavaScript .. and JavaScript'.
capisce · 2013-04-20
"Developer" ultrabook but still with an uncomfortable left slanted keyboard layout. When will we see a programmer friendly laptop with a symmetric keyboard layout like the TypeMatrix or TECK? There is no redeeming quality to the left slanted keyboard layout unless you are making typewriters in the 19th century: http://loup-vaillant.fr/articles/better-keyboards
nyanpasu64 · 2023-09-15
I agree that placing sequentially executed code in order of execution often improves readability over abstracted code (especially dynamic dispatch and static/dynamic traits). A similar article is at http://number-none.com/blow/john_carmack_on_inlined_code.html, but linear code has its own failure modes, if code is not factored into blocks with identifiable functionality and constrained/documented side effects (for example 500-line functions twiddling hardware registers and reading/writing global variables). Carmack later wrote an article in support of small-f functional programming and avoiding side effects and global state when practical (https://web.archive.org/web/20190123060017/http://gamasutra.com/view/n… the article lost all line breaks during migration to gamedeveloper.com) Another article that touches on this idea (among others) is https://loup-vaillant.fr/articles/source-of-readability which advocates that "code that is read together should be written together" (reading it made me confused until I realized it meant "placed together"), specifically "Consider inlining functions that are used only once".

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close