My Project
aes.h
Go to the documentation of this file.
1 
32 int wc_AesSetKey(Aes* aes, const byte* key, word32 len,
33  const byte* iv, int dir);
34 
62 int wc_AesSetIV(Aes* aes, const byte* iv);
63 
110 int wc_AesCbcEncrypt(Aes* aes, byte* out,
111  const byte* in, word32 sz);
112 
159 int wc_AesCbcDecrypt(Aes* aes, byte* out,
160  const byte* in, word32 sz);
161 
204 int wc_AesCtrEncrypt(Aes* aes, byte* out,
205  const byte* in, word32 sz);
206 
238 int wc_AesEncryptDirect(Aes* aes, byte* out, const byte* in);
239 
272 int wc_AesDecryptDirect(Aes* aes, byte* out, const byte* in);
273 
312 int wc_AesSetKeyDirect(Aes* aes, const byte* key, word32 len,
313  const byte* iv, int dir);
314 
342 int wc_AesGcmSetKey(Aes* aes, const byte* key, word32 len);
343 
387 int wc_AesGcmEncrypt(Aes* aes, byte* out,
388  const byte* in, word32 sz,
389  const byte* iv, word32 ivSz,
390  byte* authTag, word32 authTagSz,
391  const byte* authIn, word32 authInSz);
392 
436 int wc_AesGcmDecrypt(Aes* aes, byte* out,
437  const byte* in, word32 sz,
438  const byte* iv, word32 ivSz,
439  const byte* authTag, word32 authTagSz,
440  const byte* authIn, word32 authInSz);
441 
463 int wc_GmacSetKey(Gmac* gmac, const byte* key, word32 len);
464 
499 int wc_GmacUpdate(Gmac* gmac, const byte* iv, word32 ivSz,
500  const byte* authIn, word32 authInSz,
501  byte* authTag, word32 authTagSz);
502 
526 int wc_AesCcmSetKey(Aes* aes, const byte* key, word32 keySz);
527 
571 int wc_AesCcmEncrypt(Aes* aes, byte* out,
572  const byte* in, word32 inSz,
573  const byte* nonce, word32 nonceSz,
574  byte* authTag, word32 authTagSz,
575  const byte* authIn, word32 authInSz);
576 
626 int wc_AesCcmDecrypt(Aes* aes, byte* out,
627  const byte* in, word32 inSz,
628  const byte* nonce, word32 nonceSz,
629  const byte* authTag, word32 authTagSz,
630  const byte* authIn, word32 authInSz);
631 
664 int wc_AesXtsSetKey(XtsAes* aes, const byte* key,
665  word32 len, int dir, void* heap, int devId);
666 
703 int wc_AesXtsEncryptSector(XtsAes* aes, byte* out,
704  const byte* in, word32 sz, word64 sector);
705 
742 int wc_AesXtsDecryptSector(XtsAes* aes, byte* out,
743  const byte* in, word32 sz, word64 sector);
744 
782 int wc_AesXtsEncrypt(XtsAes* aes, byte* out,
783  const byte* in, word32 sz, const byte* i, word32 iSz);
784 
821 int wc_AesXtsDecrypt(XtsAes* aes, byte* out,
822  const byte* in, word32 sz, const byte* i, word32 iSz);
823 
848 int wc_AesXtsFree(XtsAes* aes);
849 
850 
875 int wc_AesInit(Aes* aes, void* heap, int devId);
876 
907 int wc_AesCfbEncrypt(Aes* aes, byte* out, const byte* in, word32 sz);
908 
939 int wc_AesCfbDecrypt(Aes* aes, byte* out, const byte* in, word32 sz);
940 
984 int wc_AesSivEncrypt(const byte* key, word32 keySz, const byte* assoc,
985  word32 assocSz, const byte* nonce, word32 nonceSz,
986  const byte* in, word32 inSz, byte* siv, byte* out);
987 
1031 int wc_AesSivDecrypt(const byte* key, word32 keySz, const byte* assoc,
1032  word32 assocSz, const byte* nonce, word32 nonceSz,
1033  const byte* in, word32 inSz, byte* siv, byte* out);
wc_AesCfbEncrypt
int wc_AesCfbEncrypt(Aes *aes, byte *out, const byte *in, word32 sz)
AES with CFB mode.
wc_GmacUpdate
int wc_GmacUpdate(Gmac *gmac, const byte *iv, word32 ivSz, const byte *authIn, word32 authInSz, byte *authTag, word32 authTagSz)
This function generates the Gmac hash of the authIn input and stores the result in the authTag buffer...
wc_AesXtsEncrypt
int wc_AesXtsEncrypt(XtsAes *aes, byte *out, const byte *in, word32 sz, const byte *i, word32 iSz)
AES with XTS mode. (XTS) XEX encryption with Tweak and cipher text Stealing.
wc_AesXtsFree
int wc_AesXtsFree(XtsAes *aes)
This is to free up any resources used by the XtsAes structure.
wc_AesXtsDecryptSector
int wc_AesXtsDecryptSector(XtsAes *aes, byte *out, const byte *in, word32 sz, word64 sector)
Same process as wc_AesXtsDecrypt but uses a word64 type as the tweak value instead of a byte array....
wc_AesCbcEncrypt
int wc_AesCbcEncrypt(Aes *aes, byte *out, const byte *in, word32 sz)
Encrypts a plaintext message from the input buffer in, and places the resulting cipher text in the ou...
wc_AesCcmDecrypt
int wc_AesCcmDecrypt(Aes *aes, byte *out, const byte *in, word32 inSz, const byte *nonce, word32 nonceSz, const byte *authTag, word32 authTagSz, const byte *authIn, word32 authInSz)
This function decrypts the input cipher text, in, into the output buffer, out, using CCM (Counter wit...
wc_AesCtrEncrypt
int wc_AesCtrEncrypt(Aes *aes, byte *out, const byte *in, word32 sz)
Encrypts/Decrypts a message from the input buffer in, and places the resulting cipher text in the out...
wc_AesSivEncrypt
int wc_AesSivEncrypt(const byte *key, word32 keySz, const byte *assoc, word32 assocSz, const byte *nonce, word32 nonceSz, const byte *in, word32 inSz, byte *siv, byte *out)
This function performs SIV (synthetic initialization vector) encryption as described in RFC 5297.
wc_AesDecryptDirect
int wc_AesDecryptDirect(Aes *aes, byte *out, const byte *in)
This function is a one-block decrypt of the input block, in, into the output block,...
wc_AesCfbDecrypt
int wc_AesCfbDecrypt(Aes *aes, byte *out, const byte *in, word32 sz)
AES with CFB mode.
wc_AesXtsDecrypt
int wc_AesXtsDecrypt(XtsAes *aes, byte *out, const byte *in, word32 sz, const byte *i, word32 iSz)
Same process as encryption but Aes key is AES_DECRYPTION type.
wc_AesGcmDecrypt
int wc_AesGcmDecrypt(Aes *aes, byte *out, const byte *in, word32 sz, const byte *iv, word32 ivSz, const byte *authTag, word32 authTagSz, const byte *authIn, word32 authInSz)
This function decrypts the input cipher text, held in the buffer in, and stores the resulting message...
wc_AesInit
int wc_AesInit(Aes *aes, void *heap, int devId)
Initialize Aes structure. Sets heap hint to be used and ID for use with async hardware.
wc_AesCbcDecrypt
int wc_AesCbcDecrypt(Aes *aes, byte *out, const byte *in, word32 sz)
Decrypts a cipher from the input buffer in, and places the resulting plain text in the output buffer ...
wc_GmacSetKey
int wc_GmacSetKey(Gmac *gmac, const byte *key, word32 len)
This function initializes and sets the key for a GMAC object to be used for Galois Message Authentica...
wc_AesXtsSetKey
int wc_AesXtsSetKey(XtsAes *aes, const byte *key, word32 len, int dir, void *heap, int devId)
This is to help with setting keys to correct encrypt or decrypt type. It is up to user to call wc_Aes...
wc_AesCcmEncrypt
int wc_AesCcmEncrypt(Aes *aes, byte *out, const byte *in, word32 inSz, const byte *nonce, word32 nonceSz, byte *authTag, word32 authTagSz, const byte *authIn, word32 authInSz)
This function encrypts the input message, in, into the output buffer, out, using CCM (Counter with CB...
wc_AesSetIV
int wc_AesSetIV(Aes *aes, const byte *iv)
This function sets the initialization vector for a particular AES object. The AES object should be in...
wc_AesGcmSetKey
int wc_AesGcmSetKey(Aes *aes, const byte *key, word32 len)
This function is used to set the key for AES GCM (Galois/Counter Mode). It initializes an AES object ...
wc_AesGcmEncrypt
int wc_AesGcmEncrypt(Aes *aes, byte *out, const byte *in, word32 sz, const byte *iv, word32 ivSz, byte *authTag, word32 authTagSz, const byte *authIn, word32 authInSz)
This function encrypts the input message, held in the buffer in, and stores the resulting cipher text...
wc_AesSivDecrypt
int wc_AesSivDecrypt(const byte *key, word32 keySz, const byte *assoc, word32 assocSz, const byte *nonce, word32 nonceSz, const byte *in, word32 inSz, byte *siv, byte *out)
This function performs SIV (synthetic initialization vector) decryption as described in RFC 5297.
wc_AesSetKey
int wc_AesSetKey(Aes *aes, const byte *key, word32 len, const byte *iv, int dir)
This function initializes an AES structure by setting the key and then setting the initialization vec...
wc_AesSetKeyDirect
int wc_AesSetKeyDirect(Aes *aes, const byte *key, word32 len, const byte *iv, int dir)
This function is used to set the AES keys for CTR mode with AES. It initializes an AES object with th...
wc_AesXtsEncryptSector
int wc_AesXtsEncryptSector(XtsAes *aes, byte *out, const byte *in, word32 sz, word64 sector)
Same process as wc_AesXtsEncrypt but uses a word64 type as the tweak value instead of a byte array....
wc_AesEncryptDirect
int wc_AesEncryptDirect(Aes *aes, byte *out, const byte *in)
This function is a one-block encrypt of the input block, in, into the output block,...
wc_AesCcmSetKey
int wc_AesCcmSetKey(Aes *aes, const byte *key, word32 keySz)
This function sets the key for an AES object using CCM (Counter with CBC-MAC). It takes a pointer to ...