port tools from my old picl-spec-crypto repo