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
10 #include "cipher_rc4.h"
12 static int cipher_hw_rc4_initkey(PROV_CIPHER_CTX *ctx,
13 const unsigned char *key, size_t keylen)
15 PROV_RC4_CTX *rctx = (PROV_RC4_CTX *)ctx;
17 RC4_set_key(&rctx->ks.ks, keylen, key);
21 static int cipher_hw_rc4_cipher(PROV_CIPHER_CTX *ctx, unsigned char *out,
22 const unsigned char *in, size_t len)
24 PROV_RC4_CTX *rctx = (PROV_RC4_CTX *)ctx;
26 RC4(&rctx->ks.ks, len, in, out);
30 static const PROV_CIPHER_HW rc4_hw = {
31 cipher_hw_rc4_initkey,
34 const PROV_CIPHER_HW *PROV_CIPHER_HW_rc4(size_t keybits)