CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
hrydgard

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: hrydgard/ppsspp
Path: blob/master/Tools/SaveTool/encrypt.h
Views: 1401
1
/*
2
* PSP Software Development Kit - http://www.pspdev.org
3
* -----------------------------------------------------------------------
4
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
5
*
6
* encrypt.h - Declarations for functions in encrypt.c
7
*
8
* Copyright (c) 2005 Jim Paris <[email protected]>
9
* Coypright (c) 2005 psp123
10
*
11
* $Id: encrypt.h 1559 2005-12-10 01:10:11Z jim $
12
*/
13
14
#include <pspchnnlsv.h>
15
16
/* Encrypt the given plaintext file, and update the message
17
authentication hashes in the param.sfo. The data_filename is
18
usually the final component of encrypted_filename, e.g. "DATA.BIN".
19
See main.c for an example of usage. */
20
int encrypt_file(const char *plaintext_filename,
21
const char *encrypted_filename,
22
const char *data_filename,
23
const char *paramsfo_filename,
24
const char *paramsfo_filename_out,
25
const unsigned char *gamekey,
26
const int mainSdkVersion);
27
28
/* Do the actual hardware encryption.
29
mode is 3 for saves with a cryptkey, or 1 otherwise.
30
data, alignedLen, cryptkey, and hash must be multiples of 0x10.
31
cryptkey is NULL if mode == 1.
32
*/
33
int encrypt_data(unsigned int mode,
34
unsigned char *data,
35
int *dataLen,
36
int *alignedLen,
37
unsigned char *hash,
38
unsigned char *cryptkey);
39
40