Skip to content

Commit d689f0f

Browse files
committed
encrypt/decrypt function descriptions
1 parent c145ed1 commit d689f0f

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

src/ECCX08.cpp

+32
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,22 @@ int ECCX08Class::ecdh(int slot, byte mode, const byte pubKeyXandY[], byte output
354354
return 1;
355355
}
356356

357+
/** \brief AES_GCM encryption function, see
358+
* NIST Special Publication 800-38D
359+
* 7.1, using TempKey.
360+
*
361+
* \param[out] IV Initialization vector
362+
* (12 bytes)
363+
* \param[in] ad Associated data
364+
* \param[in] pt Plaintext
365+
* \param[out] ct Ciphertext
366+
* \param[out] tag Authentication tag
367+
* (16 bytes)
368+
* \param[in] adLength The length of ad
369+
* \param[in] ptLength The length of pt
370+
*
371+
* \return 1 on success, otherwise 0.
372+
*/
357373
int ECCX08Class::AESEncrypt(byte IV[], byte ad[], byte pt[], byte ct[], byte tag[], const uint64_t adLength, const uint64_t ptLength)
358374
{
359375
byte H[16] = {0x00};
@@ -415,6 +431,22 @@ int ECCX08Class::AESEncrypt(byte IV[], byte ad[], byte pt[], byte ct[], byte tag
415431
return 1;
416432
}
417433

434+
/** \brief AES_GCM decryption function, see
435+
* NIST Special Publication 800-38D
436+
* 7.2, using TempKey.
437+
*
438+
* \param[in] IV Initialization vector
439+
* (12 bytes)
440+
* \param[in] ad Associated data
441+
* \param[out] pt Plaintext
442+
* \param[in] ct Ciphertext
443+
* \param[in] tag Authentication tag
444+
* (16 bytes)
445+
* \param[in] adLength The length of ad
446+
* \param[in] ctLength The length of ct
447+
*
448+
* \return 1 on success, otherwise 0.
449+
*/
418450
int ECCX08Class::AESDecrypt(byte IV[], byte ad[], byte pt[], byte ct[], byte tag[], const uint64_t adLength, const uint64_t ctLength)
419451
{
420452
uint64_t maxLength = 1ull << 36;

0 commit comments

Comments
 (0)