Mostly working, but not complete, port of openssl