fix error ifs, || vs &&
refactor and break out macing into it's own function

also save away the derived keys for later use
update iv after mac
correct apdu for list
Merge branch 'master' of github.com:Yubico/libykneomgr
drop GNU_SOURCE define