Home
last modified time | relevance | path

Searched refs:hex (Results 1 – 25 of 196) sorted by relevance

12345678

/ohos5.0/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 - 'a' + 0X0A; in HexChar()
31 uint8_t HksCryptoHalCommon::ReadHex(const uint8_t hex[2]) const in ReadHex()
33 return HexChar(*hex) * 16 + HexChar(*(hex + 1)); in ReadHex()
/ohos5.0/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()
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 |= ((uint64_t)value[1]) << 48; in hvb_be64toh()
68 hex |= ((uint64_t)value[6]) << 8; in hvb_be64toh()
69 hex |= ((uint64_t)value[7]); in hvb_be64toh()
[all …]
/ohos5.0/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 == NULL) || (strLen % BYTE_TO_HEX_OPER_LENGTH)) { /* even number or not … in DslmHexStringToByte()
77 hex[i] = nibble[0] << 4; /* Set the high nibble, shift 4 */ in DslmHexStringToByte()
78 hex[i] |= nibble[1]; /* Set the low nibble */ in DslmHexStringToByte()
/ohos5.0/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
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
65 hex[i] = nibble[0] << 4; /* Set the high nibble */ in hex_string_to_byte()
66 hex[i] |= nibble[1]; /* Set the low nibble */ in hex_string_to_byte()
85 int32_t byte_convert(json_pobject obj, const char *field, uint8_t *hex, uint32_t *length, uint32_t … in byte_convert() argument
96 if (hex_string_to_byte(str_json, len, hex) != HC_OK) { in byte_convert()
/ohos5.0/foundation/communication/wifi/wifi/test/wifi_standard/wifi_hal/unittest/
H A Dwifi_wpa_common_test.cpp123 const char hex = '1'; variable
127 result = Hex2byte(&hex);
134 const char hex = 'a'; variable
138 result = Hex2byte(&hex);
145 const char hex = 'A'; variable
149 result = Hex2byte(&hex);
156 const char hex = '*'; variable
160 result = Hex2byte(&hex);
/ohos5.0/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 lett… in HexToChar()
/ohos5.0/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 …
/ohos5.0/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 …
/ohos5.0/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()
/ohos5.0/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()
/ohos5.0/base/security/device_auth/common_lib/impl/src/
H A Dstring_util.c29 static char HexToChar(uint8_t hex) in HexToChar() argument
31 …return (hex > NUMBER_9_IN_DECIMAL) ? (hex + 0x37) : (hex + 0x30); /* Convert to the corresponding … in HexToChar()
/ohos5.0/foundation/graphic/graphic_2d/rosen/modules/texgine/src/opentype_parser/
H A Dranges.cpp51 LOGSO_FUNC_LINE(INFO) << "0x" << std::uppercase << std::hex in Dump()
53 << " ~ 0x" << std::uppercase << std::hex in Dump()
59 LOGSO_FUNC_LINE(INFO) << "0x" << std::uppercase << std::hex in Dump()
/ohos5.0/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()
68 std::string AesGcmHelper::Hex2Byte(const std::string &hex) in Hex2Byte() argument
70 if (hex.length() % STEP != 0) { 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()
/ohos5.0/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()
/ohos5.0/base/security/device_security_level/test/dslm_unit_test/
H A Ddslm_baselib_utils_test.cpp449 const uint8_t hex[] = {0x1, 0xF, 0xE, 0x8, 0xA}; variable
450 uint32_t hexLen = sizeof(hex);
457 DslmByteToHexString(hex, hexLen, nullptr, 0);
460 DslmByteToHexString(hex, hexLen, str, strLen - 1);
474 uint8_t hex[5] = {0}; variable
478 int32_t ret = DslmHexStringToByte(nullptr, 0, hex, hexLen);
490 int32_t ret = DslmHexStringToByte(str, strLen, hex, hexLen - 2);
/ohos5.0/foundation/filemanagement/storage_service/services/storage_daemon/include/crypto/
H A Dkey_blob.h128 std::string hex; in ToString() local
132 hex = hex + hexMap[(data[i] & 0xF0) >> 4] + hexMap[data[i] & 0x0F]; // higher 4 bits in ToString()
134 return hex; in ToString()
/ohos5.0/docs/zh-cn/application-dev/security/CryptoArchitectureKit/
H A Dcrypto-generate-sym-key-randomly.md33 console.info('key hex:' + encodedKey.data);
49 console.info('key hex:' + encodedKey.data);
78 console.info('key hex:' + encodedKey.data);
94 console.info('key hex:' + encodedKey.data);
/ohos5.0/foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/common/src/relational/
H A Dtable_info.cpp74 uint32_t hex = 0; in AffinityType() local
76 hex = (hex << 8) + static_cast<uint32_t>((std::tolower(dataType[i]))); // 8: shift length in AffinityType()
77 if (hex == affinityTable[AFFINITY_CHAR]) { in AffinityType()
79 } else if (hex == affinityTable[AFFINITY_CLOB]) { in AffinityType()
81 } else if (hex == affinityTable[AFFINITY_TEXT]) { in AffinityType()
83 } else if (hex == affinityTable[AFFINITY_BLOB] && (type == StorageType::STORAGE_TYPE_NULL || in AffinityType()
86 } else if (hex == affinityTable[AFFINITY_REAL] && type == StorageType::STORAGE_TYPE_NULL) { in AffinityType()
88 } else if (hex == affinityTable[AFFINITY_FLOA] && type == StorageType::STORAGE_TYPE_NULL) { in AffinityType()
90 } else if (hex == affinityTable[AFFINITY_DOUB] && type == StorageType::STORAGE_TYPE_NULL) { in AffinityType()
92 … } else if ((hex & 0x00ffffff) == affinityTable[AFFINITY_INT]) { // 0x00ffffff: mask for 3 byte in AffinityType()
/ohos5.0/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_[i].startAddr << ", size=0x" << in PrintPtableInfo()
[all …]
/ohos5.0/foundation/communication/bluetooth/frameworks/inner/c_adapter/
H A Dohos_bt_adapter_utils.cpp117 const std::string hex = "0123456789ABCDEF"; in ConvertDataToHex() local
121 outStr.push_back(hex[n >> sizeFour]); in ConvertDataToHex()
122 outStr.push_back(hex[n & 0xF]); in ConvertDataToHex()
/ohos5.0/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);
/ohos5.0/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()
/ohos5.0/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;
/ohos5.0/foundation/communication/bluetooth/frameworks/inner/ipc/common/
H A Dbt_uuid.h250 static const char *hex = "0123456789ABCDEF"; in ToString() local
258 tmp.push_back(hex[(((*it) >> size4) & 0xF)]); in ToString()
259 tmp.push_back(hex[(*it) & 0xF]); in ToString()
/ohos5.0/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()

12345678