Like the simple hashes, these work the same regardless of if the backend is OpenSSL or mbedTLS. Also move into ./lib/tls/ and split into two specific to mbedtls or openssl backends.