-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy patharcfour.h
More file actions
31 lines (26 loc) · 760 Bytes
/
Copy patharcfour.h
File metadata and controls
31 lines (26 loc) · 760 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
* Implementation of the stream cipher ARCFOUR
*
* Copyright (C) 2006-2013 Mathias Lafeldt <mathias.lafeldt@gmail.com>
*
* This file is part of cb2util, the CodeBreaker PS2 File Utility.
*
* cb2util is licensed under the terms of the MIT License. See LICENSE file.
*/
/*
* NOTE:
* The ARCFOUR algorithm is believed to be fully interoperable with the RC4(TM)
* algorithm. RC4(TM) is trademark of RSA Data Security, Inc.
*/
#ifndef _ARCFOUR_H_
#define _ARCFOUR_H_
#include <stddef.h>
#include <stdint.h>
typedef struct {
uint8_t perm[256];
uint8_t index1;
uint8_t index2;
} arc4_ctx_t;
void arc4_init(arc4_ctx_t *ctx, const uint8_t *key, int keylen);
void arc4_crypt(arc4_ctx_t *ctx, uint8_t *buf, size_t buflen);
#endif /* _ARCFOUR_H_ */