TrustCore SDK NanoCrypto API reference  version 7.0
arc4.h
Go to the documentation of this file.
1 /*
2  * arc4.h
3  *
4  * "alleged rc4" algorithm
5  *
6  * Copyright 2019-2024 DigiCert, Inc. All Rights Reserved.
7  * Proprietary and Confidential Material.
8  *
9  */
10 
20 /*------------------------------------------------------------------*/
21 
22 #ifndef __ARC4_H__
23 #define __ARC4_H__
24 
25 #include "../cap/capdecl.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 typedef struct rc4_key
32 {
33  ubyte state[256];
34  ubyte x;
35  ubyte y;
36  MocSymCtx pMocSymCtx;
37  ubyte enabled;
38 } rc4_key;
39 
51 MOC_EXTERN void prepare_key(ubyte *key_data_ptr, sbyte4 key_data_len, rc4_key *key);
52 
66 MOC_EXTERN void rc4(ubyte *buffer_ptr, sbyte4 buffer_len, rc4_key *key);
67 
68 #ifdef __cplusplus
69 }
70 #endif
71 
72 #endif
MOC_EXTERN void rc4(ubyte *buffer_ptr, sbyte4 buffer_len, rc4_key *key)
Performs the RC4 cipher operation.
MOC_EXTERN void prepare_key(ubyte *key_data_ptr, sbyte4 key_data_len, rc4_key *key)
Computes the RC4 key schedule.