2018-12-11 20:00:30 +00:00
|
|
|
/*
|
|
|
|
Copyright (c) 2018 tevador
|
|
|
|
|
|
|
|
This file is part of RandomX.
|
|
|
|
|
|
|
|
RandomX is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
RandomX is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with RandomX. If not, see<http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2019-04-20 14:53:06 +00:00
|
|
|
|
2018-12-11 20:00:30 +00:00
|
|
|
#include <stdint.h>
|
2019-04-20 14:53:06 +00:00
|
|
|
#include "intrin_portable.h"
|
2018-12-11 20:00:30 +00:00
|
|
|
|
2019-05-14 07:13:38 +00:00
|
|
|
rx_vec_i128 soft_aesenc(rx_vec_i128 in, rx_vec_i128 key);
|
2018-12-11 20:00:30 +00:00
|
|
|
|
2019-05-14 07:13:38 +00:00
|
|
|
rx_vec_i128 soft_aesdec(rx_vec_i128 in, rx_vec_i128 key);
|
2019-01-18 22:51:18 +00:00
|
|
|
|
|
|
|
template<bool soft>
|
2019-05-14 07:13:38 +00:00
|
|
|
inline rx_vec_i128 aesenc(rx_vec_i128 in, rx_vec_i128 key) {
|
|
|
|
return soft ? soft_aesenc(in, key) : rx_aesenc_vec_i128(in, key);
|
2019-01-18 22:51:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
template<bool soft>
|
2019-05-14 07:13:38 +00:00
|
|
|
inline rx_vec_i128 aesdec(rx_vec_i128 in, rx_vec_i128 key) {
|
|
|
|
return soft ? soft_aesdec(in, key) : rx_aesdec_vec_i128(in, key);
|
2019-01-18 22:51:18 +00:00
|
|
|
}
|