17db96d56Sopenharmony_ci/* 27db96d56Sopenharmony_ci BLAKE2 reference source code package - optimized C implementations 37db96d56Sopenharmony_ci 47db96d56Sopenharmony_ci Written in 2012 by Samuel Neves <sneves@dei.uc.pt> 57db96d56Sopenharmony_ci 67db96d56Sopenharmony_ci To the extent possible under law, the author(s) have dedicated all copyright 77db96d56Sopenharmony_ci and related and neighboring rights to this software to the public domain 87db96d56Sopenharmony_ci worldwide. This software is distributed without any warranty. 97db96d56Sopenharmony_ci 107db96d56Sopenharmony_ci You should have received a copy of the CC0 Public Domain Dedication along with 117db96d56Sopenharmony_ci this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>. 127db96d56Sopenharmony_ci*/ 137db96d56Sopenharmony_ci#pragma once 147db96d56Sopenharmony_ci#ifndef __BLAKE2S_LOAD_SSE2_H__ 157db96d56Sopenharmony_ci#define __BLAKE2S_LOAD_SSE2_H__ 167db96d56Sopenharmony_ci 177db96d56Sopenharmony_ci#define LOAD_MSG_0_1(buf) buf = _mm_set_epi32(m6,m4,m2,m0) 187db96d56Sopenharmony_ci#define LOAD_MSG_0_2(buf) buf = _mm_set_epi32(m7,m5,m3,m1) 197db96d56Sopenharmony_ci#define LOAD_MSG_0_3(buf) buf = _mm_set_epi32(m14,m12,m10,m8) 207db96d56Sopenharmony_ci#define LOAD_MSG_0_4(buf) buf = _mm_set_epi32(m15,m13,m11,m9) 217db96d56Sopenharmony_ci#define LOAD_MSG_1_1(buf) buf = _mm_set_epi32(m13,m9,m4,m14) 227db96d56Sopenharmony_ci#define LOAD_MSG_1_2(buf) buf = _mm_set_epi32(m6,m15,m8,m10) 237db96d56Sopenharmony_ci#define LOAD_MSG_1_3(buf) buf = _mm_set_epi32(m5,m11,m0,m1) 247db96d56Sopenharmony_ci#define LOAD_MSG_1_4(buf) buf = _mm_set_epi32(m3,m7,m2,m12) 257db96d56Sopenharmony_ci#define LOAD_MSG_2_1(buf) buf = _mm_set_epi32(m15,m5,m12,m11) 267db96d56Sopenharmony_ci#define LOAD_MSG_2_2(buf) buf = _mm_set_epi32(m13,m2,m0,m8) 277db96d56Sopenharmony_ci#define LOAD_MSG_2_3(buf) buf = _mm_set_epi32(m9,m7,m3,m10) 287db96d56Sopenharmony_ci#define LOAD_MSG_2_4(buf) buf = _mm_set_epi32(m4,m1,m6,m14) 297db96d56Sopenharmony_ci#define LOAD_MSG_3_1(buf) buf = _mm_set_epi32(m11,m13,m3,m7) 307db96d56Sopenharmony_ci#define LOAD_MSG_3_2(buf) buf = _mm_set_epi32(m14,m12,m1,m9) 317db96d56Sopenharmony_ci#define LOAD_MSG_3_3(buf) buf = _mm_set_epi32(m15,m4,m5,m2) 327db96d56Sopenharmony_ci#define LOAD_MSG_3_4(buf) buf = _mm_set_epi32(m8,m0,m10,m6) 337db96d56Sopenharmony_ci#define LOAD_MSG_4_1(buf) buf = _mm_set_epi32(m10,m2,m5,m9) 347db96d56Sopenharmony_ci#define LOAD_MSG_4_2(buf) buf = _mm_set_epi32(m15,m4,m7,m0) 357db96d56Sopenharmony_ci#define LOAD_MSG_4_3(buf) buf = _mm_set_epi32(m3,m6,m11,m14) 367db96d56Sopenharmony_ci#define LOAD_MSG_4_4(buf) buf = _mm_set_epi32(m13,m8,m12,m1) 377db96d56Sopenharmony_ci#define LOAD_MSG_5_1(buf) buf = _mm_set_epi32(m8,m0,m6,m2) 387db96d56Sopenharmony_ci#define LOAD_MSG_5_2(buf) buf = _mm_set_epi32(m3,m11,m10,m12) 397db96d56Sopenharmony_ci#define LOAD_MSG_5_3(buf) buf = _mm_set_epi32(m1,m15,m7,m4) 407db96d56Sopenharmony_ci#define LOAD_MSG_5_4(buf) buf = _mm_set_epi32(m9,m14,m5,m13) 417db96d56Sopenharmony_ci#define LOAD_MSG_6_1(buf) buf = _mm_set_epi32(m4,m14,m1,m12) 427db96d56Sopenharmony_ci#define LOAD_MSG_6_2(buf) buf = _mm_set_epi32(m10,m13,m15,m5) 437db96d56Sopenharmony_ci#define LOAD_MSG_6_3(buf) buf = _mm_set_epi32(m8,m9,m6,m0) 447db96d56Sopenharmony_ci#define LOAD_MSG_6_4(buf) buf = _mm_set_epi32(m11,m2,m3,m7) 457db96d56Sopenharmony_ci#define LOAD_MSG_7_1(buf) buf = _mm_set_epi32(m3,m12,m7,m13) 467db96d56Sopenharmony_ci#define LOAD_MSG_7_2(buf) buf = _mm_set_epi32(m9,m1,m14,m11) 477db96d56Sopenharmony_ci#define LOAD_MSG_7_3(buf) buf = _mm_set_epi32(m2,m8,m15,m5) 487db96d56Sopenharmony_ci#define LOAD_MSG_7_4(buf) buf = _mm_set_epi32(m10,m6,m4,m0) 497db96d56Sopenharmony_ci#define LOAD_MSG_8_1(buf) buf = _mm_set_epi32(m0,m11,m14,m6) 507db96d56Sopenharmony_ci#define LOAD_MSG_8_2(buf) buf = _mm_set_epi32(m8,m3,m9,m15) 517db96d56Sopenharmony_ci#define LOAD_MSG_8_3(buf) buf = _mm_set_epi32(m10,m1,m13,m12) 527db96d56Sopenharmony_ci#define LOAD_MSG_8_4(buf) buf = _mm_set_epi32(m5,m4,m7,m2) 537db96d56Sopenharmony_ci#define LOAD_MSG_9_1(buf) buf = _mm_set_epi32(m1,m7,m8,m10) 547db96d56Sopenharmony_ci#define LOAD_MSG_9_2(buf) buf = _mm_set_epi32(m5,m6,m4,m2) 557db96d56Sopenharmony_ci#define LOAD_MSG_9_3(buf) buf = _mm_set_epi32(m13,m3,m9,m15) 567db96d56Sopenharmony_ci#define LOAD_MSG_9_4(buf) buf = _mm_set_epi32(m0,m12,m14,m11) 577db96d56Sopenharmony_ci 587db96d56Sopenharmony_ci 597db96d56Sopenharmony_ci#endif 60