2 * Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
4 * Licensed under the Apache License 2.0 (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
11 * RC4 low level APIs are deprecated for public use, but still ok for internal
14 #include "internal/deprecated.h"
16 #include "cipher_rc4.h"
18 static int cipher_hw_rc4_initkey(PROV_CIPHER_CTX *ctx,
19 const unsigned char *key, size_t keylen)
21 PROV_RC4_CTX *rctx = (PROV_RC4_CTX *)ctx;
23 RC4_set_key(&rctx->ks.ks, keylen, key);
27 static int cipher_hw_rc4_cipher(PROV_CIPHER_CTX *ctx, unsigned char *out,
28 const unsigned char *in, size_t len)
30 PROV_RC4_CTX *rctx = (PROV_RC4_CTX *)ctx;
32 RC4(&rctx->ks.ks, len, in, out);
36 static const PROV_CIPHER_HW rc4_hw = {
37 cipher_hw_rc4_initkey,
40 const PROV_CIPHER_HW *PROV_CIPHER_HW_rc4(size_t keybits)