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_RC2_H jpayne@69: # define HEADER_RC2_H jpayne@69: jpayne@69: # include jpayne@69: jpayne@69: # ifndef OPENSSL_NO_RC2 jpayne@69: # ifdef __cplusplus jpayne@69: extern "C" { jpayne@69: # endif jpayne@69: jpayne@69: typedef unsigned int RC2_INT; jpayne@69: jpayne@69: # define RC2_ENCRYPT 1 jpayne@69: # define RC2_DECRYPT 0 jpayne@69: jpayne@69: # define RC2_BLOCK 8 jpayne@69: # define RC2_KEY_LENGTH 16 jpayne@69: jpayne@69: typedef struct rc2_key_st { jpayne@69: RC2_INT data[64]; jpayne@69: } RC2_KEY; jpayne@69: jpayne@69: void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, int bits); jpayne@69: void RC2_ecb_encrypt(const unsigned char *in, unsigned char *out, jpayne@69: RC2_KEY *key, int enc); jpayne@69: void RC2_encrypt(unsigned long *data, RC2_KEY *key); jpayne@69: void RC2_decrypt(unsigned long *data, RC2_KEY *key); jpayne@69: void RC2_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, jpayne@69: RC2_KEY *ks, unsigned char *iv, int enc); jpayne@69: void RC2_cfb64_encrypt(const unsigned char *in, unsigned char *out, jpayne@69: long length, RC2_KEY *schedule, unsigned char *ivec, jpayne@69: int *num, int enc); jpayne@69: void RC2_ofb64_encrypt(const unsigned char *in, unsigned char *out, jpayne@69: long length, RC2_KEY *schedule, unsigned char *ivec, jpayne@69: int *num); jpayne@69: jpayne@69: # ifdef __cplusplus jpayne@69: } jpayne@69: # endif jpayne@69: # endif jpayne@69: jpayne@69: #endif