rc4.h (1515B)
1 // Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // https://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #ifndef OPENSSL_HEADER_RC4_H 16 #define OPENSSL_HEADER_RC4_H 17 18 #include <openssl/base.h> // IWYU pragma: export 19 20 #if defined(__cplusplus) 21 extern "C" { 22 #endif 23 24 25 // RC4. 26 27 28 struct rc4_key_st { 29 uint32_t x, y; 30 uint32_t data[256]; 31 } /* RC4_KEY */; 32 33 // RC4_set_key performs an RC4 key schedule and initialises |rc4key| with |len| 34 // bytes of key material from |key|. 35 OPENSSL_EXPORT void RC4_set_key(RC4_KEY *rc4key, unsigned len, 36 const uint8_t *key); 37 38 // RC4 encrypts (or decrypts, it's the same with RC4) |len| bytes from |in| to 39 // |out|. 40 OPENSSL_EXPORT void RC4(RC4_KEY *key, size_t len, const uint8_t *in, 41 uint8_t *out); 42 43 44 // Deprecated functions. 45 46 // RC4_options returns the string "rc4(ptr,int)". 47 OPENSSL_EXPORT const char *RC4_options(void); 48 49 50 #if defined(__cplusplus) 51 } // extern C 52 #endif 53 54 #endif // OPENSSL_HEADER_RC4_H