Skip to content

Instantly share code, notes, and snippets.

@lunalunaa
lunalunaa / client.py
Created July 23, 2023 00:44
Google CTF 2023 mytls
# Google CTF 2023
# mytls challenge: https://capturetheflag.withgoogle.com/challenges/crypto-mytls
import binascii
from cryptography import x509
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives import hmac
from cryptography.hazmat.primitives.asymmetric import ec
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
@lunalunaa
lunalunaa / UnivPoly.hs
Created July 7, 2021 04:51 — forked from atennapel/UnivPoly.hs
Universe Polymorphism
-- universe polymorphism
module UnivPoly where
-- core language
type Ix = Int
data Term
= Var Ix
| Abs Term
| App Term Term
@lunalunaa
lunalunaa / SLTC.hs
Created December 29, 2020 20:52
Simply Typed Lambda Calculus
{-# LANGUAGE LambdaCase #-}
import Data.Maybe
data Ty
= Base
| TyArr Ty Ty
deriving (Show, Eq)
data Term
= TmVar Integer
@lunalunaa
lunalunaa / json-parser.hs
Last active December 29, 2020 20:20
a json parser written from scratch
{-# LANGUAGE LambdaCase #-}
module MonoJSonParser where
import Data.Char
import Control.Monad
import Control.Applicative
import Data.Foldable
import Data.Maybe
data Term
= TmVar Integer
| TmAbs String Term
| TmApp Term Term
deriving (Show, Eq)
termShift :: Integer -> Term -> Term
termShift d = walk 0
where
walk :: Integer -> Term -> Term
data Term
= TmVar Integer
| TmAbs String Term
| TmApp Term Term
deriving (Show, Eq)
termShift :: Integer -> Term -> Term
termShift d = walk 0
where
walk :: Integer -> Term -> Term
@lunalunaa
lunalunaa / coq_filter.v
Created March 25, 2018 12:25 — forked from y-taka-23/coq_filter.v
Validation of the filter Function (via "Software Foundations" http://www.cis.upenn.edu/~bcpierce/sf/Logic.html)
(******************************************************)
(** //// Validation of the "filter" Function //// *)
(******************************************************)
Require Import List Bool Lt.
Section Filter.
(*////////////////////////////////////////////////////*)
@lunalunaa
lunalunaa / keybase.md
Created October 2, 2017 07:31
proof of github

Keybase proof

I hereby claim:

  • I am weitaoxin on github.
  • I am triplethink (https://keybase.io/triplethink) on keybase.
  • I have a public key ASDY5LYhbea8RwT4HrbmG6DCKsKb8XmE_JKGJC0A1X9lcQo

To claim this, I am signing this object: