DSi RSA functions.
More...
#include <stddef.h>
#include <nds/ndstypes.h>
|
typedef struct swiRSAbuffers | swiRSAbuffers_t |
| Struture that holds pointers to the RSA buffers.
|
|
typedef struct swiRSAHeapContext | swiRSAHeapContext_t |
| Context that holds information about the RSA heap.
|
|
|
int | swiRSADecrypt (swiRSAHeapContext_t *ctx, void *dst, const void *sig, const void *key) |
| Decrypt signature and also remove padding.
|
|
int | swiRSADecryptPGP (swiRSAHeapContext_t *ctx, void *dst, const void *sig, const void *key) |
| Decrypt signature and extract the SHA1 value from a OpenPGP header.
|
|
int | swiRSADecryptRAW (swiRSAHeapContext_t *ctx, swiRSAbuffers_t *rsabuffers, size_t *lenDst) |
| Decrypt signature using the owner's public key and return the hash of the data that the signature belongs to. This function does not remove padding from the output data but leading 0x00 bytes are stripped.
|
|
int | swiRSAInitHeap (swiRSAHeapContext_t *ctx, void *heapStart, size_t heapSize) |
| Initialize RSA Heap.
|
|
◆ swiRSADecrypt()
int swiRSADecrypt |
( |
swiRSAHeapContext_t * |
ctx, |
|
|
void * |
dst, |
|
|
const void * |
sig, |
|
|
const void * |
key |
|
) |
| |
Decrypt signature and also remove padding.
- Parameters
-
ctx | RSA Heap context |
dst | Pointer to output buffer (should be 128 bytes). |
sig | Pointer to signature buffer (should be 128 bytes). |
key | Pointer to key buffer (should be 128 bytes). |
- Returns
- 1 if success, 0 if failed
◆ swiRSADecryptPGP()
int swiRSADecryptPGP |
( |
swiRSAHeapContext_t * |
ctx, |
|
|
void * |
dst, |
|
|
const void * |
sig, |
|
|
const void * |
key |
|
) |
| |
Decrypt signature and extract the SHA1 value from a OpenPGP header.
- Parameters
-
ctx | RSA Heap context |
dst | Pointer to output buffer. |
sig | Pointer to signature buffer. |
key | Pointer to key buffer. |
- Returns
- 1 if success, 0 if failed
◆ swiRSADecryptRAW()
Decrypt signature using the owner's public key and return the hash of the data that the signature belongs to. This function does not remove padding from the output data but leading 0x00 bytes are stripped.
- Parameters
-
ctx | RSA Heap context |
rsabuffers | Struct containing pointers to destination buffer, signature and public key to use. |
lenDst | Pointer to memory where to store the length of the destination buffer. |
- Returns
- 1 if success, 0 if failed.
◆ swiRSAInitHeap()
Initialize RSA Heap.
- Parameters
-
ctx | 12-byte heap information structure that gets set with heap start, heap end and heap length. |
heapStart | Pointer to the start of the heap. |
heapSize | Size of the heap in bytes (should be usually 4096). |
- Returns
- 1 if success, 0 if failed.