Removed 4 bytes from hsm structure by removing the cookie. Inheritance is now required to pass user data to the enter() and leave() functions.