48 lines
2.1 KiB
Plaintext
Executable File
48 lines
2.1 KiB
Plaintext
Executable File
enclave {
|
|
|
|
include "wolfssl/wolfcrypt/settings.h"
|
|
include "wolfssl/wolfcrypt/types.h"
|
|
include "wolfssl/wolfcrypt/sha256.h"
|
|
include "wolfssl/wolfcrypt/aes.h"
|
|
include "wolfssl/wolfcrypt/rsa.h"
|
|
include "wolfssl/wolfcrypt/random.h"
|
|
|
|
|
|
trusted {
|
|
|
|
/* SHA 256 opperations
|
|
* Using user_check to increase performance, in copies over the buffer */
|
|
public int wc_sha256_init([user_check]Sha256* sha256);
|
|
public int wc_sha256_update([user_check]Sha256* sha256, [user_check]byte* buf, int bufSz);
|
|
public int wc_sha256_final([user_check]Sha256* sha256, [user_check]byte* digest);
|
|
|
|
|
|
/* AES GCM opperations
|
|
* Using user_check to increase performance */
|
|
public int wc_aesgcm_setKey([user_check]Aes* aes, [user_check]const byte* key, word32 len);
|
|
public int wc_aesgcm_encrypt([user_check]Aes* aes, [user_check]byte* out,
|
|
[user_check]const byte* in, word32 sz,
|
|
[user_check]const byte* iv, word32 ivSz,
|
|
[user_check]byte* authTag, word32 authTagSz,
|
|
[user_check]const byte* authIn, word32 authInSz);
|
|
public int wc_aesgcm_decrypt([user_check]Aes* aes, [user_check]byte* out,
|
|
[user_check]const byte* in, word32 sz,
|
|
[user_check]const byte* iv, word32 ivSz,
|
|
[user_check]const byte* authTag, word32 authTagSz,
|
|
[user_check]const byte* authIn, word32 authInSz);
|
|
|
|
|
|
/* RSA opperations
|
|
* Using user_check to increase performance */
|
|
public int wc_rsa_encrypt([user_check]const byte* m, word32 mSz, [user_check]byte* out, word32 outSz, [user_check]RsaKey* key);
|
|
public int wc_rsa_decrypt([user_check]const byte* in, word32 inSz, [user_check]byte* out, word32 mSz, [user_check]RsaKey* key);
|
|
public int wc_rsa_init([user_check]RsaKey* rsa);
|
|
public int wc_rsa_free([user_check]RsaKey* rsa);
|
|
};
|
|
|
|
untrusted {
|
|
/* define OCALLs here. */
|
|
|
|
};
|
|
};
|