]> git.saurik.com Git - apple/xnu.git/blob - EXTERNAL_HEADERS/corecrypto/ccrc4.h
xnu-3248.60.10.tar.gz
[apple/xnu.git] / EXTERNAL_HEADERS / corecrypto / ccrc4.h
1 /*
2 * ccrc4.h
3 * corecrypto
4 *
5 * Created on 12/22/2010
6 *
7 * Copyright (c) 2010,2011,2012,2013,2014,2015 Apple Inc. All rights reserved.
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
18 /* Declare a rc4 key named _name_. Pass the size field of a struct ccmode_ecb
19 for _size_. */
20 #define ccrc4_ctx_decl(_size_, _name_) cc_ctx_decl(ccrc4_ctx, _size_, _name_)
21 #define ccrc4_ctx_clear(_size_, _name_) cc_clear(_size_, _name_)
22
23 struct ccrc4_info {
24 size_t size; /* first argument to ccrc4_ctx_decl(). */
25 void (*init)(ccrc4_ctx *ctx, size_t key_len, const void *key);
26 void (*crypt)(ccrc4_ctx *ctx, unsigned long nbytes, const void *in, void *out);
27 };
28
29
30 const struct ccrc4_info *ccrc4(void);
31
32 extern const struct ccrc4_info ccrc4_eay;
33
34 struct ccrc4_vector {
35 size_t keylen;
36 const void *key;
37 unsigned long datalen;
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_ */