Monero
Loading...
Searching...
No Matches
soft_aes.h
Go to the documentation of this file.
1/*
2Copyright (c) 2018-2019, tevador <tevador@gmail.com>
3
4All rights reserved.
5
6Redistribution and use in source and binary forms, with or without
7modification, are permitted provided that the following conditions are met:
8 * Redistributions of source code must retain the above copyright
9 notice, this list of conditions and the following disclaimer.
10 * Redistributions in binary form must reproduce the above copyright
11 notice, this list of conditions and the following disclaimer in the
12 documentation and/or other materials provided with the distribution.
13 * Neither the name of the copyright holder nor the
14 names of its contributors may be used to endorse or promote products
15 derived from this software without specific prior written permission.
16
17THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
21FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27*/
28
29#pragma once
30
31#include <stdint.h>
32#include "intrin_portable.h"
33
35
37
38template<bool soft>
40 return soft ? soft_aesenc(in, key) : rx_aesenc_vec_i128(in, key);
41}
42
43template<bool soft>
45 return soft ? soft_aesdec(in, key) : rx_aesdec_vec_i128(in, key);
46}
const char * key
Definition hmac_keccak.cpp:40
FORCE_INLINE rx_vec_i128 rx_aesenc_vec_i128(rx_vec_i128 v, rx_vec_i128 rkey)
Definition intrin_portable.h:725
FORCE_INLINE rx_vec_i128 rx_aesdec_vec_i128(rx_vec_i128 v, rx_vec_i128 rkey)
Definition intrin_portable.h:729
rx_vec_i128 aesenc(rx_vec_i128 in, rx_vec_i128 key)
Definition soft_aes.h:39
rx_vec_i128 aesdec(rx_vec_i128 in, rx_vec_i128 key)
Definition soft_aes.h:44
rx_vec_i128 soft_aesdec(rx_vec_i128 in, rx_vec_i128 key)
Definition soft_aes.cpp:348
rx_vec_i128 soft_aesenc(rx_vec_i128 in, rx_vec_i128 key)
Definition soft_aes.cpp:330
Definition intrin_portable.h:527