]> git.saurik.com Git - apple/xnu.git/blame - EXTERNAL_HEADERS/corecrypto/ccrc4.h
xnu-2422.115.4.tar.gz
[apple/xnu.git] / EXTERNAL_HEADERS / corecrypto / ccrc4.h
CommitLineData
316670eb
A
1/*
2 * ccrc4.h
3 * corecrypto
4 *
5 * Created by Fabrice Gautier on 12/22/10.
6 * Copyright 2010,2011 Apple, Inc. All rights reserved.
7 *
8 */
9
10#ifndef _CORECRYPTO_CCRC4_H_
11#define _CORECRYPTO_CCRC4_H_
12
13#include <corecrypto/ccmode.h>
14
15cc_aligned_struct(16) ccrc4_ctx;
16
17/* Declare a gcm key named _name_. Pass the size field of a struct ccmode_gcm
18 for _size_. */
19#define ccrc4_ctx_decl(_size_, _name_) cc_ctx_decl(ccrc4_ctx, _size_, _name_)
20#define ccrc4_ctx_clear(_size_, _name_) cc_ctx_clear(ccrc4_ctx, _size_, _name_)
21
22struct ccrc4_info {
23 size_t size; /* first argument to ccrc4_ctx_decl(). */
24 void (*init)(ccrc4_ctx *ctx, unsigned long key_len, const void *key);
25 void (*crypt)(ccrc4_ctx *ctx, unsigned long nbytes, const void *in, void *out);
26};
27
28
29const struct ccrc4_info *ccrc4(void);
30
31extern const struct ccrc4_info ccrc4_eay;
32
33struct ccrc4_vector {
34 unsigned long keylen;
35 const void *key;
36 unsigned long datalen;
37 const void *pt;
38 const void *ct;
39};
40
41int ccrc4_test(const struct ccrc4_info *rc4, const struct ccrc4_vector *v);
42
43#endif /* _CORECRYPTO_CCRC4_H_ */