/* This function initializes a RC4 encryption algorithm, i.e. fills the psCipherContext_t structure pointed to by ctx with necessary data.  */
int tls_crypto_rc4_init(psCipherContext_t *ctx, const unsigned char *key, u32 keylen)
/* This function initializes a RC4 encryption algorithm, i.e. fills the psCipherContext_t structure pointed to by ctx with necessary data.  */
int tls_crypto_rc4_init(psCipherContext_t *ctx, const unsigned char *key, u32 keylen)
{
    if(keylen != 16 && keylen != 32)
    {
        return ERR_FAILURE;
    }
    memcpy(ctx->arc4.state, key, keylen);
    ctx->arc4.byteCount = keylen;
    return ERR_CRY_OK;
}