#include "vud.h"
#include "vud_mem.h"
#include <stddef.h>
#include <stdint.h>
Go to the source code of this file.
|
| long | vud_sk_from_elf (const char *path, size_t sz, uint64_t *out, bool auth_only) |
| | load an elf file and convert it into subkernel format
|
| |
| int | vud_enc_auth_sk (uint64_t *sk, const uint8_t *key) |
| | encrypt the passed in subkernel under key - leave only header as AD
|
| |
| vud_error | vud_get_symbol (const char *binary, const char *symb, vud_mram_addr *out_addr) |
| | lookup the location of a symbol in MRAM based on the subkernel ELF file
|
| |
◆ vud_enc_auth_sk()
| int vud_enc_auth_sk |
( |
uint64_t * |
sk, |
|
|
const uint8_t * |
key |
|
) |
| |
encrypt the passed in subkernel under key - leave only header as AD
- Parameters
-
| sk | subkernel to encrypt |
| key | key to use for encryption |
- Returns
- 0 on success or negative value on failure
◆ vud_get_symbol()
lookup the location of a symbol in MRAM based on the subkernel ELF file
- Parameters
-
| binary | path to a subkernel ELF binary |
| symb | symbol to lookup - must be in MRAM |
| out_addr | location to write MRAM address to or NULL |
- Returns
- VUD_OK on success or an appropriate error value on failure
◆ vud_sk_from_elf()
| long vud_sk_from_elf |
( |
const char * |
path, |
|
|
size_t |
sz, |
|
|
uint64_t * |
out, |
|
|
bool |
auth_only |
|
) |
| |
load an elf file and convert it into subkernel format
This function basically wraps a few llvm-objcopy calls and as such, strongly depends on its presence. GNU's objcopy does not work because it cannot recognise the DPU architecture. Neither does LLVM, but it treats it as being some random 32-bit architecture.
- Parameters
-
| path | path to load elf from |
| sz | size of the output buffer |
| out | location to write subkernel to |
| auth_only | set the headers up for an auth only subkernel |
- Returns
- size of the subkernel on success or negative value on failure