MCPcopy Create free account
hub / github.com/ElementsProject/elements / Read8

Function Read8

src/crypto/sha256_avx2.cpp:47–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47__m256i inline Read8(const unsigned char* chunk, int offset) {
48 __m256i ret = _mm256_set_epi32(
49 ReadLE32(chunk + 0 + offset),
50 ReadLE32(chunk + 64 + offset),
51 ReadLE32(chunk + 128 + offset),
52 ReadLE32(chunk + 192 + offset),
53 ReadLE32(chunk + 256 + offset),
54 ReadLE32(chunk + 320 + offset),
55 ReadLE32(chunk + 384 + offset),
56 ReadLE32(chunk + 448 + offset)
57 );
58 return _mm256_shuffle_epi8(ret, _mm256_set_epi32(0x0C0D0E0FUL, 0x08090A0BUL, 0x04050607UL, 0x00010203UL, 0x0C0D0E0FUL, 0x08090A0BUL, 0x04050607UL, 0x00010203UL));
59}
60
61void inline Write8(unsigned char* out, int offset, __m256i v) {
62 v = _mm256_shuffle_epi8(v, _mm256_set_epi32(0x0C0D0E0FUL, 0x08090A0BUL, 0x04050607UL, 0x00010203UL, 0x0C0D0E0FUL, 0x08090A0BUL, 0x04050607UL, 0x00010203UL));

Callers 1

Transform_8wayFunction · 0.85

Calls 1

ReadLE32Function · 0.85

Tested by

no test coverage detected