Changeset View
Changeset View
Standalone View
Standalone View
src/crypto/sha256_shani.cpp
// Copyright (c) 2018 The Bitcoin Core developers | // Copyright (c) 2018 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
// | // | ||||
// Based on https://github.com/noloader/SHA-Intrinsics/blob/master/sha256-x86.c, | // Based on https://github.com/noloader/SHA-Intrinsics/blob/master/sha256-x86.c, | ||||
// Written and placed in public domain by Jeffrey Walton. | // Written and placed in public domain by Jeffrey Walton. | ||||
// Based on code from Intel, and by Sean Gulley for the miTLS project. | // Based on code from Intel, and by Sean Gulley for the miTLS project. | ||||
#ifdef ENABLE_SHANI | #ifdef ENABLE_SHANI | ||||
#include <cstdint> | |||||
#include <immintrin.h> | #include <immintrin.h> | ||||
#include <stdint.h> | |||||
#include <crypto/common.h> | #include <crypto/common.h> | ||||
namespace { | namespace { | ||||
const __m128i MASK = | const __m128i MASK = | ||||
_mm_set_epi64x(0x0c0d0e0f08090a0bULL, 0x0405060700010203ULL); | _mm_set_epi64x(0x0c0d0e0f08090a0bULL, 0x0405060700010203ULL); | ||||
const __m128i INIT0 = | const __m128i INIT0 = | ||||
▲ Show 20 Lines • Show All 338 Lines • Show Last 20 Lines |