These implementations are for demonstration purposes. They are less efficient than the implementations in the Python standard library.
This page lists "coding rules" for implementations of cryptographic operations, and more generally for operations involving secret or sensitive values. The rules on this page are general ...