43 __host__ __device__ cuda::std::array<int4, 2>
Hash(cuda::std::span<const int4, 4> msg) {
44 cuda::std::array<int4, 2> out{};
47 assert(
false &&
"Sha256 is not supported on device side");
50 int4 buf[5] = {key_, msg[0], msg[1], msg[2], msg[3]};
51 auto buf_ptr =
reinterpret_cast<const unsigned char *
>(buf);
52 auto out_ptr =
reinterpret_cast<unsigned char *
>(out.data());
53 int ret = EVP_Digest(buf_ptr, 80, out_ptr, NULL, EVP_sha256(), NULL);
69 __host__ __device__ cuda::std::array<int4, 4>
Hash(cuda::std::tuple<int4, const int4> msg) {
70 cuda::std::array<int4, 4> out{};
73 assert(
false &&
"Sha256 is not supported on device side");
77 int4 buf[3] = {key_, fss::util::SetLsb(a,
false), b};
78 auto buf_ptr =
reinterpret_cast<const unsigned char *
>(buf);
79 auto out_ptr =
reinterpret_cast<unsigned char *
>(out.data());
80 int ret = EVP_Digest(buf_ptr, 48, out_ptr, NULL, EVP_sha256(), NULL);
83 buf[1] = fss::util::SetLsb(a,
true);
84 ret = EVP_Digest(buf_ptr, 48, out_ptr + 32, NULL, EVP_sha256(), NULL);