]>
Commit | Line | Data |
---|---|---|
316670eb A |
1 | /* |
2 | * ccrc4.h | |
3 | * corecrypto | |
4 | * | |
3e170ce0 A |
5 | * Created on 12/22/2010 |
6 | * | |
7 | * Copyright (c) 2010,2011,2012,2013,2014,2015 Apple Inc. All rights reserved. | |
316670eb A |
8 | * |
9 | */ | |
10 | ||
11 | #ifndef _CORECRYPTO_CCRC4_H_ | |
12 | #define _CORECRYPTO_CCRC4_H_ | |
13 | ||
14 | #include <corecrypto/ccmode.h> | |
15 | ||
16 | cc_aligned_struct(16) ccrc4_ctx; | |
17 | ||
fe8ab488 | 18 | /* Declare a rc4 key named _name_. Pass the size field of a struct ccmode_ecb |
316670eb A |
19 | for _size_. */ |
20 | #define ccrc4_ctx_decl(_size_, _name_) cc_ctx_decl(ccrc4_ctx, _size_, _name_) | |
3e170ce0 | 21 | #define ccrc4_ctx_clear(_size_, _name_) cc_clear(_size_, _name_) |
316670eb A |
22 | |
23 | struct ccrc4_info { | |
24 | size_t size; /* first argument to ccrc4_ctx_decl(). */ | |
fe8ab488 | 25 | void (*init)(ccrc4_ctx *ctx, size_t key_len, const void *key); |
39037602 | 26 | void (*crypt)(ccrc4_ctx *ctx, size_t nbytes, const void *in, void *out); |
316670eb A |
27 | }; |
28 | ||
29 | ||
30 | const struct ccrc4_info *ccrc4(void); | |
31 | ||
32 | extern const struct ccrc4_info ccrc4_eay; | |
33 | ||
34 | struct ccrc4_vector { | |
fe8ab488 | 35 | size_t keylen; |
316670eb | 36 | const void *key; |
39037602 | 37 | size_t datalen; |
316670eb A |
38 | const void *pt; |
39 | const void *ct; | |
40 | }; | |
41 | ||
42 | int ccrc4_test(const struct ccrc4_info *rc4, const struct ccrc4_vector *v); | |
43 | ||
44 | #endif /* _CORECRYPTO_CCRC4_H_ */ |