• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
3  *
4  * Licensed under the OpenSSL license (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 OPENSSL_HEADER_RC4_H
11 #define OPENSSL_HEADER_RC4_H
12 
13 #include <openssl/base.h>
14 
15 #if defined(__cplusplus)
16 extern "C" {
17 #endif
18 
19 
20 // RC4.
21 
22 
23 struct rc4_key_st {
24   uint32_t x, y;
25   uint32_t data[256];
26 } /* RC4_KEY */;
27 
28 // RC4_set_key performs an RC4 key schedule and initialises |rc4key| with |len|
29 // bytes of key material from |key|.
30 OPENSSL_EXPORT void RC4_set_key(RC4_KEY *rc4key, unsigned len,
31                                 const uint8_t *key);
32 
33 // RC4 encrypts (or decrypts, it's the same with RC4) |len| bytes from |in| to
34 // |out|.
35 OPENSSL_EXPORT void RC4(RC4_KEY *key, size_t len, const uint8_t *in,
36                         uint8_t *out);
37 
38 
39 // Deprecated functions.
40 
41 // RC4_options returns the string "rc4(ptr,int)".
42 OPENSSL_EXPORT const char *RC4_options(void);
43 
44 
45 #if defined(__cplusplus)
46 }  // extern C
47 #endif
48 
49 #endif  // OPENSSL_HEADER_RC4_H
50