require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_FIDO_PARAM_H)) {
    eval 'sub _FIDO_PARAM_H () {1;}' unless defined(&_FIDO_PARAM_H);
    eval 'sub CTAP_AUTHDATA_USER_PRESENT () {0x1;}' unless defined(&CTAP_AUTHDATA_USER_PRESENT);
    eval 'sub CTAP_AUTHDATA_USER_VERIFIED () {0x4;}' unless defined(&CTAP_AUTHDATA_USER_VERIFIED);
    eval 'sub CTAP_AUTHDATA_ATT_CRED () {0x40;}' unless defined(&CTAP_AUTHDATA_ATT_CRED);
    eval 'sub CTAP_AUTHDATA_EXT_DATA () {0x80;}' unless defined(&CTAP_AUTHDATA_EXT_DATA);
    eval 'sub CTAP_CMD_PING () {0x1;}' unless defined(&CTAP_CMD_PING);
    eval 'sub CTAP_CMD_MSG () {0x3;}' unless defined(&CTAP_CMD_MSG);
    eval 'sub CTAP_CMD_LOCK () {0x4;}' unless defined(&CTAP_CMD_LOCK);
    eval 'sub CTAP_CMD_INIT () {0x6;}' unless defined(&CTAP_CMD_INIT);
    eval 'sub CTAP_CMD_WINK () {0x8;}' unless defined(&CTAP_CMD_WINK);
    eval 'sub CTAP_CMD_CBOR () {0x10;}' unless defined(&CTAP_CMD_CBOR);
    eval 'sub CTAP_CMD_CANCEL () {0x11;}' unless defined(&CTAP_CMD_CANCEL);
    eval 'sub CTAP_KEEPALIVE () {0x3b;}' unless defined(&CTAP_KEEPALIVE);
    eval 'sub CTAP_FRAME_INIT () {0x80;}' unless defined(&CTAP_FRAME_INIT);
    eval 'sub CTAP_CBOR_MAKECRED () {0x1;}' unless defined(&CTAP_CBOR_MAKECRED);
    eval 'sub CTAP_CBOR_ASSERT () {0x2;}' unless defined(&CTAP_CBOR_ASSERT);
    eval 'sub CTAP_CBOR_GETINFO () {0x4;}' unless defined(&CTAP_CBOR_GETINFO);
    eval 'sub CTAP_CBOR_CLIENT_PIN () {0x6;}' unless defined(&CTAP_CBOR_CLIENT_PIN);
    eval 'sub CTAP_CBOR_RESET () {0x7;}' unless defined(&CTAP_CBOR_RESET);
    eval 'sub CTAP_CBOR_NEXT_ASSERT () {0x8;}' unless defined(&CTAP_CBOR_NEXT_ASSERT);
    eval 'sub CTAP_CBOR_LARGEBLOB () {0xc;}' unless defined(&CTAP_CBOR_LARGEBLOB);
    eval 'sub CTAP_CBOR_CONFIG () {0xd;}' unless defined(&CTAP_CBOR_CONFIG);
    eval 'sub CTAP_CBOR_BIO_ENROLL_PRE () {0x40;}' unless defined(&CTAP_CBOR_BIO_ENROLL_PRE);
    eval 'sub CTAP_CBOR_CRED_MGMT_PRE () {0x41;}' unless defined(&CTAP_CBOR_CRED_MGMT_PRE);
    eval 'sub CTAP_PIN_PROTOCOL1 () {1;}' unless defined(&CTAP_PIN_PROTOCOL1);
    eval 'sub CTAP_PIN_PROTOCOL2 () {2;}' unless defined(&CTAP_PIN_PROTOCOL2);
    eval 'sub U2F_CMD_REGISTER () {0x1;}' unless defined(&U2F_CMD_REGISTER);
    eval 'sub U2F_CMD_AUTH () {0x2;}' unless defined(&U2F_CMD_AUTH);
    eval 'sub U2F_AUTH_SIGN () {0x3;}' unless defined(&U2F_AUTH_SIGN);
    eval 'sub U2F_AUTH_CHECK () {0x7;}' unless defined(&U2F_AUTH_CHECK);
    eval 'sub SW1_MORE_DATA () {0x61;}' unless defined(&SW1_MORE_DATA);
    eval 'sub SW_CONDITIONS_NOT_SATISFIED () {0x6985;}' unless defined(&SW_CONDITIONS_NOT_SATISFIED);
    eval 'sub SW_WRONG_DATA () {0x6a80;}' unless defined(&SW_WRONG_DATA);
    eval 'sub SW_NO_ERROR () {0x9000;}' unless defined(&SW_NO_ERROR);
    eval 'sub CTAP_CID_BROADCAST () {0xffffffff;}' unless defined(&CTAP_CID_BROADCAST);
    eval 'sub CTAP_INIT_HEADER_LEN () {7;}' unless defined(&CTAP_INIT_HEADER_LEN);
    eval 'sub CTAP_CONT_HEADER_LEN () {5;}' unless defined(&CTAP_CONT_HEADER_LEN);
    eval 'sub CTAP_MAX_REPORT_LEN () {64;}' unless defined(&CTAP_MAX_REPORT_LEN);
    eval 'sub CTAP_MIN_REPORT_LEN () {( &CTAP_INIT_HEADER_LEN + 1);}' unless defined(&CTAP_MIN_REPORT_LEN);
    unless(defined(&FIDO_RANDOM_DEV)) {
	eval 'sub FIDO_RANDOM_DEV () {"/dev/urandom";}' unless defined(&FIDO_RANDOM_DEV);
    }
    unless(defined(&FIDO_MAXMSG)) {
	eval 'sub FIDO_MAXMSG () {2048;}' unless defined(&FIDO_MAXMSG);
    }
    eval 'sub FIDO_CAP_WINK () {0x1;}' unless defined(&FIDO_CAP_WINK);
    eval 'sub FIDO_CAP_CBOR () {0x4;}' unless defined(&FIDO_CAP_CBOR);
    eval 'sub FIDO_CAP_NMSG () {0x8;}' unless defined(&FIDO_CAP_NMSG);
    eval 'sub COSE_UNSPEC () {0;}' unless defined(&COSE_UNSPEC);
    eval 'sub COSE_ES256 () {-7;}' unless defined(&COSE_ES256);
    eval 'sub COSE_EDDSA () {-8;}' unless defined(&COSE_EDDSA);
    eval 'sub COSE_ECDH_ES256 () {-25;}' unless defined(&COSE_ECDH_ES256);
    eval 'sub COSE_ES384 () {-35;}' unless defined(&COSE_ES384);
    eval 'sub COSE_RS256 () {-257;}' unless defined(&COSE_RS256);
    eval 'sub COSE_RS1 () {-65535;}' unless defined(&COSE_RS1);
    eval 'sub COSE_KTY_OKP () {1;}' unless defined(&COSE_KTY_OKP);
    eval 'sub COSE_KTY_EC2 () {2;}' unless defined(&COSE_KTY_EC2);
    eval 'sub COSE_KTY_RSA () {3;}' unless defined(&COSE_KTY_RSA);
    eval 'sub COSE_P256 () {1;}' unless defined(&COSE_P256);
    eval 'sub COSE_P384 () {2;}' unless defined(&COSE_P384);
    eval 'sub COSE_ED25519 () {6;}' unless defined(&COSE_ED25519);
    eval 'sub FIDO_EXT_HMAC_SECRET () {0x1;}' unless defined(&FIDO_EXT_HMAC_SECRET);
    eval 'sub FIDO_EXT_CRED_PROTECT () {0x2;}' unless defined(&FIDO_EXT_CRED_PROTECT);
    eval 'sub FIDO_EXT_LARGEBLOB_KEY () {0x4;}' unless defined(&FIDO_EXT_LARGEBLOB_KEY);
    eval 'sub FIDO_EXT_CRED_BLOB () {0x8;}' unless defined(&FIDO_EXT_CRED_BLOB);
    eval 'sub FIDO_EXT_MINPINLEN () {0x10;}' unless defined(&FIDO_EXT_MINPINLEN);
    eval 'sub FIDO_CRED_PROT_UV_OPTIONAL () {0x1;}' unless defined(&FIDO_CRED_PROT_UV_OPTIONAL);
    eval 'sub FIDO_CRED_PROT_UV_OPTIONAL_WITH_ID () {0x2;}' unless defined(&FIDO_CRED_PROT_UV_OPTIONAL_WITH_ID);
    eval 'sub FIDO_CRED_PROT_UV_REQUIRED () {0x3;}' unless defined(&FIDO_CRED_PROT_UV_REQUIRED);
    if(defined(&_FIDO_INTERNAL)) {
	eval 'sub FIDO_EXT_ASSERT_MASK () {( &FIDO_EXT_HMAC_SECRET| &FIDO_EXT_LARGEBLOB_KEY|  &FIDO_EXT_CRED_BLOB);}' unless defined(&FIDO_EXT_ASSERT_MASK);
	eval 'sub FIDO_EXT_CRED_MASK () {( &FIDO_EXT_HMAC_SECRET| &FIDO_EXT_CRED_PROTECT|  &FIDO_EXT_LARGEBLOB_KEY| &FIDO_EXT_CRED_BLOB|  &FIDO_EXT_MINPINLEN);}' unless defined(&FIDO_EXT_CRED_MASK);
    }
    eval 'sub FIDO_UV_MODE_TUP () {0x1;}' unless defined(&FIDO_UV_MODE_TUP);
    eval 'sub FIDO_UV_MODE_FP () {0x2;}' unless defined(&FIDO_UV_MODE_FP);
    eval 'sub FIDO_UV_MODE_PIN () {0x4;}' unless defined(&FIDO_UV_MODE_PIN);
    eval 'sub FIDO_UV_MODE_VOICE () {0x8;}' unless defined(&FIDO_UV_MODE_VOICE);
    eval 'sub FIDO_UV_MODE_FACE () {0x10;}' unless defined(&FIDO_UV_MODE_FACE);
    eval 'sub FIDO_UV_MODE_LOCATION () {0x20;}' unless defined(&FIDO_UV_MODE_LOCATION);
    eval 'sub FIDO_UV_MODE_EYE () {0x40;}' unless defined(&FIDO_UV_MODE_EYE);
    eval 'sub FIDO_UV_MODE_DRAWN () {0x80;}' unless defined(&FIDO_UV_MODE_DRAWN);
    eval 'sub FIDO_UV_MODE_HAND () {0x100;}' unless defined(&FIDO_UV_MODE_HAND);
    eval 'sub FIDO_UV_MODE_NONE () {0x200;}' unless defined(&FIDO_UV_MODE_NONE);
    eval 'sub FIDO_UV_MODE_ALL () {0x400;}' unless defined(&FIDO_UV_MODE_ALL);
    eval 'sub FIDO_UV_MODE_EXT_PIN () {0x800;}' unless defined(&FIDO_UV_MODE_EXT_PIN);
    eval 'sub FIDO_UV_MODE_EXT_DRAWN () {0x1000;}' unless defined(&FIDO_UV_MODE_EXT_DRAWN);
}
1;
