Skip to content

Commit 521d073

Browse files
committed
fix typo
(cherry picked from commit 442bb90)
1 parent 035e958 commit 521d073

4 files changed

Lines changed: 9 additions & 9 deletions

File tree

doc/crypt.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2281,8 +2281,8 @@ \subsection{One--Shot Packet}
22812281
int direction);
22822282
\end{verbatim}
22832283
This will initialize the ChaCha20--Poly1305 state with the given key, IV and AAD value then proceed to
2284-
encrypt (\textit{direction} equals \textbf{CHCHA20POLY1305\_ENCRYPT}) or decrypt (\textit{direction} equals
2285-
\textbf{CHCHA20POLY1305\_DECRYPT}) the message text and store the final message tag. The definition of the
2284+
encrypt (\textit{direction} equals \textbf{CHACHA20POLY1305\_ENCRYPT}) or decrypt (\textit{direction} equals
2285+
\textbf{CHACHA20POLY1305\_DECRYPT}) the message text and store the final message tag. The definition of the
22862286
variables is the same as it is for all the manual functions.
22872287

22882288
\chapter{One-Way Cryptographic Hash Functions}

src/encauth/chachapoly/chacha20poly1305_memory.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
@param out The ciphertext
2525
@param tag [out] The MAC tag
2626
@param taglen [in/out] The MAC tag length
27-
@param direction Encrypt or Decrypt mode (CHCHA20POLY1305_ENCRYPT or CHCHA20POLY1305_DECRYPT)
27+
@param direction Encrypt or Decrypt mode (CHACHA20POLY1305_ENCRYPT or CHACHA20POLY1305_DECRYPT)
2828
@return CRYPT_OK on success
2929
*/
3030
int chacha20poly1305_memory(const unsigned char *key, unsigned long keylen,
@@ -49,10 +49,10 @@ int chacha20poly1305_memory(const unsigned char *key, unsigned long keylen,
4949
if (aad && aadlen > 0) {
5050
if ((err = chacha20poly1305_add_aad(&st, aad, aadlen)) != CRYPT_OK) { goto LBL_ERR; }
5151
}
52-
if (direction == CHCHA20POLY1305_ENCRYPT) {
52+
if (direction == CHACHA20POLY1305_ENCRYPT) {
5353
if ((err = chacha20poly1305_encrypt(&st, in, inlen, out)) != CRYPT_OK) { goto LBL_ERR; }
5454
}
55-
else if (direction == CHCHA20POLY1305_DECRYPT) {
55+
else if (direction == CHACHA20POLY1305_DECRYPT) {
5656
if ((err = chacha20poly1305_decrypt(&st, in, inlen, out)) != CRYPT_OK) { goto LBL_ERR; }
5757
}
5858
else {

src/encauth/chachapoly/chacha20poly1305_test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ int chacha20poly1305_test(void)
7171
/* chacha20poly1305_memory - encrypt */
7272
len = sizeof(emac);
7373
if ((err = chacha20poly1305_memory(k, sizeof(k), i12, sizeof(i12), aad, sizeof(aad), (unsigned char *)m,
74-
mlen, ct, emac, &len, CHCHA20POLY1305_ENCRYPT)) != CRYPT_OK) return err;
74+
mlen, ct, emac, &len, CHACHA20POLY1305_ENCRYPT)) != CRYPT_OK) return err;
7575
if (compare_testvector(ct, mlen, enc, sizeof(enc), "ENC-CT2", 1) != 0) return CRYPT_FAIL_TESTVECTOR;
7676
if (compare_testvector(emac, len, tag, sizeof(tag), "ENC-TAG2", 2) != 0) return CRYPT_FAIL_TESTVECTOR;
7777

7878
/* chacha20poly1305_memory - decrypt */
7979
len = sizeof(dmac);
8080
if ((err = chacha20poly1305_memory(k, sizeof(k), i12, sizeof(i12), aad, sizeof(aad),
81-
ct, mlen, pt, dmac, &len, CHCHA20POLY1305_DECRYPT)) != CRYPT_OK) return err;
81+
ct, mlen, pt, dmac, &len, CHACHA20POLY1305_DECRYPT)) != CRYPT_OK) return err;
8282
if (compare_testvector(pt, mlen, m, mlen, "DEC-PT2", 3) != 0) return CRYPT_FAIL_TESTVECTOR;
8383
if (compare_testvector(dmac, len, tag, sizeof(tag), "DEC-TAG2", 4) != 0) return CRYPT_FAIL_TESTVECTOR;
8484

src/headers/tomcrypt_mac.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,8 +542,8 @@ typedef struct {
542542
int aadflg;
543543
} chacha20poly1305_state;
544544

545-
#define CHCHA20POLY1305_ENCRYPT LTC_ENCRYPT
546-
#define CHCHA20POLY1305_DECRYPT LTC_DECRYPT
545+
#define CHACHA20POLY1305_ENCRYPT LTC_ENCRYPT
546+
#define CHACHA20POLY1305_DECRYPT LTC_DECRYPT
547547

548548
int chacha20poly1305_init(chacha20poly1305_state *st, const unsigned char *key, unsigned long keylen);
549549
int chacha20poly1305_setiv(chacha20poly1305_state *st, const unsigned char *iv, unsigned long ivlen);

0 commit comments

Comments
 (0)