1 /* arcfour.h --- The arcfour stream cipher
2 * Copyright (C) 2000-2005, 2009-2025 Free Software Foundation, Inc.
4 * This file is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as
6 * published by the Free Software Foundation; either version 2.1 of the
7 * License, or (at your option) any later version.
9 * This file is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 /* Code from Libgcrypt adapted for gnulib by Simon Josefsson. */
32 #define ARCFOUR_SBOX_SIZE 256
36 char sbox
[ARCFOUR_SBOX_SIZE
];
40 /* Apply ARCFOUR stream to INBUF placing the result in OUTBUF, both of
41 LENGTH size. CONTEXT must be initialized with arcfour_setkey
42 before this function is called. */
44 arcfour_stream (arcfour_context
* context
,
45 const char *inbuf
, char *restrict outbuf
, size_t length
);
47 /* Initialize CONTEXT using encryption KEY of KEYLEN bytes. KEY
48 should be 40 bits (5 bytes) or longer. The KEY cannot be zero
51 arcfour_setkey (arcfour_context
* context
, const char *key
, size_t keylen
);
58 #endif /* ARCFOUR_H */