Updated to use fewer APDUs when signing/decrypting