jpayne@69: /* jpayne@69: * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. jpayne@69: * jpayne@69: * Licensed under the OpenSSL license (the "License"). You may not use jpayne@69: * this file except in compliance with the License. You can obtain a copy jpayne@69: * in the file LICENSE in the source distribution or at jpayne@69: * https://www.openssl.org/source/license.html jpayne@69: */ jpayne@69: jpayne@69: #ifndef HEADER_IDEA_H jpayne@69: # define HEADER_IDEA_H jpayne@69: jpayne@69: # include jpayne@69: jpayne@69: # ifndef OPENSSL_NO_IDEA jpayne@69: # ifdef __cplusplus jpayne@69: extern "C" { jpayne@69: # endif jpayne@69: jpayne@69: typedef unsigned int IDEA_INT; jpayne@69: jpayne@69: # define IDEA_ENCRYPT 1 jpayne@69: # define IDEA_DECRYPT 0 jpayne@69: jpayne@69: # define IDEA_BLOCK 8 jpayne@69: # define IDEA_KEY_LENGTH 16 jpayne@69: jpayne@69: typedef struct idea_key_st { jpayne@69: IDEA_INT data[9][6]; jpayne@69: } IDEA_KEY_SCHEDULE; jpayne@69: jpayne@69: const char *IDEA_options(void); jpayne@69: void IDEA_ecb_encrypt(const unsigned char *in, unsigned char *out, jpayne@69: IDEA_KEY_SCHEDULE *ks); jpayne@69: void IDEA_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks); jpayne@69: void IDEA_set_decrypt_key(IDEA_KEY_SCHEDULE *ek, IDEA_KEY_SCHEDULE *dk); jpayne@69: void IDEA_cbc_encrypt(const unsigned char *in, unsigned char *out, jpayne@69: long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, jpayne@69: int enc); jpayne@69: void IDEA_cfb64_encrypt(const unsigned char *in, unsigned char *out, jpayne@69: long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, jpayne@69: int *num, int enc); jpayne@69: void IDEA_ofb64_encrypt(const unsigned char *in, unsigned char *out, jpayne@69: long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, jpayne@69: int *num); jpayne@69: void IDEA_encrypt(unsigned long *in, IDEA_KEY_SCHEDULE *ks); jpayne@69: jpayne@69: # if OPENSSL_API_COMPAT < 0x10100000L jpayne@69: # define idea_options IDEA_options jpayne@69: # define idea_ecb_encrypt IDEA_ecb_encrypt jpayne@69: # define idea_set_encrypt_key IDEA_set_encrypt_key jpayne@69: # define idea_set_decrypt_key IDEA_set_decrypt_key jpayne@69: # define idea_cbc_encrypt IDEA_cbc_encrypt jpayne@69: # define idea_cfb64_encrypt IDEA_cfb64_encrypt jpayne@69: # define idea_ofb64_encrypt IDEA_ofb64_encrypt jpayne@69: # define idea_encrypt IDEA_encrypt jpayne@69: # endif jpayne@69: jpayne@69: # ifdef __cplusplus jpayne@69: } jpayne@69: # endif jpayne@69: # endif jpayne@69: jpayne@69: #endif