Changeset View
Changeset View
Standalone View
Standalone View
src/crypto/sha256_sse4.cpp
// Copyright (c) 2017 The Bitcoin Core developers | // Copyright (c) 2017 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. | ||||
// | // | ||||
// This is a translation to GCC extended asm syntax from YASM code by Intel | // This is a translation to GCC extended asm syntax from YASM code by Intel | ||||
// (available at the bottom of this file). | // (available at the bottom of this file). | ||||
#include <stdint.h> | #include <cstdint> | ||||
#include <stdlib.h> | #include <cstdlib> | ||||
#if defined(__x86_64__) || defined(__amd64__) | #if defined(__x86_64__) || defined(__amd64__) | ||||
namespace sha256_sse4 { | namespace sha256_sse4 { | ||||
void Transform(uint32_t *s, const uint8_t *chunk, size_t blocks) { | void Transform(uint32_t *s, const uint8_t *chunk, size_t blocks) { | ||||
static const uint32_t K256 alignas(16)[] = { | static const uint32_t K256 alignas(16)[] = { | ||||
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, | 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, | ||||
0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, | 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, | ||||
▲ Show 20 Lines • Show All 1,489 Lines • Show Last 20 Lines |