Blame include/crypto/sm4.h

Packit c4476c
/*
Packit c4476c
 * Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
Packit c4476c
 * Copyright 2017 Ribose Inc. All Rights Reserved.
Packit c4476c
 *
Packit c4476c
 * Licensed under the OpenSSL license (the "License").  You may not use
Packit c4476c
 * this file except in compliance with the License.  You can obtain a copy
Packit c4476c
 * in the file LICENSE in the source distribution or at
Packit c4476c
 * https://www.openssl.org/source/license.html
Packit c4476c
 */
Packit c4476c
Packit c4476c
#ifndef OSSL_CRYPTO_SM4_H
Packit c4476c
# define OSSL_CRYPTO_SM4_H
Packit c4476c
Packit c4476c
# include <openssl/opensslconf.h>
Packit c4476c
# include <openssl/e_os2.h>
Packit c4476c
Packit c4476c
# ifdef OPENSSL_NO_SM4
Packit c4476c
#  error SM4 is disabled.
Packit c4476c
# endif
Packit c4476c
Packit c4476c
# define SM4_ENCRYPT     1
Packit c4476c
# define SM4_DECRYPT     0
Packit c4476c
Packit c4476c
# define SM4_BLOCK_SIZE    16
Packit c4476c
# define SM4_KEY_SCHEDULE  32
Packit c4476c
Packit c4476c
typedef struct SM4_KEY_st {
Packit c4476c
    uint32_t rk[SM4_KEY_SCHEDULE];
Packit c4476c
} SM4_KEY;
Packit c4476c
Packit c4476c
int SM4_set_key(const uint8_t *key, SM4_KEY *ks);
Packit c4476c
Packit c4476c
void SM4_encrypt(const uint8_t *in, uint8_t *out, const SM4_KEY *ks);
Packit c4476c
Packit c4476c
void SM4_decrypt(const uint8_t *in, uint8_t *out, const SM4_KEY *ks);
Packit c4476c
Packit c4476c
#endif