/base/security/huks/test/unittest/huks_standard_test/crypto_engine_test/src/ |
H A D | hks_crypto_hal_common.cpp | 18 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 D | hvb_util.c | 21 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 D | utils_hexstring.c | 32 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 D | commonutil.c | 23 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 D | commonutil.h | 24 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 D | commonutil_test.h | 27 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 D | utils_hexstring.h | 25 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 D | hks_crypto_hal_common.h | 29 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 D | hex_string.cpp | 26 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 D | dfx_symbol.h | 118 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 D | identity_common.c | 22 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 D | mms_quoted_printable.cpp | 34 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 D | string_util.c | 30 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 D | aes_gcm_helper.cpp | 49 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 D | key_agreement_version.h | 30 uint8_t *raw_byte_to_hex_string(const uint8_t *hex, int32_t length);
|
/base/update/updater/services/ptable_parse/ |
H A D | ptable.cpp | 164 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 D | key_agreement_version.c | 86 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 D | tui_event.cpp | 97 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 D | cm_x509.c | 73 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 D | dslm_baselib_utils_test.cpp | 618 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 D | tel_aes_crypto_util.cpp | 341 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 D | aes_gcm_helper.h | 35 static std::string Hex2Byte(const std::string &hex);
|
/base/useriam/face_auth/common/utils/ |
H A D | iam_para2str.h | 32 ss << "0xXXXX" << std::setfill('0') << std::setw(MASK_WIDTH) << std::hex << val; in GetMaskedString()
|
/base/useriam/pin_auth/common/utils/ |
H A D | iam_para2str.h | 32 ss << "0xXXXX" << std::setfill('0') << std::setw(MASK_WIDTH) << std::hex << val;
in GetMaskedString()
|
/base/useriam/fingerprint_auth/common/utils/ |
H A D | iam_para2str.h | 32 ss << "0xXXXX" << std::setfill('0') << std::setw(MASK_WIDTH) << std::hex << val;
in GetMaskedString()
|