Skip to content

Instantly share code, notes, and snippets.

View dannywillems's full-sized avatar
💭
Why a status? I never look at this... Didn't know it did exist.

Danny Willems dannywillems

💭
Why a status? I never look at this... Didn't know it did exist.
View GitHub Profile
@dannywillems
dannywillems / gist:2100dd41be3058b93ecdd858933ae4a1
Created June 29, 2023 13:17
WasmVector<WasmFlatVector<WasmFp>> error when building a constructor
// This should mimic LookupTable structure
#[wasm_bindgen]
pub struct WasmPastaFpLookupTable {
#[wasm_bindgen(skip)]
pub id: i32,
#[wasm_bindgen(skip)]
pub data: WasmVector<WasmFlatVector<WasmPastaFp>>,
}
// Converter from WasmPastaFpLookupTable to LookupTable, used by the binding
`gpg --version`
`gpg --expert --full-gen-key` -> to have ECC option (see https://twitter.com/dwillems42/status/1584107888540553216?s=20&t=mjqKYjAz6C9X7GMnjObqaQ)
`gpg --export -a "u@domain.com" > public.key` -> export public key
@dannywillems
dannywillems / .ml
Created April 23, 2021 12:15
Print bits le in OCaml
let print_bits_le b =
assert (b >= 0 && b <= 255) ;
let rec get_bits_le x acc i =
if i = 8 then acc
else
let acc = (x mod 2) :: acc in
get_bits_le (x lsr 1) acc (i + 1)
in
let bits_le = List.rev (get_bits_le b [] 0) in
List.iter print_int bits_le ;