/tools/apksig/src/test/java/com/android/apksig/util/ |
D | DataSourceTestBase.java | 51 assertEquals(10, ds.size()); in testSize() 66 assertSliceEquals("", ds, ds.size() - 2, 0); in testSlice() 67 assertSliceEquals("", ds, ds.size() - 1, 0); in testSlice() 68 assertSliceEquals("", ds, ds.size(), 0); in testSlice() 71 assertSliceEquals("", slice, slice.size() - 2, 0); in testSlice() 72 assertSliceEquals("", slice, slice.size() - 1, 0); in testSlice() 73 assertSliceEquals("", slice, slice.size(), 0); in testSlice() 84 assertSliceThrowsIOOB(ds, ds.size() + 1, 0); in testSlice() 85 assertSliceThrowsIOOB(slice, slice.size() + 1, 0); in testSlice() 86 assertSliceThrowsIOOB(ds, ds.size(), 1); in testSlice() [all …]
|
/tools/apksig/src/main/java/com/android/apksig/internal/util/ |
D | ByteArrayDataSink.java | 111 public long size() { in size() method in ByteArrayDataSink 116 public ByteBuffer getByteBuffer(long offset, int size) { in getByteBuffer() argument 117 checkChunkValid(offset, size); in getByteBuffer() 120 return ByteBuffer.wrap(mArray, (int) offset, size).slice(); in getByteBuffer() 124 public void feed(long offset, long size, DataSink sink) throws IOException { in feed() argument 125 checkChunkValid(offset, size); in feed() 128 sink.consume(mArray, (int) offset, (int) size); in feed() 132 public void copyTo(long offset, int size, ByteBuffer dest) throws IOException { in copyTo() argument 133 checkChunkValid(offset, size); in copyTo() 136 dest.put(mArray, (int) offset, size); in copyTo() [all …]
|
D | FileChannelDataSource.java | 56 public FileChannelDataSource(FileChannel channel, long offset, long size) { in FileChannelDataSource() argument 58 throw new IndexOutOfBoundsException("offset: " + size); in FileChannelDataSource() 60 if (size < 0) { in FileChannelDataSource() 61 throw new IndexOutOfBoundsException("size: " + size); in FileChannelDataSource() 65 mSize = size; in FileChannelDataSource() 69 public long size() { in size() method in FileChannelDataSource 72 return mChannel.size(); in size() 82 public FileChannelDataSource slice(long offset, long size) { in slice() argument 83 long sourceSize = size(); in slice() 84 checkChunkValid(offset, size, sourceSize); in slice() [all …]
|
D | ChainedDataSource.java | 34 mTotalSize = Arrays.stream(sources).mapToLong(src -> src.size()).sum(); in ChainedDataSource() 38 public long size() { in size() method in ChainedDataSource 43 public void feed(long offset, long size, DataSink sink) throws IOException { in feed() argument 44 if (offset + size > mTotalSize) { in feed() 50 if (offset >= src.size()) { in feed() 51 offset -= src.size(); in feed() 56 long remaining = src.size() - offset; in feed() 57 if (remaining >= size) { in feed() 58 src.feed(offset, size, sink); in feed() 64 size -= remaining; in feed() [all …]
|
D | ByteBufferDataSource.java | 50 public long size() { in size() method in ByteBufferDataSource 55 public ByteBuffer getByteBuffer(long offset, int size) { in getByteBuffer() argument 56 checkChunkValid(offset, size); in getByteBuffer() 60 int chunkLimit = chunkPosition + size; in getByteBuffer() 78 public void copyTo(long offset, int size, ByteBuffer dest) { in copyTo() argument 79 dest.put(getByteBuffer(offset, size)); in copyTo() 83 public void feed(long offset, long size, DataSink sink) throws IOException { in feed() argument 84 if ((size < 0) || (size > mSize)) { in feed() 85 throw new IndexOutOfBoundsException("size: " + size + ", source size: " + mSize); in feed() 87 sink.consume(getByteBuffer(offset, (int) size)); in feed() [all …]
|
D | VerityTreeBuilder.java | 105 if (beforeApkSigningBlock.size() % CHUNK_SIZE != 0) { in generateVerityTreeRootHash() 107 + ": " + beforeApkSigningBlock.size()); in generateVerityTreeRootHash() 113 long centralDirOffsetForDigesting = beforeApkSigningBlock.size(); in generateVerityTreeRootHash() 114 ByteBuffer eocdBuf = ByteBuffer.allocate((int) eocd.size()); in generateVerityTreeRootHash() 116 eocd.copyTo(0, (int) eocd.size(), eocdBuf); in generateVerityTreeRootHash() 150 int[] levelOffset = calculateLevelOffset(fileSource.size(), digestSize); in generateVerityTree() 169 long totalOutput = divideRoundup(src.size(), CHUNK_SIZE) * digestSize; in generateVerityTree() 198 long size = CHUNK_SIZE * divideRoundup(chunkCount * digestSize, CHUNK_SIZE); in calculateLevelOffset() local 199 levelSize.add(size); in calculateLevelOffset() 207 int[] levelOffset = new int[levelSize.size() + 1]; in calculateLevelOffset() [all …]
|
/tools/apkzlib/src/main/java/com/android/tools/build/apkzlib/sign/ |
D | ZFileDataSource.java | 48 private final long size; field in ZFileDataSource 58 size = -1; in ZFileDataSource() 66 public ZFileDataSource(@Nonnull ZFile file, long offset, long size) { in ZFileDataSource() argument 68 Preconditions.checkArgument(size >= 0, "size < 0"); in ZFileDataSource() 71 this.size = size; in ZFileDataSource() 75 public long size() { in size() method in ZFileDataSource 76 if (size == -1) { in size() 85 return size; in size() 90 public DataSource slice(long offset, long size) { in slice() argument 91 long sourceSize = size(); in slice() [all …]
|
/tools/apksig/src/test/java/com/android/apksig/internal/util/ |
D | ChainedDataSourceTest.java | 47 assertEquals(10, mChain.size()); in setUp() 51 for (int begin = 0; begin < mChain.size(); begin++) { in feedAllPossibleRanges() 52 for (int end = begin + 1; end < mChain.size(); end++) { in feedAllPossibleRanges() 53 int size = end - begin; in feedAllPossibleRanges() local 54 ReadableDataSink sink = DataSinks.newInMemoryDataSink(size); in feedAllPossibleRanges() 55 mChain.feed(begin, size, sink); in feedAllPossibleRanges() 58 sink.getByteBuffer(0, size)); in feedAllPossibleRanges() 65 mChain.feed(0, mChain.size() + 1, DataSinks.newInMemoryDataSink(3)); in feedMoreThanAvailable() 69 for (int begin = 0; begin < mChain.size(); begin++) { in getByteBufferFromAllPossibleRanges() 70 for (int end = begin + 1; end < mChain.size(); end++) { in getByteBufferFromAllPossibleRanges() [all …]
|
/tools/apkzlib/src/main/java/com/android/tools/build/apkzlib/zip/ |
D | FileUseMap.java | 55 private long size; field in FileUseMap 83 FileUseMap(long size, int minFreeSize) { in FileUseMap() argument 84 Preconditions.checkArgument(size >= 0, "size < 0"); in FileUseMap() 87 this.size = size; in FileUseMap() 92 if (size > 0) { in FileUseMap() 93 internalAdd(FileUseMapEntry.makeFree(0, size)); in FileUseMap() 132 Preconditions.checkArgument(entry.getStart() < size, "entry.getStart() >= size"); in add() 133 Preconditions.checkArgument(entry.getEnd() <= size, "entry.getEnd() > size"); in add() 264 if (end < size) { in coalesce() 299 if (size == 0) { in truncate() [all …]
|
D | ZipField.java | 71 private final int size; field in ZipField 93 ZipField(int offset, int size, @Nonnull String name, ZipFieldInvariant... invariants) { in ZipField() argument 95 Preconditions.checkArgument(size == 2 || size == 4, "size != 2 && size != 4"); in ZipField() 99 this.size = size; in ZipField() 112 ZipField(int offset, int size, long expected, @Nonnull String name) { in ZipField() argument 114 Preconditions.checkArgument(size == 2 || size == 4, "size != 2 && size != 4"); in ZipField() 118 this.size = size; in ZipField() 147 if (bytes.remaining() < size) { in skip() 152 bytes.position(bytes.position() + size); in skip() 164 if (bytes.remaining() < size) { in read() [all …]
|
/tools/loganalysis/javatests/com/android/loganalysis/parser/ |
D | LogcatParserTest.java | 52 assertEquals(1, logcat.getEvents().size()); in testParse_anr() 53 assertEquals(1, logcat.getAnrs().size()); in testParse_anr() 76 assertEquals(1, logcat.getEvents().size()); in testParse_anr_pid() 77 assertEquals(1, logcat.getAnrs().size()); in testParse_anr_pid() 99 assertEquals(1, logcat.getEvents().size()); in testParse_java_crash() 100 assertEquals(1, logcat.getJavaCrashes().size()); in testParse_java_crash() 139 assertEquals(1, logcat.getEvents().size()); in testParse_test_exception() 140 assertEquals(1, logcat.getJavaCrashes().size()); in testParse_test_exception() 176 assertEquals(1, logcat.getEvents().size()); in testParse_test_exception_with_exras() 177 assertEquals(1, logcat.getJavaCrashes().size()); in testParse_test_exception_with_exras() [all …]
|
D | KernelLogParserTest.java | 47 assertEquals(1, kernelLog.getEvents().size()); in testParseLastKmsg() 48 assertEquals(1, kernelLog.getMiscEvents(KernelLogParser.KERNEL_RESET).size()); in testParseLastKmsg() 69 assertEquals(1, kernelLog.getEvents().size()); in testParseDmesg() 70 assertEquals(1, kernelLog.getMiscEvents(KernelLogParser.KERNEL_RESET).size()); in testParseDmesg() 91 assertEquals(1, kernelLog.getEvents().size()); in testParseLastMessage() 92 assertEquals(1, kernelLog.getMiscEvents(KernelLogParser.KERNEL_RESET).size()); in testParseLastMessage() 113 assertEquals(1, kernelLog.getEvents().size()); in testParseUnknownLastMessage() 114 assertEquals(1, kernelLog.getMiscEvents(KernelLogParser.KERNEL_RESET).size()); in testParseUnknownLastMessage() 132 assertEquals(0, kernelLog.getEvents().size()); in testParseKnownGoodLastMessage() 146 assertEquals(1, kernelLog.getEvents().size()); in testNoPreviousLogs() [all …]
|
D | BugreportParserTest.java | 169 assertEquals(5, bugreport.getMemInfo().size()); in testParse() 175 assertEquals(3, bugreport.getProcrank().getPids().size()); in testParse() 183 assertEquals(3, bugreport.getSystemLog().getEvents().size()); in testParse() 184 assertEquals(1, bugreport.getSystemLog().getAnrs().size()); in testParse() 191 assertEquals(4, bugreport.getSystemProps().size()); in testParse() 199 assertEquals(bugreport.getActivityService().getLocationDumps().getLocationClients().size(), in testParse() 234 assertEquals(1, bugreport.getCommandLine().size()); in testParse_command_line() 239 assertEquals(2, bugreport.getCommandLine().size()); in testParse_command_line() 246 assertEquals(2, bugreport.getCommandLine().size()); in testParse_command_line() 252 assertEquals(3, bugreport.getCommandLine().size()); in testParse_command_line() [all …]
|
D | DmesgParserTest.java | 104 dmesgParser.getServiceInfoItems().size()); in testEmptyDmesgLog() 117 dmesgParser.getServiceInfoItems().size()); in testCompleteDmesgLog_passedAsList() 121 dmesgParser.getStageInfoItems().size()); in testCompleteDmesgLog_passedAsList() 123 dmesgParser.getActionInfoItems().size()); in testCompleteDmesgLog_passedAsList() 127 dmesgParser.getModuleInfoItems().size()); in testCompleteDmesgLog_passedAsList() 144 dmesgParser.getServiceInfoItems().size()); in testCompleteDmesgLog_passedAsBufferedInput() 148 dmesgParser.getStageInfoItems().size()); in testCompleteDmesgLog_passedAsBufferedInput() 150 dmesgParser.getActionInfoItems().size()); in testCompleteDmesgLog_passedAsBufferedInput() 154 dmesgParser.getModuleInfoItems().size()); in testCompleteDmesgLog_passedAsBufferedInput() 168 dmesgParser.getServiceInfoItems().size()); in testCompleteServiceInfo() [all …]
|
/tools/dexter/dexter/ |
D | dexter.cc | 133 for (dex::u4 i = 0; i < dexMap.size; ++i) { in PrintDexMap() 193 dex::u4 sectionByteSize = (i == dexMap.size - 1) in PrintDexMap() 198 sectionByteSize, section.size); in PrintDexMap() 205 printf(" strings : %zu\n", dex_ir->strings.size()); in PrintDexIrStats() 206 printf(" types : %zu\n", dex_ir->types.size()); in PrintDexIrStats() 207 printf(" protos : %zu\n", dex_ir->protos.size()); in PrintDexIrStats() 208 printf(" fields : %zu\n", dex_ir->fields.size()); in PrintDexIrStats() 209 printf(" encoded_fields : %zu\n", dex_ir->encoded_fields.size()); in PrintDexIrStats() 210 printf(" methods : %zu\n", dex_ir->methods.size()); in PrintDexIrStats() 211 printf(" encoded_methods : %zu\n", dex_ir->encoded_methods.size()); in PrintDexIrStats() [all …]
|
/tools/dexter/slicer/ |
D | writer.cc | 68 size_t size = dst - buff; in WriteIntValue() local 69 assert(size > 0 && size <= sizeof(T)); in WriteIntValue() 70 WriteEncodedValueHeader(type, size - 1, data); in WriteIntValue() 71 data.Push(buff, size); in WriteIntValue() 79 size_t size = sizeof(T); in WriteFloatValue() local 82 while (size > 1 && *src == 0) { in WriteFloatValue() 83 --size; in WriteFloatValue() 88 for (size_t i = 0; i < size; ++i) { in WriteFloatValue() 92 assert(size > 0 && size <= sizeof(T)); in WriteFloatValue() 93 WriteEncodedValueHeader(type, size - 1, data); in WriteFloatValue() [all …]
|
D | bytecode_encoder.cc | 139 auto buff_offset = bytecode_.size(); in Visit() 145 SLICER_CHECK_EQ(bytecode->operands.size(), 0); in Visit() 151 SLICER_CHECK_EQ(bytecode->operands.size(), 2); in Visit() 159 SLICER_CHECK_EQ(bytecode->operands.size(), 2); in Visit() 168 SLICER_CHECK_EQ(bytecode->operands.size(), 2); in Visit() 178 SLICER_CHECK_EQ(bytecode->operands.size(), 2); in Visit() 186 SLICER_CHECK_EQ(bytecode->operands.size(), 2); in Visit() 195 SLICER_CHECK_EQ(bytecode->operands.size(), 1); in Visit() 202 SLICER_CHECK_EQ(bytecode->operands.size(), 2); in Visit() 212 SLICER_CHECK_EQ(bytecode->operands.size(), 1); in Visit() [all …]
|
/tools/dexter/slicer/export/slicer/ |
D | buffer.h | 66 return size(); in Seal() 89 size_t Alloc(size_t size) { in Alloc() argument 91 Expand(size); in Alloc() 92 std::memset(buff_ + offset, 0, size); in Alloc() 96 size_t Push(const void* ptr, size_t size) { in Push() argument 98 Expand(size); in Push() 99 std::memcpy(buff_ + offset, ptr, size); in Push() 104 return Push(memView.ptr(), memView.size()); in Push() 109 return Push(a.data(), a.size() * sizeof(T)); in Push() 114 return Push(v.data(), v.size() * sizeof(T)); in Push() [all …]
|
/tools/security/fuzzing/orphans/libcppbor/ |
D | cppbor_parse_fuzzer.cpp | 33 void FuzzParse(const uint8_t* data, size_t size) { in FuzzParse() argument 35 const uint8_t* end = data + size; in FuzzParse() 45 void FuzzParseWithViews(const uint8_t* data, size_t size) { in FuzzParseWithViews() argument 47 const uint8_t* end = data + size; in FuzzParseWithViews() 57 void FuzzParseWithClient(const uint8_t* data, size_t size) { in FuzzParseWithClient() argument 58 const uint8_t* end = data + size; in FuzzParseWithClient() 63 void FuzzParseWithClientAndViews(const uint8_t* data, size_t size) { in FuzzParseWithClientAndViews() argument 64 const uint8_t* end = data + size; in FuzzParseWithClientAndViews() 69 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { in LLVMFuzzerTestOneInput() argument 70 FuzzParse(data, size); in LLVMFuzzerTestOneInput() [all …]
|
/tools/trebuchet/core/common/src/test/kotlin/trebuchet/importers/ftrace/ |
D | FtraceImporterTest.kt | 73 assertEquals(1, modelFragment.processes.size) in testImportBeginEnd() 77 assertEquals(1, process.threads.size) in testImportBeginEnd() 83 assertEquals(1, sliceGroup.slices.size) in testImportBeginEnd() 86 assertEquals(2, doFrameSlice.children.size) in testImportBeginEnd() 88 assertEquals(0, doFrameSlice.children[0].children.size) in testImportBeginEnd() 90 assertEquals(1, doFrameSlice.children[1].children.size) in testImportBeginEnd() 109 assertEquals(1, modelFragment.processes.size) in testImportBeginEndNoTgids() 113 assertEquals(1, process.threads.size) in testImportBeginEndNoTgids() 119 assertEquals(1, sliceGroup.slices.size) in testImportBeginEndNoTgids() 122 assertEquals(2, doFrameSlice.children.size) in testImportBeginEndNoTgids() [all …]
|
/tools/external/fat32lib/src/main/java/de/waldheinz/fs/fat/ |
D | ClusterChain.java | 127 public long setSize(long size) throws IOException { in setSize() argument 128 final long nrClusters = ((size + clusterSize - 1) / clusterSize); in setSize() 210 int size = Math.min(len, in readData() local 212 dest.limit(dest.position() + size); in readData() 216 offset += size; in readData() 217 len -= size; in readData() 222 int size = Math.min(clusterSize, len); in readData() local 223 dest.limit(dest.position() + size); in readData() 227 len -= size; in readData() 259 int size = Math.min(len, in writeData() local [all …]
|
/tools/apksig/src/main/java/com/android/apksig/internal/apk/v4/ |
D | V4Signature.java | 59 final int size = 4/*hashAlgorithm*/ + 1/*log2BlockSize*/ + bytesSize(this.salt) in toByteArray() local 61 ByteBuffer buffer = ByteBuffer.allocate(size).order(ByteOrder.LITTLE_ENDIAN); in toByteArray() 104 final int size = bytesSize(this.apkDigest) + bytesSize(this.certificate) + bytesSize( in toByteArray() local 107 ByteBuffer buffer = ByteBuffer.allocate(size).order(ByteOrder.LITTLE_ENDIAN); in toByteArray() 134 final int size = 4/*blockId*/ + bytesSize(this.signingInfo); in toByteArray() local 135 ByteBuffer buffer = ByteBuffer.allocate(size).order(ByteOrder.LITTLE_ENDIAN); in toByteArray() 167 signingInfoBlocks.toArray(new SigningInfoBlock[signingInfoBlocks.size()])); in fromByteArray() 173 int size = arrays[0].length; in toByteArray() local 176 size += arrays[i + 1].length; in toByteArray() 178 if (size > MAX_SIGNING_INFOS_SIZE) { in toByteArray() [all …]
|
/tools/security/fuzzing/orphans/pppd/ |
D | eap_fuzz.cc | 9 #define S_MALLOC(var, size) \ argument 11 if ((var = (uint8_t *)malloc(size)) == NULL) { \ 45 S_MALLOC(fuzz_packet, data.size()+EAP_HEADERLEN+1); in DEFINE_BINARY_PROTO_FUZZER() 51 S_MALLOC(fuzz_packet, data.size()+EAP_HEADERLEN+1); in DEFINE_BINARY_PROTO_FUZZER() 57 S_MALLOC(fuzz_packet, data.size()+EAP_HEADERLEN+1); in DEFINE_BINARY_PROTO_FUZZER() 90 S_MALLOC(fuzz_packet, data.size()+EAP_HEADERLEN+2); in DEFINE_BINARY_PROTO_FUZZER() 112 S_MALLOC(fuzz_packet, data.size()+EAP_HEADERLEN+1); in DEFINE_BINARY_PROTO_FUZZER() 118 S_MALLOC(fuzz_packet, data.size()+EAP_HEADERLEN+1); in DEFINE_BINARY_PROTO_FUZZER() 124 S_MALLOC(fuzz_packet, data.size()+EAP_HEADERLEN+1); in DEFINE_BINARY_PROTO_FUZZER() 146 S_MALLOC(fuzz_packet, data.size()+EAP_HEADERLEN+2); in DEFINE_BINARY_PROTO_FUZZER() [all …]
|
/tools/apksig/src/main/java/com/android/apksig/internal/apk/ |
D | ApkSigningBlockUtils.java | 156 ZipUtils.setZipEocdCentralDirectoryOffset(modifiedEocd, beforeApkSigningBlock.size()); in verifyIntegrity() 168 if ((beforeApkSigningBlock.size() % ANDROID_COMMON_PAGE_ALIGNMENT_BYTES != 0)) { in verifyIntegrity() 171 beforeApkSigningBlock.size()); in verifyIntegrity() 175 long signingBlockSize = centralDirOffset - beforeApkSigningBlock.size(); in verifyIntegrity() 303 getChunkCount(input.size(), CONTENT_DIGESTED_CHUNK_MAX_SIZE_BYTES); in computeOneMbChunkContentDigests() 311 digestAlgorithms.toArray(new ContentDigestAlgorithm[digestAlgorithms.size()]); in computeOneMbChunkContentDigests() 345 long inputRemaining = input.size(); in computeOneMbChunkContentDigests() 397 getChunkCount(input.size(), CONTENT_DIGESTED_CHUNK_MAX_SIZE_BYTES); in computeOneMbChunkContentDigests() 404 List<ChunkDigests> chunkDigestsList = new ArrayList<>(digestAlgorithms.size()); in computeOneMbChunkContentDigests() 458 messageDigests = new ArrayList<>(chunkDigests.size()); in ChunkDigester() [all …]
|
/tools/apksig/src/main/java/com/android/apksig/ |
D | SigningCertificateLineage.java | 156 ByteBuffer inBuff = dataSource.getByteBuffer(0, (int) dataSource.size()); in readFromDataSource() 299 } else if (lineages.size() > 1) { in readFromApkDataSource() 349 } else if (lineages.size() > 1) { in readFromSignedData() 421 SigningCertificateNode currentGeneration = mSigningLineage.get(mSigningLineage.size() - 1); in spawnDescendant() 470 public int size() { in size() method in SigningCertificateLineage 471 return mSigningLineage.size(); in size() 585 new ArrayList<>(signerConfigs.size()); in sortSignerConfigs() 586 for (int i = 0; i < mSigningLineage.size(); i++) { in sortSignerConfigs() 587 for (int j = 0; j < signerConfigs.size(); j++) { in sortSignerConfigs() 595 if (sortedSignerConfigs.size() != signerConfigs.size()) { in sortSignerConfigs() [all …]
|