Implement basic TLS functions