An example of building a project with its use would be as follows
Download and build wolfSSL (https://wolfssl.com/wolfSSL/download/downloadForm.php) with
Code: Select all
./configure --disable-shared CC=/dir to/devkitPPC/bin/powerpc-eabi-gcc --host=ppc --enable-singlethreaded RANLIB=/dir to/devkitPPC/bin/powerpc-eabi-ranlib CFLAGS="-DDEVKITPRO -DNO_WRITEV"
make src/libwolfssl.la
Code: Select all
LIBS := /dir to/wolfssl_root/src/.libs/libwolfssl.a
CFLAGS := -I/dir to/wolfssl_root/
Code: Select all
#include <gccore.h>
#include <wiiuse/wpad.h>
...
#include <wolfssl/options.h>
#include <wolfssl/wolfcrypt/aes.h>
/* function built and used by project with devkitPPC */
int foo() {
Aes aes;
byte key[] = {1, 2, …}; /* fill with desired key and iv */
byte iv[] = {1, 2, …};
byte cipher[AES-BLOCK-SIZE];
byte plain[AES-BLOCK-SIZE];
int ret;
ret = wc_AesSetKey(&aes, key, AES-BLOCK-SIZE, iv, AES_ENCRYPTION);
/* handle return value */
....
ret = wc_AesCbcEncrypt(&enc, cipher, msg, AES-BLOCK-SIZE);
/* handle return value */
....
return 0;
}