changed the format of the hmac key
many bugfixes after testing with real hardware