/developtools/hdc/hdc_rust/src/cffi/ |
H A D | uart_wrapper.cpp | 47 ssize_t length = 0; in ReadUartDevExt() local 48 while (length == 0) { in ReadUartDevExt() 49 length = ReadUartDev(static_cast<int>(fd), readBuf, static_cast<size_t>(expectedSize)); in ReadUartDevExt() 52 char *bufRet = new char[length]; in ReadUartDevExt() 53 (void)memset_s(bufRet, length, 0, length); in ReadUartDevExt() 54 if (memcpy_s(bufRet, length, readBuf.data(), length) != EOK) { in ReadUartDevExt() 55 return SerializedBuffer{bufRet, static_cast<uint64_t>(length)}; in ReadUartDevExt() 57 return SerializedBuffer{bufRet, static_cast<uint64_t>(length)}; in ReadUartDevExt() [all...] |
/developtools/hapsigner/hapsigntool/hap_sign_tool_lib/src/main/java/com/ohos/hapsigntool/zip/ |
H A D | RandomAccessFileZipDataOutput.java | 61 public void write(byte[] buffer, int offset, int length) throws IOException { in write() argument 65 if (offset > buffer.length) { in write() 66 throw new IndexOutOfBoundsException("offset (" + offset + ") > buffer length(" + buffer.length + ")"); in write() 68 if (length == 0) { in write() 73 file.write(buffer, offset, length); in write() 74 position += length; in write() 80 int length = buffer.remaining(); in write() 81 if (length == 0) { in write() 89 position += length; in write() [all...] |
H A D | ZipEntryData.java | 48 private long length; field in ZipEntryData 60 length = zipEntryHeader.getLength() + data.length + (dataDescriptor == null ? 0 : 16); in updateLength() 62 length = zipEntryHeader.getLength() + fileSize + (dataDescriptor == null ? 0 : 16); in updateLength() 161 return length; in getLength() 164 public void setLength(long length) { in setLength() argument 165 this.length = length; in setLength()
|
H A D | EndOfCentralDirectory.java | 37 * .ZIP file comment length 2 bytes 44 * EndOfCentralDirectory invariable bytes length 93 private int length; field in EndOfCentralDirectory 114 int remainingDataLen = bytes.length - offset; in getEOCDByBytes() 151 ByteBuffer bf = ByteBuffer.allocate(length).order(ByteOrder.LITTLE_ENDIAN); in toBytes() 239 return length; in getLength() 242 public void setLength(int length) { in setLength() argument 243 this.length = length; in setLength()
|
/developtools/hapsigner/hapsigntool_cpp_test/unittest/codeSigning/sign/ |
H A D | verify_code_signature_test.cpp | 111 int64_t length = 23193; in HWTEST_F() local 114 VerifyCodeSignature::VerifyHap(file, offset, length, fileFormat, profileContent); in HWTEST_F() 133 int64_t length = 23193; in HWTEST_F() local 136 bool flag = VerifyCodeSignature::VerifyHap(file, offset, length, fileFormat, profileContent); in HWTEST_F() 153 int64_t length = 23193; in HWTEST_F() local 156 bool flag = VerifyCodeSignature::VerifyHap(file, offset, length, fileFormat, profileContent); in HWTEST_F() 173 int64_t length = 23194; in HWTEST_F() local 176 bool flag = VerifyCodeSignature::VerifyHap(file, offset, length, fileFormat, profileContent); in HWTEST_F() 193 int64_t length = 23193; in HWTEST_F() local 196 bool flag = VerifyCodeSignature::VerifyHap(file, offset, length, fileForma in HWTEST_F() 213 int64_t length = 23221; HWTEST_F() local 233 int64_t length = 23193; HWTEST_F() local 253 int64_t length = 23193; HWTEST_F() local 273 int64_t length = 23193; HWTEST_F() local 293 int64_t length = 4096; HWTEST_F() local 314 int64_t length = 10516; HWTEST_F() local 334 int64_t length = 10516; HWTEST_F() local 354 int64_t length = 10516; HWTEST_F() local 374 int64_t length = 2; HWTEST_F() local 394 int64_t length = 10516; HWTEST_F() local 414 int64_t length = 10516; HWTEST_F() local 434 int64_t length = 10516; HWTEST_F() local 476 int64_t length = 23221; HWTEST_F() local [all...] |
/developtools/hapsigner/hapsigntool/hap_sign_tool_lib/src/main/java/com/ohos/hapsigntool/codesigning/fsverity/ |
H A D | FsVerityDescriptorWithSign.java | 26 * 2) u32 length: fsverity descriptor size 35 private int length; field in FsVerityDescriptorWithSign 52 length = FsVerityDescriptor.DESCRIPTOR_SIZE + this.signature.length; in FsVerityDescriptorWithSign() 59 * @param length fs-verity descriptor with signature size 63 public FsVerityDescriptorWithSign(int type, int length, FsVerityDescriptor fsVerityDescriptor, byte[] signature) { in FsVerityDescriptorWithSign() argument 65 this.length = length; in FsVerityDescriptorWithSign() 76 return Integer.BYTES * 2 + FsVerityDescriptor.DESCRIPTOR_SIZE + signature.length; in size() 88 buffer.putInt(length); in toByteArray() [all...] |
/developtools/hapsigner/hapsigntool/hap_sign_tool_lib/src/main/java/com/ohos/hapsigntool/hap/entity/ |
H A D | SignContentInfo.java | 50 * the data length of hash value 52 protected int length; field in SignContentHash 60 * the length of content 64 SignContentHash(char type, char tag, short algId, int length, byte[] hash) { in SignContentHash() argument 68 this.length = length; in SignContentHash() 70 this.contentHashLen = CONTENT_HEAD_SIZE + this.hash.length; in SignContentHash() 92 * @param length the data length of hash value 95 public void addContentHashData(char type, char tag, short algId, int length, byt argument [all...] |
H A D | SigningBlock.java | 25 private int length; field in SigningBlock 39 this.length = value.length; in SigningBlock() 53 this.length = value.length; in SigningBlock() 63 return length; in getLength()
|
H A D | HwBlockHead.java | 28 * bin file sign block length is 8 byte 33 * elf file sign block length is 12 byte 44 * get bin block length 46 * @return return bin block length 53 * get elf block length 55 * @return return elf block length 66 * @param length the length of block data 70 public static byte[] getBlockHead(char type, char tag, short length, int offset) { in getBlockHead() argument 74 (byte) ((length >> BIT_SIZ in getBlockHead() 92 getBlockHeadLittleEndian(char type, char tag, int length, int offset) getBlockHeadLittleEndian() argument [all...] |
/developtools/global_resource_tool/src/ |
H A D | resource_item.cpp | 45 return SetData(reinterpret_cast<const int8_t *>(data.c_str()), data.length() + 1); in SetData() 48 bool ResourceItem::SetData(const int8_t *data, uint32_t length) in SetData() argument 50 if (data == nullptr || length < 0) { in SetData() 55 if (length == 0) { in SetData() 61 int8_t *buffer = reinterpret_cast<int8_t *>(new (nothrow) int8_t[length]); in SetData() 66 bool result = (memset_s(buffer, length, 0, length) == EOK); in SetData() 67 result = result && (memcpy_s(buffer, length, data, length) == EOK); in SetData() 69 dataLen_ = length; in SetData() [all...] |
H A D | resource_append.cpp | 360 uint32_t size = resourceItem.GetName().length(); in WriteResourceItem() 364 size = resourceItem.GetLimitKey().length(); in WriteResourceItem() 368 size = resourceItem.GetFilePath().length(); in WriteResourceItem() 400 int32_t length = in.tellg(); in LoadResourceItem() 402 if (length <= 0) { in LoadResourceItem() 403 cerr << "Error: invalid file size = " << length << NEW_LINE_PATH << filePath << endl; in LoadResourceItem() 406 char buffer[length]; in LoadResourceItem() 407 in.read(buffer, length); in LoadResourceItem() 408 return LoadResourceItemFromMem(buffer, length); in LoadResourceItem() 524 bool ResourceAppend::LoadResourceItemFromMem(const char buffer[], int32_t length) in LoadResourceItemFromMem() argument 585 ParseString(const char buffer[], int32_t length, int32_t &offset) const ParseString() argument 602 ParseInt32(const char buffer[], int32_t length, int32_t &offset) const ParseInt32() argument [all...] |
/developtools/hapsigner/hapsigntool/hap_sign_tool_lib/src/main/java/com/ohos/hapsigntool/utils/ |
H A D | ByteArrayUtils.java | 44 if (index + Integer.BYTES > desByte.length) { in insertIntToByteArray() 63 * @param desByteLen length of destination byte array 86 * @param srcLen length of byte array is inserted 90 if (src.length < srcLen) { in insertByteToByteArray() 106 if (start > des.length - src.length) { in insertCharToByteArray() 109 for (int i = 0; i < src.length; i++) { in insertCharToByteArray() 112 return start + src.length; in insertCharToByteArray()
|
H A D | FileUtils.java | 72 * Expected split string length 152 * @param length length 155 public static byte[] readFileByOffsetAndLength(File file, long offset, long length) throws IOException { in readFileByOffsetAndLength() argument 157 return readInputByOffsetAndLength(input, offset, length); in readFileByOffsetAndLength() 166 * @param length length 170 public static byte[] readInputByOffsetAndLength(InputStream input, long offset, long length) throws IOException { in readInputByOffsetAndLength() argument 172 return readInputByLength(input, length); in readInputByOffsetAndLength() 179 * @param length lengt 182 readInputByLength(InputStream input, long length) readInputByLength() argument 195 writeInputToOutPut(InputStream input, OutputStream output, long length) writeInputToOutPut() argument [all...] |
/developtools/smartperf_host/trace_streamer/sdk/demo_sdk/test/unittest/ |
H A D | sdk_api_test.cpp | 70 ret = rpcServer->DemoSqlQuery((const uint8_t *)sqlQueryCounter.c_str(), sqlQueryCounter.length(), res); in HWTEST_F() 75 ret = rpcServer->DemoSqlQuery((const uint8_t *)sqlQueryCounterObj.c_str(), sqlQueryCounterObj.length(), res); in HWTEST_F() 79 ret = rpcServer->DemoSqlQuery((const uint8_t *)sqlQuerySlice.c_str(), sqlQuerySlice.length(), res); in HWTEST_F() 83 ret = rpcServer->DemoSqlQuery((const uint8_t *)sqlQuerySliceObj.c_str(), sqlQuerySliceObj.length(), res); in HWTEST_F() 102 ret = rpcServer->DemoSqlQuery((const uint8_t *)sqlQueryCounter.c_str(), sqlQueryCounter.length(), res); in HWTEST_F() 106 ret = rpcServer->DemoSqlQuery((const uint8_t *)sqlQueryCounterObj.c_str(), sqlQueryCounterObj.length(), res); in HWTEST_F() 110 ret = rpcServer->DemoSqlQuery((const uint8_t *)sqlQuerySlice.c_str(), sqlQuerySlice.length(), res); in HWTEST_F() 114 ret = rpcServer->DemoSqlQuery((const uint8_t *)sqlQuerySliceObj.c_str(), sqlQuerySliceObj.length(), res); in HWTEST_F() 135 ret = rpcServer->DemoSqlQuery((const uint8_t *)sqlQueryCounter.c_str(), sqlQueryCounter.length(), res); in HWTEST_F() 139 ret = rpcServer->DemoSqlQuery((const uint8_t *)sqlQueryCounterObj.c_str(), sqlQueryCounterObj.length(), re in HWTEST_F() [all...] |
/developtools/profiler/device/plugins/gpu_plugin/src/ |
H A D | gpu_data_plugin.cpp | 54 uint32_t length; in Report() local 57 length = dataProto.ByteSizeLong(); in Report() 58 if (length > dataSize) { in Report() 59 return -length; in Report() 61 if (dataProto.SerializeToArray(data, length) > 0) { in Report() 62 return length; in Report()
|
/developtools/hapsigner/hapsigntool_cpp/hap/entity/src/ |
H A D | block_head.cpp | 33 std::string BlockHead::GetBlockHead(const char type, const char tag, const short length, const int offset) in GetBlockHead() argument 38 tmpVec.push_back((length >> BIT_SIZE) & 0xff); in GetBlockHead() 39 tmpVec.push_back(length & 0xff); in GetBlockHead() 49 const int length, const int offset) in GetBlockHeadLittleEndian() 56 bf.PutInt32(length); in GetBlockHeadLittleEndian() 48 GetBlockHeadLittleEndian(const char type, const char tag, const int length, const int offset) GetBlockHeadLittleEndian() argument
|
/developtools/hapsigner/hapsigntool_cpp/zip/src/ |
H A D | random_access_file_output.cpp | 43 int length = buffer.GetCapacity(); in Write() local 44 if (length == 0) { in Write() 50 if (file->WriteToFile(buffer, position, length) < 0) { in Write() 54 position += length; in Write()
|
/developtools/ace_js2bundle/ace-loader/src/ |
H A D | compile-plugin.js | 109 mErrorCount = mStats.compilation.errors.length; 112 mWarningCount = mStats.compilation.warnings.length; 155 const length = globalThis["webpackChunk${process.env.hashProjectPath}"].length; 156 switch (length) { 248 let workerNum = Object.keys(cluster.workers).length; 255 if (resultInfo.length === 0) { 265 const length = warnings.length; 266 for (let index = 0; index < length; inde [all...] |
/developtools/smartperf_host/trace_streamer/src/parser/ebpf_parser/ |
H A D | ebpf_data_reader.cpp | 77 ret = ReadItemEventMaps(startAddr, dataTitle->length); in EbpfTypeHandle() 81 ret = ReadItemSymbolInfo(startAddr, dataTitle->length); in EbpfTypeHandle() 85 ret = ReadItemEventFs(startAddr, dataTitle->length); in EbpfTypeHandle() 89 ret = ReadItemEventPagedMemory(startAddr, dataTitle->length); in EbpfTypeHandle() 93 ret = ReadItemEventBIO(startAddr, dataTitle->length); in EbpfTypeHandle() 97 ret = ReadItemEventStr(startAddr, dataTitle->length); in EbpfTypeHandle() 101 ret = ReaItemKernelSymbolInfo(startAddr, dataTitle->length); in EbpfTypeHandle() 105 TS_LOGI("Do not support EBPF type: %d, length: %d", dataTitle->type, dataTitle->length); in EbpfTypeHandle() 116 if (dataTitle->length > unresolvedLen in ReadEbpfData() 297 auto length = std::distance(kernelSymbolMap_.begin(), end); GetSymbolNameIndexFromElfSym() local [all...] |
/developtools/hapsigner/hapsigntool_cpp/utils/src/ |
H A D | file_utils.cpp | 34 if (cs.length() == 0) { in IsEmpty() 124 int FileUtils::ReadFileByOffsetAndLength(std::ifstream& file, size_t offset, size_t length, std::string& ret) in ReadFileByOffsetAndLength() argument 126 if (length > INT_MAX) { in ReadFileByOffsetAndLength() 127 SIGNATURE_TOOLS_LOGE("Size cannot be greater than Integer max value: %zu", length); in ReadFileByOffsetAndLength() 130 if (ReadInputByOffsetAndLength(file, offset, length, ret) < 0) { in ReadFileByOffsetAndLength() 137 int FileUtils::ReadInputByOffsetAndLength(std::ifstream& input, size_t offset, size_t length, std::string& ret) in ReadInputByOffsetAndLength() argument 139 if (length > INT_MAX) { in ReadInputByOffsetAndLength() 140 SIGNATURE_TOOLS_LOGE("Size cannot be greater than Integer max value: %zu", length); in ReadInputByOffsetAndLength() 144 if (ReadInputByLength(input, length, ret) < 0) { in ReadInputByOffsetAndLength() 151 int FileUtils::ReadInputByLength(std::ifstream& input, size_t length, st argument 248 WriteInputToOutPut(std::ifstream& input, std::ofstream& output, size_t length) WriteInputToOutPut() argument [all...] |
/developtools/hapsigner/hapsigntool_cpp/codesigning/fsverity/src/ |
H A D | fs_verity_descriptor_with_sign.cpp | 32 length = FsVerityDescriptor::DESCRIPTOR_SIZE + this->signature.size(); in FsVerityDescriptorWithSign() 35 FsVerityDescriptorWithSign::FsVerityDescriptorWithSign(int32_t type, int32_t length, in FsVerityDescriptorWithSign() argument 39 this->length = length; in FsVerityDescriptorWithSign() 54 buffer->PutInt32(length); in ToByteArray()
|
/developtools/profiler/device/plugins/sample_plugin/src/ |
H A D | sample_plugin.cpp | 84 uint32_t length = dataProto.ByteSizeLong(); in Report() local 85 CHECK_TRUE(length <= dataSize, -length, "%s:Report failed!", __func__); in Report() 87 if (dataProto.SerializeToArray(data, length) > 0) { in Report() 88 return length; in Report()
|
/developtools/smartperf_host/trace_streamer/src/proto_reader/ |
H A D | proto_reader.cpp | 28 ProtoReaderBase::ProtoReaderBase(DataArea *storage, uint32_t dataAreasCount, const uint8_t *buffer, size_t length) in ProtoReaderBase() argument 30 endAddr_(startAddr_ + length), in ProtoReaderBase() 81 uint64_t length = 0; in ParseLengthDelimitedValue() local 82 auto cursor = VarIntDecode(startAddr, endAddr, &length); in ParseLengthDelimitedValue() 83 if (cursor == startAddr || length > static_cast<uint64_t>(endAddr - cursor)) { in ParseLengthDelimitedValue() 88 result.dataArea.SetDataAreaSize(length); in ParseLengthDelimitedValue() 89 result.next = cursor + length; in ParseLengthDelimitedValue() 90 if (length > kMaxMessageLength) { in ParseLengthDelimitedValue() 91 TS_LOGD("Skip this data, because it is too large. length: %" PRIu64 "", length); in ParseLengthDelimitedValue() [all...] |
/developtools/hapsigner/hapsigntool_cpp_test/unittest/codeSigning/fsverity/ |
H A D | fs_verity_descriptor_with_sign_test.cpp | 98 int32_t length = 0; in HWTEST_F() local 99 FsVerityDescriptorWithSign descriptor(type, length, fsVerityDescriptor, signature); in HWTEST_F() 120 int32_t length = 0; in HWTEST_F() local 121 FsVerityDescriptorWithSign descriptor(type, length, fsVerityDescriptor, signature); in HWTEST_F() 141 int32_t length = 0; in HWTEST_F() local 142 FsVerityDescriptorWithSign descriptor(type, length, fsVerityDescriptor, signature); in HWTEST_F()
|
/developtools/hapsigner/hapsigntool/hap_sign_tool_lib/src/main/java/com/ohos/hapsigntool/codesigning/datastructure/ |
H A D | ElfSignBlock.java | 29 * 2) u32 length: merkle tree with padding size 32 * 5) u32 length: fsverity descriptor size 81 this.treeLength = paddingSize + inMerkleTreeData.length; in ElfSignBlock() 83 System.arraycopy(inMerkleTreeData, 0, merkleTreeWithPadding, paddingSize, inMerkleTreeData.length); in ElfSignBlock() 101 return Integer.BYTES * 2 + merkleTreeWithPadding.length + descriptorWithSign.size(); in size() 105 * return padding length by the sign block offset 154 bf.putInt(merkleTreeWithPadding.length); in toByteArray() 168 ByteBuffer bf = ByteBuffer.allocate(bytes.length).order(ByteOrder.LITTLE_ENDIAN); in fromByteArray() 184 if (bytes.length != Integer.BYTES * 2 + inTreeLength + Integer.BYTES * 2 + inFsdLength) { in fromByteArray() 185 throw new VerifyCodeSignException("Invalid fs-verify descriptor with signature length o in fromByteArray() [all...] |