A functionally pure crypto library