Fixed metadata creation.

Fixed creation of metadata with hmac 0x14.
Added ECDSA support and signature checks.
Improved hmac/cmac hash compare functions.