1
0
Fork 0
mirror of https://github.com/Atmosphere-NX/Atmosphere.git synced 2024-12-18 00:12:03 +00:00

Make exosphere subdir, start outlining SE driver API.

This commit is contained in:
Michael Scire 2018-02-16 23:55:08 -08:00
parent e205ed70f8
commit 6c5d425528
3 changed files with 39 additions and 3 deletions

View file

@ -3,6 +3,4 @@ Atmosphère-NX
![License](https://img.shields.io/badge/License-GPLv2-blue.svg)
This is a placeholder repo reserved for any/all development work I do pertaining to customized firmware on the Nintendo Switch.
Currently, I do not know on what timeline commits to this repository will appear.
This is a placeholder repo reserved for any/all development work I do pertaining to customized firmware on the Nintendo Switch.

6
exosphere/README.md Normal file
View file

@ -0,0 +1,6 @@
Exosphere
=====
![License](https://img.shields.io/badge/License-GPLv2-blue.svg)
Exosphere is a Secure Monitor implementation for the Nintendo Switch.

32
exosphere/se.h Normal file
View file

@ -0,0 +1,32 @@
#ifndef EXOSPHERE_SE_H
#define EXOSPHERE_SE_H
/* Exosphere driver for the Tegra X1 security engine. */
/* TODO: Define constants for the C driver. */
/* WIP, API subject to change. */
#define KEYSLOT_AES_MAX 0x10
#define KEYSLOT_RSA_MAX 0x2
void set_security_engine_address(void *security_engine);
void set_aes_keyslot_flags(unsigned int keyslot, unsigned int flags);
void set_rsa_keyslot_flags(unsigned int keyslot, unsigned int flags);
void clear_aes_keyslot(unsigned int keyslot);
void clear_rsa_keyslot(unsigned int keyslot);
void set_aes_keyslot(unsigned int keyslot, const char *key, unsigned int key_size);
void crypt_data_into_keyslot(unsigned int keyslot, )
void set_rsa_keyslot(unsigned int keyslot, const char *modulus, unsigned int modulus_size, const char *exp, unsigned int exp_size);
void set_aes_keyslot_iv(unsigned int keyslot, const char *iv, unsigned int iv_size);
void set_se_ctr(const unsigned int *ctr);
void se_crypt_aes(unsigned int keyslot, char *dst, unsigned int dst_size, const char *src, unsigned int src_size, unsigned int config, unsigned int mode, unsigned int (*callback)(void));
void se_exp_mod(unsigned int keyslot, char *buf, unsigned int size, unsigned int (*callback)(void));
/* TODO: SE context save API, consider extending AES API for secure world vs non-secure world operations. */
/* In particular, smc_crypt_aes takes in raw DMA lists, and we need to support that. */
#endif /* EXOSPHERE_SE_H */