Home
last modified time | relevance | path

Searched +full:buffer +full:- +full:crc32 (Results 1 – 25 of 362) sorted by relevance

12345678910>>...15

/external/pigweed/pw_checksum/
Dcrc32_test.cc7 // https://www.apache.org/licenses/LICENSE-2.0
14 #include "pw_checksum/crc32.h"
18 #include "public/pw_checksum/crc32.h"
26 // The expected CRC32 values were calculated using
42 TEST(Crc32, Empty) { in TEST() argument
43 EXPECT_EQ(Crc32::Calculate(span<std::byte>()), PW_CHECKSUM_EMPTY_CRC32); in TEST()
51 TEST(Crc32, Buffer) { in TEST() argument
52 EXPECT_EQ(Crc32::Calculate(as_bytes(span(kBytes))), kBufferCrc); in TEST()
58 TEST(Crc32, String) { in TEST() argument
59 EXPECT_EQ(Crc32::Calculate(as_bytes(span(kString))), kStringCrc); in TEST()
[all …]
/external/aws-sdk-java-v2/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/async/
DChecksumCalculatingAsyncRequestBodyTest.java54 "x-amz-checksum-crc32:i9aeUg==\r\n\r\n";
57 "x-amz-checksum-crc32:AAAAAA==\r\n\r\n";
82 Arguments.of("RequestBody from buffer, 0 pos, test string", in publishers()
85 Arguments.of("RequestBody from buffer, random pos, test string", in publishers()
95 Arguments.of("RequestBody from buffer, 0 pos, empty string", in publishers()
106 .algorithm(Algorithm.CRC32) in checksumPublisher()
107 .trailerHeader("x-amz-checksum-crc32").build(); in checksumPublisher()
137 Subscriber<ByteBuffer> subscriber = new SimpleSubscriber(buffer -> { in publish_differentAsyncRequestBodiesAndSources_produceCorrectData()
138 byte[] bytes = new byte[buffer.remaining()]; in publish_differentAsyncRequestBodiesAndSources_produceCorrectData()
139 buffer.get(bytes); in publish_differentAsyncRequestBodiesAndSources_produceCorrectData()
[all …]
/external/zlib/patches/
D0011-avx512.patch4 Subject: [PATCH] Enabled AVX512 for CRC32
6 Enabled AVX512 for CRC32 that provide best of known performance
8 operations and AVX512 new instructions, providing ~3.5X CRC32
10 ---
11 CMakeLists.txt | 8 +-
14 crc32.c | 14 +++-
15 crc32_simd.c | 198 ++++++++++++++++++++++++++++++++++++++++++++++++-
17 6 files changed, 230 insertions(+), 6 deletions(-)
19 diff --git a/CMakeLists.txt b/CMakeLists.txt
21 --- a/CMakeLists.txt
[all …]
/external/zlib/
Dcrc32_simd.h4 * Use of this source code is governed by a BSD-style license that can be
15 * crc32_sse42_simd_(): compute the crc32 of the buffer, where the buffer
27 * crc32_sse42_simd_ buffer size constraints: see the use in zlib/crc32.c
28 * for computing the crc32 of an arbitrary length buffer.
36 * CRC32 checksums using ARMv8-a crypto instructions.
50 * CRC32 checksums using ARMv8-a PMULL instructions, where the buffer
Dcrc32_simd.c4 * Use of this source code is governed by a BSD-style license that can be
12 * crc32_avx512_simd_(): compute the crc32 of the buffer, where the buffer
30 * Definitions of the bit-reflected domain constants k1,k2,k3,k4 in crc32_avx512_simd_()
32 * constants and CRC32+Barrett polynomials remain unchanged. in crc32_avx512_simd_()
36 * k2 = ( x ^ ( 512 * 4 - 32 ) mod P(x) << 32 )' << 1 = 0x01322d1430 in crc32_avx512_simd_()
38 * k4 = ( x ^ ( 512 - 32 ) mod P(x) << 32 )' << 1 = 0x01c6e41596 in crc32_avx512_simd_()
67 len -= 256; in crc32_avx512_simd_()
101 len -= 256; in crc32_avx512_simd_()
105 * Fold into 512-bits. in crc32_avx512_simd_()
137 len -= 64; in crc32_avx512_simd_()
[all …]
/external/pigweed/pw_hdlc/java/main/dev/pigweed/pw_hdlc/
DEncoder.java7 // https://www.apache.org/licenses/LICENSE-2.0
22 import java.util.zip.CRC32;
26 private final CRC32 crc32 = new CRC32(); field in Encoder
97 crc32.reset(); in startFrame()
110 long crc = crc32.getValue(); in writeCrc()
111 byte[] buffer = {(byte) crc, (byte) (crc >> 8), (byte) (crc >> 16), (byte) (crc >> 24)}; in writeCrc()
112 writeData(ByteBuffer.wrap(buffer)); in writeCrc()
116 ByteBuffer buffer = ByteBuffer.allocate(CustomVarInt.varLongSize(data)); in writeVarLong() local
117 CustomVarInt.putVarLong(data, buffer); in writeVarLong()
118 buffer.rewind(); in writeVarLong()
[all …]
DDecoder.java7 // https://www.apache.org/licenses/LICENSE-2.0
22 import java.util.zip.CRC32;
36 private final byte[] buffer = new byte[MAX_FRAME_SIZE_BYTES]; field in Decoder
53 public void process(ByteBuffer buffer) { in process() argument
54 while (buffer.hasRemaining()) { in process()
55 process(buffer.get()); in process()
59 public void process(byte[] buffer) { in process() argument
60 for (byte b : buffer) { in process()
71 // Report an error if non-flag bytes were read between frames. in process()
84 ByteBuffer message = ByteBuffer.wrap(buffer, 0, currentFrameSize); in process()
[all …]
/external/apache-commons-compress/src/main/java/org/apache/commons/compress/archivers/zip/
DAbstractUnicodeExtraField.java9 * http://www.apache.org/licenses/LICENSE-2.0
22 import java.util.zip.CRC32;
52 final CRC32 crc32 = new CRC32(); in AbstractUnicodeExtraField() local
53 crc32.update(bytes, off, len); in AbstractUnicodeExtraField()
54 nameCRC32 = crc32.getValue(); in AbstractUnicodeExtraField()
59 throw new RuntimeException("FATAL: UTF-8 encoding not supported.", e); //NOSONAR in AbstractUnicodeExtraField()
88 * @return The CRC32 checksum of the filename or comment as
96 * @param nameCRC32 The CRC32 checksum of the filename as encoded
105 * @return The UTF-8 encoded name.
117 * @param unicodeName The UTF-8 encoded name to set.
[all …]
/external/tflite-support/third_party/zlib/
Dcrc32_simd.h4 * Use of this source code is governed by a BSD-style license that can be
15 * crc32_sse42_simd_(): compute the crc32 of the buffer, where the buffer
24 * crc32_sse42_simd_ buffer size constraints: see the use in zlib/crc32.c
25 * for computing the crc32 of an arbitrary length buffer.
31 * CRC32 checksums using ARMv8-a crypto instructions.
/external/apache-commons-compress/src/main/java/org/apache/commons/compress/archivers/arj/
DArjArchiveInputStream.java9 * http://www.apache.org/licenses/LICENSE-2.0
26 import java.util.zip.CRC32;
68 throw new ArchiveException("Multi-volume ARJ files are unsupported"); in ArjArchiveInputStream()
110 final ByteArrayOutputStream buffer = new ByteArrayOutputStream(); in readString() local
113 buffer.write(nextByte); in readString()
116 return new String(buffer.toByteArray(), charsetName); in readString()
119 return new String(buffer.toByteArray()); in readString()
147 final CRC32 crc32 = new CRC32(); in readHeader() local
148 crc32.update(basicHeaderBytes); in readHeader()
149 if (basicHeaderCrc32 == crc32.getValue()) { in readHeader()
[all …]
/external/xz-embedded/linux/Documentation/staging/
Dxz.rst1 .. SPDX-License-Identifier: 0BSD
13 for executable code. CRC32 is supported for integrity checking. The
19 For userspace, XZ Utils provide a zlib-like compression library
20 and a gzip-like command line tool. XZ Utils can be downloaded from
26 The xz_dec module provides XZ decompressor with single-call (buffer
27 to buffer) and multi-call (stateful) APIs. The usage of the xz_dec
38 - $(call if_changed,xzkern) is for compressing the kernel image.
39 It runs the script scripts/xz_wrap.sh which uses arch-optimized
42 - $(call if_changed,xzkern_with_size) is like xzkern above but this
43 also appends a four-byte trailer containing the uncompressed size
[all …]
/external/elfutils/lib/
Dcrc32_file.c1 /* Compute CRC32 checksum of file contents.
43 unsigned char buffer[1024 * 8]; in crc32_file() local
57 mapsize = ((mapsize / 2) + pagesize - 1) & -pagesize; in crc32_file()
69 *resp = crc32 (crc, mapped, st.st_size); in crc32_file()
73 crc = crc32 (crc, mapped, mapsize); in crc32_file()
75 st.st_size -= mapsize; in crc32_file()
82 while ((count = TEMP_FAILURE_RETRY (pread (fd, buffer, sizeof buffer, in crc32_file()
86 crc = crc32 (crc, buffer, count); in crc32_file()
91 return count == 0 ? 0 : -1; in crc32_file()
/external/llvm/lib/Support/
DCompression.cpp1 //===--- Compression.cpp - Compression implementation ---------------------===//
8 //===----------------------------------------------------------------------===//
12 //===----------------------------------------------------------------------===//
58 // Tell MemorySanitizer that zlib output buffer is fully initialized. in compress()
72 // Tell MemorySanitizer that zlib output buffer is fully initialized. in uncompress()
79 uint32_t zlib::crc32(StringRef Buffer) { in crc32() argument
80 return ::crc32(0, (const Bytef *)Buffer.data(), Buffer.size()); in crc32()
95 uint32_t zlib::crc32(StringRef Buffer) { in crc32() argument
96 llvm_unreachable("zlib::crc32 is unavailable"); in crc32()
/external/swiftshader/third_party/llvm-10.0/llvm/lib/Support/
DCompression.cpp1 //===--- Compression.cpp - Compression implementation ---------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 //===----------------------------------------------------------------------===//
56 // Tell MemorySanitizer that zlib output buffer is fully initialized. in compress()
68 // Tell MemorySanitizer that zlib output buffer is fully initialized. in uncompress()
84 uint32_t zlib::crc32(StringRef Buffer) { in crc32() argument
85 return ::crc32(0, (const Bytef *)Buffer.data(), Buffer.size()); in crc32()
103 uint32_t zlib::crc32(StringRef Buffer) { in crc32() argument
104 llvm_unreachable("zlib::crc32 is unavailable"); in crc32()
/external/mobile-data-download/java/com/google/android/libraries/mobiledatadownload/internal/util/
DProtoLiteUtil.java8 * http://www.apache.org/licenses/LICENSE-2.0
34 import java.util.zip.CRC32;
65 * @param buf MUST be a 0 based array buffer (aka, buf.arrayOffset() must return 0) and be mutable
70 * @return A list of proto messages read from the buffer, or null on failure.
82 int crcPos = buf.limit() - CRC_LEN; in readFromBuffer()
101 int end = tailCrc ? buf.limit() - CRC_LEN : buf.limit(); in readFromBuffer()
130 String.format("Invalid message size: %d (buffer end is %d)", bytesInMessage, end)); in readFromBuffer()
153 // Advance the buffer manually, since we read from it "raw" from the array above in readFromBuffer()
174 * content at the end of the buffer (tail CRC) or a CRC of every message at the end of the
213 // As we called getSerializedSize above, this is assured to give us a non-bogus answer in dumpIntoBuffer()
[all …]
/external/apache-commons-compress/src/main/java/org/apache/commons/compress/archivers/sevenz/
DSevenZOutputFile.java9 * http://www.apache.org/licenses/LICENSE-2.0
41 import java.util.zip.CRC32;
54 private final CRC32 crc32 = new CRC32(); field in SevenZOutputFile
55 private final CRC32 compressedCrc32 = new CRC32();
81 * allows you to write to an in-memory archive.</p>
93 * Sets the default compression method to use for entry contents - the
100 * <p>This is a short form for passing a single-element iterable
109 * Sets the default (compression) methods to use for entry contents - the
184 final SevenZArchiveEntry entry = files.get(files.size() - 1); in closeArchiveEntry()
190 entry.setCrcValue(crc32.getValue()); in closeArchiveEntry()
[all …]
/external/mesa3d/src/mesa/main/
Dprogram_binary.c2 * Mesa 3-D graphics library
38 #include "util/crc32.h"
64 uint32_t crc32; member
86 /* binary_size is the size of the buffer provided by the application. in write_program_binary()
87 * Make sure our program (payload) will fit in the buffer. in write_program_binary()
89 if (payload_size > binary_size - sizeof(*hdr)) in write_program_binary()
92 hdr->internal_format = 0; in write_program_binary()
93 memcpy(hdr->sha1, sha1, sizeof(hdr->sha1)); in write_program_binary()
95 hdr->size = payload_size; in write_program_binary()
97 hdr->crc32 = util_hash_crc32(hdr + 1, payload_size); in write_program_binary()
[all …]
/external/xz-embedded/linux/lib/xz/
Dxz_dec_stream.c1 // SPDX-License-Identifier: 0BSD
22 uint32_t crc32; member
41 /* Position in variable-length integers and Check fields */
44 /* Variable-length integer decoded by dec_vli() */
52 /* CRC32 or CRC64 value in Block or CRC32 value in Index */
55 /* CRC32 value in Block or Index */
130 * Temporary buffer needed to hold Stream Header, Block Header,
163 * Fill s->temp by copying data starting from b->in[b->in_pos]. Caller
164 * must have set s->temp.pos to indicate how much data we are supposed
165 * to copy into s->temp.buf. Return true once s->temp.pos has reached
[all …]
/external/okhttp/okio/okio/src/main/java/okio/
DGzipSink.java8 * http://www.apache.org/licenses/LICENSE-2.0
19 import java.util.zip.CRC32;
30 * call to {@link #flush} immediately compresses all currently-buffered data;
54 private final CRC32 crc = new CRC32();
59 this.sink = Okio.buffer(sink); in GzipSink()
65 @Override public void write(Buffer source, long byteCount) throws IOException { in write()
114 // Write the Gzip header directly into the buffer for the sink to avoid handling IOException. in writeHeader()
115 Buffer buffer = this.sink.buffer(); in writeHeader() local
116 buffer.writeShort(0x1f8b); // Two-byte Gzip ID. in writeHeader()
117 buffer.writeByte(0x08); // 8 == Deflate compression method. in writeHeader()
[all …]
/external/okhttp/repackaged/okio/okio/src/main/java/com/android/okhttp/okio/
DGzipSink.java9 * http://www.apache.org/licenses/LICENSE-2.0
20 import java.util.zip.CRC32;
31 * call to {@link #flush} immediately compresses all currently-buffered data;
56 private final CRC32 crc = new CRC32();
61 this.sink = Okio.buffer(sink); in GzipSink()
67 @Override public void write(Buffer source, long byteCount) throws IOException { in write()
116 // Write the Gzip header directly into the buffer for the sink to avoid handling IOException. in writeHeader()
117 Buffer buffer = this.sink.buffer(); in writeHeader() local
118 buffer.writeShort(0x1f8b); // Two-byte Gzip ID. in writeHeader()
119 buffer.writeByte(0x08); // 8 == Deflate compression method. in writeHeader()
[all …]
/external/rust/crates/libz-sys/src/zlib/contrib/ada/
Dzlib.adb1 ----------------------------------------------------------------
2 -- ZLib for Ada thick binding. --
3 -- --
4 -- Copyright (C) 2002-2004 Dmitriy Anisimkov --
5 -- --
6 -- Open source license information is in the zlib.ads file. --
7 ----------------------------------------------------------------
9 -- $Id: zlib.adb,v 1.31 2004/09/06 06:53:19 vagul Exp $
52 := (16#1f#, 16#8b#, -- Magic header
53 16#08#, -- Z_DEFLATED
[all …]
Dzlib.ads1 ------------------------------------------------------------------------------
2 -- ZLib for Ada thick binding. --
3 -- --
4 -- Copyright (C) 2002-2004 Dmitriy Anisimkov --
5 -- --
6 -- This library is free software; you can redistribute it and/or modify --
7 -- it under the terms of the GNU General Public License as published by --
8 -- the Free Software Foundation; either version 2 of the License, or (at --
9 -- your option) any later version. --
10 -- --
[all …]
/external/icing/icing/file/
Dfile-backed-proto.h7 // http://www.apache.org/licenses/LICENSE-2.0
15 // A simple file-backed proto with an in-memory cache.
38 #include "icing/legacy/core/icing-string-util.h"
39 #include "icing/util/crc32.h"
41 #include "icing/util/status-macros.h"
46 // This class is go/thread-compatible
81 // - the checksum of the proto or 0 if the file is empty/non-existent
82 // - INTERNAL_ERROR if an IO error or a corruption was encountered.
83 libtextclassifier3::StatusOr<Crc32> ComputeChecksum() const
120 // Upper bound of file-size that is supported.
[all …]
/external/rust/crates/libz-sys/src/zlib/contrib/dotzlib/DotZLib/
DUnitTests.cs18 // ----------------------------------------
34 for (int i = lhs.Length-1; i >= 0; --i) in byteArrEqual()
46 #region Circular buffer tests
52 Assert.AreEqual( -1, buf.Get() ); in SinglePutGet()
58 Assert.AreEqual( -1, buf.Get() ); in SinglePutGet()
83 #region CRC32 Tests
87 CRC32Checksum crc32 = new CRC32Checksum(); in CRC32_Null()
88 Assert.AreEqual( 0, crc32.Value ); in CRC32_Null()
90 crc32 = new CRC32Checksum(1); in CRC32_Null()
91 Assert.AreEqual( 1, crc32.Value ); in CRC32_Null()
[all …]
/external/apache-commons-compress/src/main/java/org/apache/commons/compress/compressors/gzip/
DGzipCompressorOutputStream.java10 * http://www.apache.org/licenses/LICENSE-2.0
25 import java.util.zip.CRC32;
55 /** The buffer receiving the compressed data from the deflater */
62 private final CRC32 crc = new CRC32();
92 final ByteBuffer buffer = ByteBuffer.allocate(10); in writeHeader() local
93 buffer.order(ByteOrder.LITTLE_ENDIAN); in writeHeader()
94 buffer.putShort((short) GZIPInputStream.GZIP_MAGIC); in writeHeader()
95 buffer.put((byte) Deflater.DEFLATED); // compression method (8: deflate) in writeHeader()
96buffer.put((byte) ((filename != null ? FNAME : 0) | (comment != null ? FCOMMENT : 0))); // flags in writeHeader()
97 buffer.putInt((int) (parameters.getModificationTime() / 1000)); in writeHeader()
[all …]

12345678910>>...15