Home
last modified time | relevance | path

Searched refs:hex (Results 1 - 25 of 63) sorted by relevance

123

/base/security/huks/test/unittest/huks_standard_test/crypto_engine_test/src/
H A Dhks_crypto_hal_common.cpp18 uint8_t HksCryptoHalCommon::HexChar(char hex) const in HexChar()
20 if (hex >= '0' && hex <= '9') { in HexChar()
21 return hex - '0'; in HexChar()
22 } else if (hex >= 'A' && hex <= 'F') { in HexChar()
23 return hex - 'A' + 0X0A; in HexChar()
24 } else if (hex >= 'a' && hex <= 'f') { in HexChar()
25 return hex in HexChar()
[all...]
/base/startup/hvb/libhvb/src/utils/
H A Dhvb_util.c21 char *hex; in hvb_bin2hex() local
24 hex = hvb_malloc(len * 2 + 1); in hvb_bin2hex()
25 if (hex == NULL) in hvb_bin2hex()
29 hex[n * 2] = digits[value[n] >> 4]; in hvb_bin2hex()
30 hex[n * 2 + 1] = digits[value[n] & 0x0f]; in hvb_bin2hex()
32 hex[n * 2] = '\0'; in hvb_bin2hex()
34 return hex; in hvb_bin2hex()
60 uint64_t hex; in hvb_be64toh() local
62 hex = ((uint64_t)value[0]) << 56; in hvb_be64toh()
63 hex | in hvb_be64toh()
[all...]
/base/security/device_security_level/baselib/utils/src/
H A Dutils_hexstring.c32 static char HexToChar(uint8_t hex) in HexToChar() argument
34 return (hex > 9) ? (hex + 0x37) : (hex + 0x30); /* check if bigger than 9, then add 0x37 or 0x30 */ in HexToChar()
37 void DslmByteToHexString(const uint8_t *hex, uint32_t hexLen, uint8_t *str, uint32_t strLen) in DslmByteToHexString() argument
39 if ((hex == NULL) || (str == NULL) || (strLen < hexLen * BYTE_TO_HEX_OPER_LENGTH)) { in DslmByteToHexString()
44 str[i * BYTE_TO_HEX_OPER_LENGTH] = HexToChar((hex[i] & 0xF0) >> 4); /* shift 4 right for filling */ in DslmByteToHexString()
45 str[i * BYTE_TO_HEX_OPER_LENGTH + 1] = HexToChar(hex[i] & 0x0F); /* get low four bits */ in DslmByteToHexString()
49 int32_t DslmHexStringToByte(const char *str, uint32_t strLen, uint8_t *hex, uint32_t hexLen) in DslmHexStringToByte() argument
51 if ((str == NULL) || (hex in DslmHexStringToByte()
[all...]
/base/security/device_auth/frameworks/deviceauth_lite/source/json/
H A Dcommonutil.c23 char hex_to_char(uint8_t hex) in hex_to_char() argument
25 /* Convert to the corresponding character, hex + 0x37 -> A-F, hex + 0x30 -> 0-9 */ in hex_to_char()
26 return (hex > 9) ? hex + 0x37 : hex + 0x30; in hex_to_char()
29 void byte_to_hex_string(const uint8_t *hex, int32_t hex_len, uint8_t *buf, int32_t buf_len) in byte_to_hex_string() argument
35 buf[i * BYTE_TO_HEX_OPER_LENGTH] = hex_to_char((hex[i] & 0xF0) >> 4); /* shift right for filling */ in byte_to_hex_string()
36 buf[i * BYTE_TO_HEX_OPER_LENGTH + 1] = hex_to_char(hex[i] & 0x0F); /* get low four bits */ in byte_to_hex_string()
40 int32_t hex_string_to_byte(const char *str, int32_t len, uint8_t *hex) in hex_string_to_byte() argument
85 byte_convert(json_pobject obj, const char *field, uint8_t *hex, uint32_t *length, uint32_t max_len) byte_convert() argument
[all...]
/base/security/device_auth/frameworks/deviceauth_lite/inc/json/
H A Dcommonutil.h24 int32_t hex_string_to_byte(const char *str, int32_t len, uint8_t *hex);
25 void byte_to_hex_string(const uint8_t *hex, int32_t hex_len, uint8_t *buf, int32_t buf_len);
29 int32_t byte_convert(json_pobject obj, const char *field, uint8_t *hex, uint32_t *length, uint32_t max_len);
/base/security/device_auth/frameworks/deviceauth_lite/test/unittest/
H A Dcommonutil_test.h27 int32_t hex_string_to_byte(const char *str, int32_t len, uint8_t *hex);
28 void byte_to_hex_string(const uint8_t *hex, int32_t hex_len, uint8_t *buf, int32_t buf_len);
32 int32_t byte_convert(json_pobject obj, const char *field, uint8_t *hex, uint32_t *length, uint32_t max_len);
/base/security/device_security_level/baselib/utils/include/
H A Dutils_hexstring.h25 void DslmByteToHexString(const uint8_t *hex, uint32_t hexLen, uint8_t *str, uint32_t strLen);
27 int32_t DslmHexStringToByte(const char *str, uint32_t strLen, uint8_t *hex, uint32_t hexLen);
/base/security/huks/test/unittest/huks_standard_test/crypto_engine_test/include/
H A Dhks_crypto_hal_common.h29 uint8_t HexChar(char hex) const;
30 uint8_t ReadHex(const uint8_t hex[2]) const;
/base/security/dlp_permission_service/frameworks/common/src/
H A Dhex_string.cpp26 static char HexToChar(uint8_t hex) in HexToChar() argument
28 return (hex > 9) ? (hex + 0x37) : (hex + 0x30); // numbers greater than 9 are represented by letters in hex. in HexToChar()
56 return (c - 'A' + 10); // hex trans to dec with base 10 in CharToHex()
59 return (c - 'a' + 10); // hex trans to dec with base 10 in CharToHex()
64 return MAX_HEX; // max hex must < 16 in CharToHex()
80 if (high == MAX_HEX || low == MAX_HEX) { // max hex must < 16 in HexStringToByte()
/base/hiviewdfx/faultloggerd/interfaces/innerkits/unwinder/include/
H A Ddfx_symbol.h118 ss << module_ << "+0x" << std::hex << fileVaddr_; in GetName()
120 ss << comm_ << "@0x" << std::hex << taskVaddr_; in GetName()
131 ss << "0x" << std::hex << fileVaddr_; in ToString()
133 ss << "0x" << std::hex << taskVaddr_; in ToString()
143 ss << std::hex << funcVaddr_; in ToDebugString()
/base/security/device_auth/services/identity_manager/src/
H A Didentity_common.c22 static void UpperToLowercase(Uint8Buff *hex) in UpperToLowercase() argument
24 for (uint32_t i = 0; i < hex->length; i++) { in UpperToLowercase()
25 if (hex->val[i] >= 'A' && hex->val[i] <= 'F') { in UpperToLowercase()
26 hex->val[i] += ASCII_CASE_DIFFERENCE_VALUE; in UpperToLowercase()
41 LOGE("Convert psk from byte to hex string failed!"); in ConvertPsk()
/base/telephony/sms_mms/frameworks/native/mms/src/utils/
H A Dmms_quoted_printable.cpp34 const char hex[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; in Encode() local
41 codeString += hex[((byte >> 0x04) & 0x0F)]; in Encode()
42 codeString += hex[(byte & 0x0F)]; in Encode()
/base/security/device_auth/common_lib/impl/src/
H A Dstring_util.c30 static char HexToChar(uint8_t hex) in HexToChar() argument
32 return (hex > NUMBER_9_IN_DECIMAL) ? (hex + 0x37) : (hex + 0x30); /* Convert to the corresponding character */ in HexToChar()
/base/notification/distributed_notification_service/services/ans/src/common/
H A Daes_gcm_helper.cpp49 oss << std::hex << std::setw(WIDTH_PER_BYTE) << std::setfill('0') << static_cast<int>(byte); in Byte2Hex()
63 ANS_LOGE("Invalid hex char: %{public}c.", hexCh); in HexChar2Byte()
68 std::string AesGcmHelper::Hex2Byte(const std::string &hex) in Hex2Byte() argument
70 if (hex.length() % STEP != 0) { in Hex2Byte()
71 ANS_LOGE("Length of hex is not even."); in Hex2Byte()
75 for (int i = 0; i < static_cast<int>(hex.length()); i += STEP) { in Hex2Byte()
76 unsigned char high = HexChar2Byte(hex[i]); in Hex2Byte()
77 unsigned char low = HexChar2Byte(hex[i + 1]); in Hex2Byte()
/base/security/device_auth/frameworks/deviceauth_lite/inc/struct/
H A Dkey_agreement_version.h30 uint8_t *raw_byte_to_hex_string(const uint8_t *hex, int32_t length);
/base/update/updater/services/ptable_parse/
H A Dptable.cpp164 LOG(ERROR) << "seekp 0x" << std::hex << offset << " bytes in " << filePath << in MemReadWithOffset()
165 " failed. Now is in 0x" << std::hex << fin.tellg() << std::dec; in MemReadWithOffset()
171 LOG(ERROR) << "read 0x" << std::hex << dataSize << " bytes in " << filePath << in MemReadWithOffset()
172 " failed. only read 0x" << std::hex << fin.gcount() << std::dec; in MemReadWithOffset()
260 LOG(INFO) << "the " << i << " main GPT's type=0x" << std::hex << type << std::dec; in CheckProtectiveMbr()
276 LOG(ERROR) << "invaild partiton with gptMagic:0x" << std::hex << gptMagic << std::dec; in CheckIfValidGpt()
303 LOG(INFO) << "lun capacity = 0x" << std::hex << capacity << std::dec; in GetCapacity()
368 LOG(ERROR) << "Header crc mismatch crcVal = " << std::hex << crcVal << " with orgCrcVal = " << in CheckGptHeader()
432 LOG(ERROR) << "partition entires crc mismatch crcVal =" << std::hex << crcVal << " with orgCrcVal =" << in PartitionCheckGptHeader()
451 ", startAddr=0x" << std::hex << partitionInfo in PrintPtableInfo()
[all...]
/base/security/device_auth/frameworks/deviceauth_lite/source/struct/
H A Dkey_agreement_version.c86 uint8_t *raw_byte_to_hex_string(const uint8_t *hex, int32_t length) in raw_byte_to_hex_string() argument
94 byte_to_hex_string(hex, length, tmp_cha_data_hex, length * BYTE_TO_HEX_OPER_LENGTH); in raw_byte_to_hex_string()
/base/tee/tee_client/services/cadaemon/src/tui_daemon/
H A Dtui_event.cpp97 uint8_t hex = 0; in Ascii2Digit() local
100 hex = a - '0'; in Ascii2Digit()
102 hex = (a - 'a') + ASCII_DIGIT_GAP; in Ascii2Digit()
104 hex = (a - 'A') + ASCII_DIGIT_GAP; in Ascii2Digit()
107 return hex; in Ascii2Digit()
/base/security/certificate_manager/frameworks/cert_manager_standard/main/common/src/
H A Dcm_x509.c73 char *hex = BN_bn2hex(bn); in GetX509SerialNumber() local
74 if (hex == NULL) { in GetX509SerialNumber()
79 uint32_t len = (uint32_t)strlen(hex); in GetX509SerialNumber()
81 OPENSSL_free(hex); in GetX509SerialNumber()
85 if (strncpy_s(outBuf, outBufMaxSize, hex, len) != EOK) { in GetX509SerialNumber()
86 OPENSSL_free(hex); in GetX509SerialNumber()
91 OPENSSL_free(hex); in GetX509SerialNumber()
/base/security/device_security_level/test/dslm_unit_test/
H A Ddslm_baselib_utils_test.cpp618 const uint8_t hex[] = {0x1, 0xF, 0xE, 0x8, 0xA}; in HWTEST_F() local
619 uint32_t hexLen = sizeof(hex); in HWTEST_F()
626 DslmByteToHexString(hex, hexLen, nullptr, 0); in HWTEST_F()
629 DslmByteToHexString(hex, hexLen, str, strLen - 1); in HWTEST_F()
643 uint8_t hex[5] = {0}; in HWTEST_F() local
647 int32_t ret = DslmHexStringToByte(nullptr, 0, hex, hexLen); in HWTEST_F()
659 int32_t ret = DslmHexStringToByte(str, strLen, hex, hexLen - 2); in HWTEST_F()
/base/telephony/core_service/utils/common/src/
H A Dtel_aes_crypto_util.cpp341 bool TelAesCryptoUtils::HexToDec(char hex, uint8_t &decodeValue) in HexToDec() argument
343 if (hex >= '0' && hex <= '9') { in HexToDec()
344 decodeValue = static_cast<uint8_t>(hex - '0'); in HexToDec()
347 if (hex >= 'a' && hex <= 'f') { in HexToDec()
348 decodeValue = static_cast<uint8_t>(hex - 'a' + DEC_OFFSET); in HexToDec()
/base/notification/distributed_notification_service/services/ans/include/
H A Daes_gcm_helper.h35 static std::string Hex2Byte(const std::string &hex);
/base/useriam/face_auth/common/utils/
H A Diam_para2str.h32 ss << "0xXXXX" << std::setfill('0') << std::setw(MASK_WIDTH) << std::hex << val; in GetMaskedString()
/base/useriam/pin_auth/common/utils/
H A Diam_para2str.h32 ss << "0xXXXX" << std::setfill('0') << std::setw(MASK_WIDTH) << std::hex << val; in GetMaskedString()
/base/useriam/fingerprint_auth/common/utils/
H A Diam_para2str.h32 ss << "0xXXXX" << std::setfill('0') << std::setw(MASK_WIDTH) << std::hex << val; in GetMaskedString()

Completed in 11 milliseconds

123