Home
last modified time | relevance | path

Searched refs:buf (Results 1 – 25 of 145) sorted by relevance

123456

/cts/tests/location/location_gnss/src/android/location/cts/gnss/asn1/base/
DAsn1Object.java92 ByteBuffer buf = ByteBuffer.allocate(getBerLength()); in encodeBer() local
93 encodeBer(buf); in encodeBer()
94 return buf.array(); in encodeBer()
97 void encodeBer(ByteBuffer buf) { in encodeBer() argument
105 tag.writeTagAndLength(buf, true, innerValueLen); in encodeBer()
109 tag.writeTagAndLength(buf, isConstructed(), valueLen); in encodeBer()
110 encodeBerValue(buf); in encodeBer()
120 abstract void encodeBerValue(ByteBuffer buf); in encodeBerValue() argument
133 void decodeBer(ByteBuffer buf) { in decodeBer() argument
134 Asn1Tag tag = Asn1Tag.readTag(buf); in decodeBer()
[all …]
DAsn1Choice.java44 public void writeTagAndLength(ByteBuffer buf, boolean constructed, int valueLength) {
134 public void encodeBerValue(ByteBuffer buf) { in encodeBerValue() argument
145 select.getTag().writeTagAndLength(buf, value.isConstructed(), value.getBerValueLength()); in encodeBerValue()
146 value.encodeBerValue(buf); in encodeBerValue()
148 select.getTag().writeTagAndLength(buf, true, value.getBerLength()); in encodeBerValue()
149 value.encodeBer(buf); in encodeBerValue()
152 value.encodeBer(buf); in encodeBerValue()
157 public void decodeBerValue(ByteBuffer buf) { in decodeBerValue() argument
158 Asn1Tag tag = Asn1Tag.peekTag(buf); in decodeBerValue()
165 Asn1Tag.readTag(buf); // Read the tag off. in decodeBerValue()
[all …]
DAsn1Tag.java97 public void writeTagAndLength(ByteBuffer buf, boolean constructed, int valueLength) { in writeTagAndLength() argument
98 this.writeTag(buf, constructed); in writeTagAndLength()
99 writeLength(buf, valueLength); in writeTagAndLength()
102 private void writeTag(ByteBuffer buf, boolean constructed) { in writeTag() argument
107 buf.put((byte) (getValue() | CONSTRUCTED_BIT)); in writeTag()
109 buf.put((byte) getValue()); in writeTag()
113 static Asn1Tag readTag(ByteBuffer buf) { in readTag() argument
114 return Asn1Tag.fromValue(buf.get() & 0xFF); in readTag()
120 static Asn1Tag peekTag(ByteBuffer buf) { in peekTag() argument
121 return Asn1Tag.fromValue(buf.get(buf.position()) & 0xFF); in peekTag()
[all …]
DAsn1SequenceOf.java76 @Override void encodeBerValue(ByteBuffer buf) { in encodeBerValue() argument
78 component.encodeBer(buf); in encodeBerValue()
82 @Override void decodeBerValue(ByteBuffer buf) { in decodeBerValue() argument
83 while (buf.hasRemaining()) { in decodeBerValue()
84 Asn1Tag tag = Asn1Tag.readTag(buf); in decodeBerValue()
85 int valueLength = Asn1Tag.readLength(buf); in decodeBerValue()
91 checkTag(value.getDefaultTag(), Asn1Tag.readTag(buf)); in decodeBerValue()
92 valueLength = Asn1Tag.readLength(buf); in decodeBerValue()
97 ByteBuffer subBuf = ByteBuffer.wrap(buf.array(), buf.position(), valueLength); in decodeBerValue()
102 buf.position(buf.position() + valueLength); in decodeBerValue()
DAsn1Sequence.java73 public void encodeBerValue(ByteBuffer buf) { in encodeBerValue() argument
79 obj.encodeBer(buf); in encodeBerValue()
82 componentTag.writeTagAndLength(buf, obj.isConstructed(), obj.getBerValueLength()); in encodeBerValue()
83 obj.encodeBerValue(buf); in encodeBerValue()
85 componentTag.writeTagAndLength(buf, true, obj.getBerLength()); in encodeBerValue()
86 obj.encodeBer(buf); in encodeBerValue()
98 public void decodeBerValue(ByteBuffer buf) { in decodeBerValue() argument
101 while (buf.hasRemaining()) { in decodeBerValue()
102 int bufStartPos = buf.position(); in decodeBerValue()
103 int bufEndPos = buf.limit(); in decodeBerValue()
[all …]
DAsn1Boolean.java46 @Override void encodeBerValue(ByteBuffer buf) { in encodeBerValue() argument
47 buf.put(value ? (byte) 0xFF : (byte) 0x00); in encodeBerValue()
50 @Override void decodeBerValue(ByteBuffer buf) { in decodeBerValue() argument
51 if (buf.remaining() != 1) { in decodeBerValue()
52 throw new IllegalArgumentException("Invalid remaining bytes: " + buf.remaining()); in decodeBerValue()
54 value = (buf.get() != 0); in decodeBerValue()
DAsn1Null.java44 @Override void encodeBerValue(ByteBuffer buf) { in encodeBerValue() argument
47 @Override void decodeBerValue(ByteBuffer buf) { in decodeBerValue() argument
48 if (buf.remaining() != 0) { in decodeBerValue()
49 throw new IllegalArgumentException("Invalid remaining bytes: " + buf.remaining()); in decodeBerValue()
/cts/hostsidetests/statsdatom/src/android/cts/statsdatom/statsd/
DBufferDebug.java43 public static String debugString(byte[] buf, int max) { in debugString() argument
44 if (buf == null) { in debugString()
47 if (buf.length == 0) { in debugString()
52 if (len <= 0 || len > buf.length) { in debugString()
53 max = len = buf.length; in debugString()
56 if (isPrintable(buf, len)) { in debugString()
57 return "\"" + new String(buf, 0, len, StandardCharsets.UTF_8) + "\"\n"; in debugString()
59 return toHex(buf, len, max); in debugString()
63 private static String toHex(byte[] buf, int len, int max) { in toHex() argument
69 writeRow(str, buf, row * WIDTH, WIDTH, max); in toHex()
[all …]
/cts/hostsidetests/securitybulletin/securityPatch/CVE-2017-0814/
Dpoc.cpp323 static void makeBitReader(const void *data, size_t size, ogg_buffer *buf, in makeBitReader() argument
325 buf->data = (uint8_t *)data; in makeBitReader()
326 buf->size = size; in makeBitReader()
327 buf->refcount = REF_COUNT; in makeBitReader()
329 ref->buffer = buf; in makeBitReader()
335 ogg_buffer buf; in main() local
339 memset(&buf, 0, sizeof(ogg_buffer)); in main()
343 makeBitReader(packInfoData, sizeof(packInfoData), &buf, &ref, &bits); in main()
350 memset(&buf, 0, sizeof(ogg_buffer)); in main()
354 makeBitReader(unpackBookData, sizeof(unpackBookData), &buf, &ref, &bits); in main()
[all …]
/cts/hostsidetests/securitybulletin/securityPatch/CVE-2018-9527/
Dpoc.cpp46 static void makeBitReader(const void *data, size_t size, ogg_buffer *buf, in makeBitReader() argument
48 buf->data = (uint8_t *) data; in makeBitReader()
49 buf->size = size; in makeBitReader()
50 buf->refcount = REF_COUNT; in makeBitReader()
52 ref->buffer = buf; in makeBitReader()
58 ogg_buffer buf; in main() local
62 memset(&buf, 0, sizeof(ogg_buffer)); in main()
66 makeBitReader(packInfoData, sizeof(packInfoData), &buf, &ref, &bits); in main()
73 memset(&buf, 0, sizeof(ogg_buffer)); in main()
77 makeBitReader(unpackBookData, sizeof(unpackBookData), &buf, &ref, in main()
[all …]
/cts/tests/tests/content/src/android/content/res/cts/
DAssetFileDescriptor_AutoCloseInputStreamTest.java90 byte[] buf = new byte[FILE_LENGTH]; in testReadBufferLen()
91 assertEquals(3, mInput.read(buf, 0, 3)); in testReadBufferLen()
92 assertEquals(3, mInput.read(buf, 3, 3)); in testReadBufferLen()
93 assertEquals(3, mInput.read(buf, 6, 4)); in testReadBufferLen()
94 MoreAsserts.assertEquals(FILE_DATA, buf); in testReadBufferLen()
95 assertEquals(FILE_END, mInput.read(buf, 0, 4)); in testReadBufferLen()
100 byte[] buf = new byte[6]; in testReadBuffer()
101 assertEquals(6, mInput.read(buf)); in testReadBuffer()
102 assertEquals(FILE_DATA[0], buf[0]); in testReadBuffer()
103 assertEquals(3, mInput.read(buf)); in testReadBuffer()
[all …]
/cts/tests/tests/media/common/jni/
Dmd5_utils.cpp28 byteSwap(UWORD32 *buf, unsigned words) { in byteSwap() argument
37 p = (md5byte *)buf; in byteSwap()
40 *buf++ = (UWORD32)((unsigned)p[3] << 8 | p[2]) << 16 | in byteSwap()
52 ctx->buf[0] = 0x67452301; in MD5Init()
53 ctx->buf[1] = 0xefcdab89; in MD5Init()
54 ctx->buf[2] = 0x98badcfe; in MD5Init()
55 ctx->buf[3] = 0x10325476; in MD5Init()
66 MD5Update(struct MD5Context *ctx, md5byte const *buf, unsigned len) { in MD5Update() argument
79 memcpy((md5byte *)ctx->in + 64 - t, buf, len); in MD5Update()
84 memcpy((md5byte *)ctx->in + 64 - t, buf, t); in MD5Update()
[all …]
Dmd5_utils.h35 UWORD32 buf[4]; member
41 void MD5Update(struct MD5Context *context, md5byte const *buf, unsigned len);
43 void MD5Transform(UWORD32 buf[4], UWORD32 const in[16]);
/cts/tests/tests/security/jni/
Dandroid_security_cts_EncryptionTest.cpp49 uint8_t *buf; in android_security_cts_EncryptionTest_aesIsFast() local
64 buf = new (std::nothrow) uint8_t[TEST_BUFSIZE + in android_security_cts_EncryptionTest_aesIsFast()
67 if (!buf) { in android_security_cts_EncryptionTest_aesIsFast()
73 memset(buf, 0xF0, TEST_BUFSIZE); in android_security_cts_EncryptionTest_aesIsFast()
79 EVP_DecryptUpdate(&ctx, buf, &len, buf, TEST_BUFSIZE); in android_security_cts_EncryptionTest_aesIsFast()
84 delete[] buf; in android_security_cts_EncryptionTest_aesIsFast()
/cts/hostsidetests/securitybulletin/securityPatch/CVE-2019-2027/
Dpoc.cpp74 ogg_buffer buf; in main() local
79 memset(&buf, 0, sizeof(ogg_buffer)); in main()
83 buf.data = (uint8_t *)data; in main()
84 buf.size = sizeof(data); in main()
85 buf.refcount = REF_COUNT; in main()
87 ref.buffer = &buf; in main()
/cts/tests/tests/secure_element/sample_applet/src/com/android/cts/omapi/test/
DCtsAndroidOmapiTestApplet.java102 byte[] buf = apdu.getBuffer(); in process()
105 byte p1 = buf[ISO7816.OFFSET_P1]; in process()
106 byte p2 = buf[ISO7816.OFFSET_P2]; in process()
109 lc = buf[ISO7816.OFFSET_LC]; in process()
110 if (buf[(short)(lc + ISO7816.OFFSET_CDATA - 1)] == 0x31) { in process()
118 Util.arrayCopy(respBuf, (short)0, buf, (short)0, (short)respBuf.length); in process()
119 apdu.sendBytesLong(buf, respBuffOffset, sendLen); in process()
123 switch (buf[ISO7816.OFFSET_INS]) { in process()
134 Util.arrayCopy(respBuf, (short)0, buf, (short)0, (short)respBuf.length); in process()
135 apdu.sendBytesLong(buf, respBuffOffset, sendLen); in process()
[all …]
/cts/apps/VpnApp/src/com/android/cts/vpnfirewall/
DPingReflector.java63 private void processPacket(byte[] buf, int version, int len, int hdrLen) throws IOException { in processPacket() argument
67 DataInputStream stream = new DataInputStream(new ByteArrayInputStream(buf)); in processPacket()
90 private void writePacket(byte[] buf) { in writePacket() argument
92 Os.write(mFd, buf, 0, buf.length); in writePacket()
98 private int readPacket(byte[] buf) { in readPacket() argument
100 return Os.read(mFd, buf, 0, buf.length); in readPacket()
/cts/hostsidetests/securitybulletin/securityPatch/CVE-2020-29374/
Dpoc.cpp49 char buf[0x1000]; in child_fn() local
50 SYSCHK(read(pipe_fds[0], buf, 0x1000)); in child_fn()
51 printf("read string from child: %s\n", buf); in child_fn()
54 if (strcmp("BORING DATA", buf) == 0) { in child_fn()
57 if (strcmp("THIS IS SECRET", buf) == 0) { in child_fn()
/cts/common/device-side/util-axt/src/com/android/compatibility/common/util/
DBroadcastUtils.java40 StringBuilder buf = new StringBuilder(); in toBundleString() local
42 buf.append("extras: "); in toBundleString()
44 buf.append("(" + s + " = " + bundle.get(s) + "), "); in toBundleString()
47 return buf.toString(); in toBundleString()
/cts/tests/tests/keystore/src/android/keystore/cts/
DHexEncoding.java56 public static String encode(ByteBuffer buf) { in encode() argument
57 return encode(buf.array(), buf.arrayOffset() + buf.position(), buf.remaining()); in encode()
/cts/hostsidetests/securitybulletin/securityPatch/CVE-2017-13273/
Dpoc.c39 char buf[256]; in thread_entry() local
41 memset(buf, 0x0, 256); in thread_entry()
52 len = sprintf(buf, "d %lu", (unsigned long)0); in thread_entry()
55 len = sprintf(buf, "t %d", sock_fd); in thread_entry()
59 ret = write(ctrl_fd, buf, len); in thread_entry()
/cts/hostsidetests/cpptools/test-apps/ConnectorNativeProgram/
Dconnector.cpp57 char buf[kBufferSize]; in main() local
58 memset(buf, 0, kBufferSize); in main()
59 ssize_t result = TEMP_FAILURE_RETRY(read(fd, buf, kBufferSize - 1)); in main()
61 printf("%s\n", buf); in main()
/cts/hostsidetests/securitybulletin/securityPatch/CVE-2018-9466/
Dpoc-CVE-2017-9047.c23 char buf[BUFFER_SIZE]; in main() local
34 memset(buf, 0, BUFFER_SIZE); in main()
35 xmlSnprintfElementContent(buf, BUFFER_SIZE, &content, 1); in main()
Dpoc-CVE-2017-9048.c23 char buf[BUFFER_SIZE]; in main() local
32 memset(buf, 0, BUFFER_SIZE); in main()
33 xmlSnprintfElementContent(buf, BUFFER_SIZE, &content, 1); in main()
/cts/hostsidetests/securitybulletin/securityPatch/CVE-2017-0670/
Dpoc.c44 char buf[MAX_STRLEN]; in getMemoryUsage() local
46 memset(buf, 0, MAX_STRLEN); in getMemoryUsage()
53 while (fgets(buf, MAX_STRLEN, fpMem) != NULL) { in getMemoryUsage()
56 int numOfItemsRead = sscanf(buf, "%lx-%lx", &mem1, &mem2); in getMemoryUsage()

123456