]> git.ipfire.org Git - thirdparty/openssl.git/blame - include/crypto/cmll_platform.h
providers: Add SM4 XTS implementation
[thirdparty/openssl.git] / include / crypto / cmll_platform.h
CommitLineData
c0d47492 1/*
a28d06f3 2 * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
c0d47492
RL
3 *
4 * Licensed under the Apache License 2.0 (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
8 */
9
10#ifndef OSSL_CMLL_PLATFORM_H
11# define OSSL_CMLL_PLATFORM_H
80ce21fe 12# pragma once
c0d47492
RL
13
14# if defined(CMLL_ASM) && (defined(__sparc) || defined(__sparc__))
15
16/* Fujitsu SPARC64 X support */
52f7e44e 17# include "crypto/sparc_arch.h"
c0d47492
RL
18
19# ifndef OPENSSL_NO_CAMELLIA
20# define SPARC_CMLL_CAPABLE (OPENSSL_sparcv9cap_P[1] & CFR_CAMELLIA)
21# include <openssl/camellia.h>
22
23void cmll_t4_set_key(const unsigned char *key, int bits, CAMELLIA_KEY *ks);
24void cmll_t4_encrypt(const unsigned char *in, unsigned char *out,
25 const CAMELLIA_KEY *key);
26void cmll_t4_decrypt(const unsigned char *in, unsigned char *out,
27 const CAMELLIA_KEY *key);
28
29void cmll128_t4_cbc_encrypt(const unsigned char *in, unsigned char *out,
30 size_t len, const CAMELLIA_KEY *key,
64fac96d 31 unsigned char *ivec, int /*unused*/);
c0d47492
RL
32void cmll128_t4_cbc_decrypt(const unsigned char *in, unsigned char *out,
33 size_t len, const CAMELLIA_KEY *key,
64fac96d 34 unsigned char *ivec, int /*unused*/);
c0d47492
RL
35void cmll256_t4_cbc_encrypt(const unsigned char *in, unsigned char *out,
36 size_t len, const CAMELLIA_KEY *key,
64fac96d 37 unsigned char *ivec, int /*unused*/);
c0d47492
RL
38void cmll256_t4_cbc_decrypt(const unsigned char *in, unsigned char *out,
39 size_t len, const CAMELLIA_KEY *key,
64fac96d 40 unsigned char *ivec, int /*unused*/);
c0d47492
RL
41void cmll128_t4_ctr32_encrypt(const unsigned char *in, unsigned char *out,
42 size_t blocks, const CAMELLIA_KEY *key,
43 unsigned char *ivec);
44void cmll256_t4_ctr32_encrypt(const unsigned char *in, unsigned char *out,
45 size_t blocks, const CAMELLIA_KEY *key,
46 unsigned char *ivec);
47# endif /* OPENSSL_NO_CAMELLIA */
48
49# endif /* CMLL_ASM && sparc */
50
51#endif /* OSSL_CRYPTO_CIPHERMODE_PLATFORM_H */