Skip to content

Commit 1a014ed

Browse files
committed
Add KangarooTwelve XOF functions.
KangarooTwelve 128bits and KangarooTwelve 256 bits. https://keccak.team/files/TurboSHAKE.pdf https://www.rfc-editor.org/rfc/rfc9861.txt https://datatracker.ietf.org/doc/html/rfc9861
1 parent a468c52 commit 1a014ed

7 files changed

Lines changed: 325 additions & 7 deletions

File tree

doc/crypt.tex

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3143,6 +3143,21 @@ \subsection{TurboSHAKE}
31433143
The init function \code{turbo\_shake\_init()} is implemented as a macro which calls \code{sha3\_shake\_init()}.
31443144

31453145

3146+
\subsection{KangarooTwelve}
3147+
Another variation of SHA3 SHAKE is KangarooTwelve, which has been specified in \href{https://datatracker.ietf.org/doc/rfc9861/}{\texttt{RFC 9861}}.
3148+
3149+
The API works equivalent to the one of SHA3 SHAKE, where the APIs only have a different name. Additionally, KangarooTwelve supports customization. You can append any or none customization bytes after all input bytes and before squeezing any output digest bytes.
3150+
3151+
\begin{small}
3152+
\begin{verbatim}
3153+
int kt_init(hash_state *md, int num);
3154+
int kt_process(hash_state *md, const unsigned char *in, unsigned long inlen);
3155+
int kt_customization(hash_state *md, const unsigned char *in, unsigned long inlen);
3156+
int kt_done(hash_state *md, unsigned char *out, unsigned long outlen);
3157+
\end{verbatim}
3158+
\end{small}
3159+
3160+
31463161
\mysection{Extended Tiger API}
31473162

31483163
The Tiger and Tiger2 hash algorithms \url{http://www.cs.technion.ac.il/~biham/Reports/Tiger/} specify the possibility to run the algorithm with

src/hashes/sha3.c

Lines changed: 154 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -405,26 +405,26 @@ static LTC_INLINE int s_sha3_shake_concrete_done(struct sha3_state *sha3, unsign
405405
}
406406
return CRYPT_OK;
407407
}
408-
static LTC_INLINE int s_sha3_shake_done(hash_state *md, unsigned char *out, unsigned long outlen, process_fn proc_f)
408+
static LTC_INLINE int s_sha3_shake_done(hash_state *md, unsigned char *out, unsigned long outlen, unsigned char domain, process_fn proc_f)
409409
{
410410
LTC_ARGCHK(md != NULL);
411-
return s_sha3_shake_concrete_done(&md->sha3, out, outlen, 0x1f, proc_f);
411+
return s_sha3_shake_concrete_done(&md->sha3, out, outlen, domain, proc_f);
412412
}
413413

414414
int sha3_shake_done(hash_state *md, unsigned char *out, unsigned long outlen)
415415
{
416-
return s_sha3_shake_done(md, out, outlen, s_keccakf);
416+
return s_sha3_shake_done(md, out, outlen, 0x1f, s_keccakf);
417417
}
418418

419419
#if defined LTC_TURBO_SHAKE
420-
static LTC_INLINE int s_turbo_shake_concrete_done(struct sha3_state *sha3, unsigned char *out, unsigned long outlen)
420+
static LTC_INLINE int s_turbo_shake_concrete_done(struct sha3_state *sha3, unsigned char domain, unsigned char *out, unsigned long outlen)
421421
{
422-
return s_sha3_shake_concrete_done(sha3, out, outlen, 0x1f, s_keccak_turbo_f);
422+
return s_sha3_shake_concrete_done(sha3, out, outlen, domain, s_keccak_turbo_f);
423423
}
424424
int turbo_shake_done(hash_state *md, unsigned char *out, unsigned long outlen)
425425
{
426426
LTC_ARGCHK(md != NULL);
427-
return s_turbo_shake_concrete_done(&md->sha3, out, outlen);
427+
return s_turbo_shake_concrete_done(&md->sha3, 0x1f, out, outlen);
428428
}
429429
#endif
430430

@@ -442,4 +442,152 @@ int sha3_shake_memory(int num, const unsigned char *in, unsigned long inlen, uns
442442
}
443443
#endif
444444

445+
#ifdef LTC_KT
446+
447+
static const unsigned char kt_filler[] = { 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
448+
449+
int kt_init(hash_state *md, int num)
450+
{
451+
int err;
452+
453+
LTC_ARGCHK(md != NULL);
454+
LTC_ARGCHK(num == 128 || num == 256);
455+
456+
if ((err = s_sha3_shake_concrete_init(&md->kt.outer, num)) != CRYPT_OK) return err;
457+
if ((err = s_sha3_shake_concrete_init(&md->kt.inner, num)) != CRYPT_OK) return err;
458+
md->kt.blocks_count = 0;
459+
md->kt.customization_len = 0;
460+
md->kt.remaining = 8 * 1024;
461+
md->kt.phase = 0;
462+
md->kt.finished = 0;
463+
return CRYPT_OK;
464+
}
465+
466+
static LTC_INLINE int s_kt_process(hash_state *md, const unsigned char *in, unsigned long inlen)
467+
{
468+
unsigned long rem;
469+
unsigned long amount;
470+
int err;
471+
int variant;
472+
int digest_len;
473+
unsigned char digest_buf[64];
474+
475+
LTC_ARGCHK(md != NULL);
476+
LTC_ARGCHK(in != NULL || inlen == 0);
477+
478+
if (md->kt.phase == 0)
479+
{
480+
rem = md->kt.remaining;
481+
amount = rem < inlen ? rem : inlen;
482+
md->kt.remaining -= amount;
483+
if ((err = s_turbo_shake_concrete_process(&md->kt.outer, in, amount)) != CRYPT_OK) return err;
484+
in += amount;
485+
inlen -= amount;
486+
if (md->kt.remaining == 0 && inlen != 0)
487+
{
488+
md->kt.remaining = 8 * 1024;
489+
md->kt.phase = 1;
490+
md->kt.blocks_count += 1;
491+
if ((err = s_turbo_shake_concrete_process(&md->kt.outer, &kt_filler[0], sizeof(kt_filler))) != CRYPT_OK) return err;
492+
}
493+
}
494+
if (md->kt.phase == 1)
495+
{
496+
do
497+
{
498+
rem = md->kt.remaining;
499+
amount = rem < inlen ? rem : inlen;
500+
md->kt.remaining -= amount;
501+
if ((err = s_turbo_shake_concrete_process(&md->kt.inner, in, amount)) != CRYPT_OK) return err;
502+
in += amount;
503+
inlen -= amount;
504+
if (md->kt.remaining == 0 && inlen != 0)
505+
{
506+
md->kt.remaining = 8 * 1024;
507+
md->kt.blocks_count += 1;
508+
assert(md->kt.outer.capacity_words == 4 || md->kt.outer.capacity_words == 8);
509+
variant = md->kt.outer.capacity_words == 4 ? 128 : 256;
510+
digest_len = variant == 128 ? 32 : 64;
511+
if ((err = s_turbo_shake_concrete_done(&md->kt.inner, 0x0b, &digest_buf[0], digest_len)) != CRYPT_OK) return err;
512+
if ((err = s_turbo_shake_concrete_init(&md->kt.inner, variant)) != CRYPT_OK) return err;
513+
if ((err = s_turbo_shake_concrete_process(&md->kt.outer, &digest_buf[0], digest_len)) != CRYPT_OK) return err;
514+
}
515+
} while (inlen != 0);
516+
}
517+
return CRYPT_OK;
518+
}
519+
520+
int kt_process(hash_state *md, const unsigned char *in, unsigned long inlen)
521+
{
522+
LTC_ARGCHK(md != NULL);
523+
LTC_ARGCHK(in != NULL || inlen == 0);
524+
LTC_ARGCHK(md->kt.customization_len == 0);
525+
LTC_ARGCHK(md->kt.finished == 0);
526+
527+
return s_kt_process(md, in, inlen);
528+
}
529+
530+
int kt_customization(hash_state *md, const unsigned char *in, unsigned long inlen)
531+
{
532+
LTC_ARGCHK(md != NULL);
533+
LTC_ARGCHK(in != NULL || inlen == 0);
534+
LTC_ARGCHK(md->kt.finished == 0);
535+
536+
md->kt.customization_len += inlen;
537+
return s_kt_process(md, in, inlen);
538+
}
539+
540+
int kt_done(hash_state *md, unsigned char *out, unsigned long outlen)
541+
{
542+
int couner_len;
543+
unsigned char couner_buf[sizeof(unsigned long) + 1];
544+
int err;
545+
int variant;
546+
int digest_len;
547+
unsigned char digest_buf[64];
548+
unsigned char ffff[2];
549+
unsigned char domain;
550+
551+
LTC_ARGCHK(md != NULL);
552+
LTC_ARGCHK(out != NULL || outlen == 0);
553+
554+
if (md->kt.finished == 0)
555+
{
556+
md->kt.finished = 1;
557+
couner_len = 0;
558+
while (md->kt.customization_len != 0)
559+
{
560+
couner_buf[sizeof(couner_buf) - 1 - 1 - couner_len] = md->kt.customization_len & 0xff;
561+
md->kt.customization_len >>= 8;
562+
++couner_len;
563+
}
564+
couner_buf[sizeof(couner_buf) - 1] = couner_len;
565+
if ((err = s_kt_process(md, &couner_buf[sizeof(couner_buf) - 1 - couner_len], couner_len + 1)) != CRYPT_OK) return err;
566+
if(md->kt.phase != 0)
567+
{
568+
assert(md->kt.outer.capacity_words == 4 || md->kt.outer.capacity_words == 8);
569+
variant = md->kt.outer.capacity_words == 4 ? 128 : 256;
570+
digest_len = variant == 128 ? 32 : 64;
571+
if ((err = s_turbo_shake_concrete_done(&md->kt.inner, 0x0b, &digest_buf[0], digest_len)) != CRYPT_OK) return err;
572+
if ((err = s_turbo_shake_concrete_process(&md->kt.outer, &digest_buf[0], digest_len)) != CRYPT_OK) return err;
573+
couner_len = 0;
574+
while (md->kt.blocks_count != 0)
575+
{
576+
couner_buf[sizeof(couner_buf) - 1 - 1 - couner_len] = md->kt.blocks_count & 0xff;
577+
md->kt.blocks_count >>= 8;
578+
++couner_len;
579+
}
580+
couner_buf[sizeof(couner_buf) - 1] = couner_len;
581+
if ((err = s_turbo_shake_concrete_process(&md->kt.outer, &couner_buf[sizeof(couner_buf) - 1 - couner_len], couner_len + 1)) != CRYPT_OK) return err;
582+
ffff[0] = 0xff;
583+
ffff[1] = 0xff;
584+
if ((err = s_turbo_shake_concrete_process(&md->kt.outer, &ffff[0], sizeof(ffff))) != CRYPT_OK) return err;
585+
}
586+
}
587+
domain = md->kt.phase == 0 ? 0x07 : 0x06;
588+
return s_sha3_shake_done(md, out, outlen, domain, s_keccak_turbo_f);
589+
}
590+
591+
#endif
592+
445593
#endif

src/hashes/sha3_test.c

Lines changed: 126 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ int sha3_shake_test(void)
389389
#endif
390390
}
391391

392-
#if defined LTC_TURBO_SHAKE
392+
#if defined LTC_TURBO_SHAKE || defined LTC_KT
393393
static LTC_INLINE int s_turbo_shake_generate_ptn(unsigned char* buffer, long offset, long amount)
394394
{
395395
long i;
@@ -518,6 +518,131 @@ int turbo_shake_test(void)
518518
}
519519
#endif
520520

521+
#ifdef LTC_KT
522+
static LTC_INLINE int s_kt_test_one(int bits_count, int is_ptn, long input_bytes_count, long customization_bytes_count, long skip_digest_bytes, long digest_bytes_count, int counter, char const *expected_digest_hex)
523+
{
524+
int err;
525+
hash_state md;
526+
long offset;
527+
long rem;
528+
long count;
529+
unsigned char input[1024];
530+
unsigned char digest[64];
531+
char const *expected_hex;
532+
unsigned char expected_digest_bin[sizeof(digest)];
533+
534+
LTC_ARGCHK(bits_count == 128 || bits_count == 256);
535+
LTC_ARGCHK(is_ptn == 0 || is_ptn == 1);
536+
LTC_ARGCHK(input_bytes_count >= 0);
537+
LTC_ARGCHK(customization_bytes_count >= 0);
538+
LTC_ARGCHK(skip_digest_bytes >= 0);
539+
LTC_ARGCHK(digest_bytes_count >= 1);
540+
LTC_ARGCHK(counter >= 0);
541+
LTC_ARGCHK(expected_digest_hex && expected_digest_hex[0] != '\0');
542+
543+
if ((err = kt_init(&md, bits_count)) != CRYPT_OK) return err;
544+
offset = 0;
545+
rem = input_bytes_count;
546+
do
547+
{
548+
count = rem < ((long)(sizeof(input))) ? rem : ((long)(sizeof(input)));
549+
if (is_ptn)
550+
{
551+
if ((err = s_turbo_shake_generate_ptn(&input[0], offset, count)) != CRYPT_OK) return err;
552+
}
553+
else
554+
{
555+
XMEMSET(&input[0], 0xff, count);
556+
}
557+
if ((err = kt_process(&md, &input[0], count)) != CRYPT_OK) return err;
558+
offset += count;
559+
rem -= count;
560+
}while(rem != 0);
561+
offset = 0;
562+
rem = customization_bytes_count;
563+
do
564+
{
565+
count = rem < ((long)(sizeof(input))) ? rem : ((long)(sizeof(input)));
566+
if ((err = s_turbo_shake_generate_ptn(&input[0], offset, count)) != CRYPT_OK) return err;
567+
if ((err = kt_customization(&md, &input[0], count)) != CRYPT_OK) return err;
568+
offset += count;
569+
rem -= count;
570+
}while(rem != 0);
571+
rem = skip_digest_bytes;
572+
do
573+
{
574+
count = rem < ((long)(sizeof(digest))) ? rem : ((long)(sizeof(digest)));
575+
if ((err = kt_done(&md, &digest[0], count)) != CRYPT_OK) return err;
576+
rem -= count;
577+
}while(rem != 0);
578+
rem = digest_bytes_count;
579+
expected_hex = expected_digest_hex;
580+
do
581+
{
582+
count = rem < ((long)(sizeof(digest))) ? rem : ((long)(sizeof(digest)));
583+
if ((err = s_turbo_shake_hex_to_bin(&expected_hex[0], &expected_digest_bin[0], count)) != CRYPT_OK) return err;
584+
if ((err = kt_done(&md, &digest[0], count)) != CRYPT_OK) return err;
585+
LTC_COMPARE_TESTVECTOR(digest, count, expected_digest_bin, count, "KangarooTwelve", counter);
586+
rem -= count;
587+
expected_hex += count * 2;
588+
}while(rem != 0);
589+
return CRYPT_OK;
590+
}
591+
#endif
592+
593+
#ifdef LTC_KT
594+
int kt_test(void)
595+
{
596+
#ifndef LTC_TEST
597+
return CRYPT_NOP;
598+
#else
599+
int counter;
600+
601+
/* https://datatracker.ietf.org/doc/html/rfc9861#name-test-vectors */
602+
/* https://www.rfc-editor.org/rfc/rfc9861.txt */
603+
604+
counter = 1;
605+
DO(( s_kt_test_one(128, 1, 0, 0, 0, 32, counter++, "1ac2d450fc3b4205d19da7bfca1b37513c0803577ac7167f06fe2ce1f0ef39e5") ));
606+
DO(( s_kt_test_one(128, 1, 0, 0, 0, 64, counter++, "1ac2d450fc3b4205d19da7bfca1b37513c0803577ac7167f06fe2ce1f0ef39e54269c056b8c82e48276038b6d292966cc07a3d4645272e31ff38508139eb0a71") ));
607+
DO(( s_kt_test_one(128, 1, 0, 0, 10000, 32, counter++, "e8dc563642f7228c84684c898405d3a834799158c079b12880277a1d28e2ff6d") ));
608+
DO(( s_kt_test_one(128, 1, 1, 0, 0, 32, counter++, "2bda92450e8b147f8a7cb629e784a058efca7cf7d8218e02d345dfaa65244a1f") ));
609+
DO(( s_kt_test_one(128, 1, 17, 0, 0, 32, counter++, "6bf75fa2239198db4772e36478f8e19b0f371205f6a9a93a273f51df37122888") ));
610+
DO(( s_kt_test_one(128, 1, 17*17, 0, 0, 32, counter++, "0c315ebcdedbf61426de7dcf8fb725d1e74675d7f5327a5067f367b108ecb67c") ));
611+
DO(( s_kt_test_one(128, 1, 17*17*17, 0, 0, 32, counter++, "cb552e2ec77d9910701d578b457ddf772c12e322e4ee7fe417f92c758f0d59d0") ));
612+
DO(( s_kt_test_one(128, 1, 17*17*17*17, 0, 0, 32, counter++, "8701045e22205345ff4dda05555cbb5c3af1a771c2b89baef37db43d9998b9fe") ));
613+
DO(( s_kt_test_one(128, 1, 17*17*17*17*17, 0, 0, 32, counter++, "844d610933b1b9963cbdeb5ae3b6b05cc7cbd67ceedf883eb678a0a8e0371682") ));
614+
DO(( s_kt_test_one(128, 1, 17*17*17*17*17*17, 0, 0, 32, counter++, "3c390782a8a4e89fa6367f72feaaf13255c8d95878481d3cd8ce85f58e880af8") ));
615+
DO(( s_kt_test_one(128, 1, 0, 1, 0, 32, counter++, "fab658db63e94a246188bf7af69a133045f46ee984c56e3c3328caaf1aa1a583") ));
616+
DO(( s_kt_test_one(128, 0, 1, 41, 0, 32, counter++, "d848c5068ced736f4462159b9867fd4c20b808acc3d5bc48e0b06ba0a3762ec4") ));
617+
DO(( s_kt_test_one(128, 0, 3, 41*41, 0, 32, counter++, "c389e5009ae57120854c2e8c64670ac01358cf4c1baf89447a724234dc7ced74") ));
618+
DO(( s_kt_test_one(128, 0, 7, 41*41*41, 0, 32, counter++, "75d2f86a2e644566726b4fbcfc5657b9dbcf070c7b0dca06450ab291d7443bcf") ));
619+
DO(( s_kt_test_one(128, 1, 8191, 0, 0, 32, counter++, "1b577636f723643e990cc7d6a659837436fd6a103626600eb8301cd1dbe553d6") ));
620+
DO(( s_kt_test_one(128, 1, 8192, 0, 0, 32, counter++, "48f256f6772f9edfb6a8b661ec92dc93b95ebd05a08a17b39ae3490870c926c3") ));
621+
DO(( s_kt_test_one(128, 1, 8192, 8189, 0, 32, counter++, "3ed12f70fb05ddb58689510ab3e4d23c6c6033849aa01e1d8c220a297fedcd0b") ));
622+
DO(( s_kt_test_one(128, 1, 8192, 8190, 0, 32, counter++, "6a7c1b6a5cd0d8c9ca943a4a216cc64604559a2ea45f78570a15253d67ba00ae") ));
623+
DO(( s_kt_test_one(256, 1, 0, 0, 0, 64, counter++, "b23d2e9cea9f4904e02bec06817fc10ce38ce8e93ef4c89e6537076af8646404e3e8b68107b8833a5d30490aa33482353fd4adc7148ecb782855003aaebde4a9") ));
624+
DO(( s_kt_test_one(256, 1, 0, 0, 0, 128, counter++, "b23d2e9cea9f4904e02bec06817fc10ce38ce8e93ef4c89e6537076af8646404e3e8b68107b8833a5d30490aa33482353fd4adc7148ecb782855003aaebde4a9b0925319d8ea1e121a609821ec19efea89e6d08daee1662b69c840289f188ba860f55760b61f82114c030c97e5178449608ccd2cd2d919fc7829ff69931ac4d0") ));
625+
DO(( s_kt_test_one(256, 1, 0, 0, 10000, 64, counter++, "ad4a1d718cf950506709a4c33396139b4449041fc79a05d68da35f1e453522e056c64fe94958e7085f2964888259b9932752f3ccd855288efee5fcbb8b563069") ));
626+
DO(( s_kt_test_one(256, 1, 1, 0, 0, 64, counter++, "0d005a194085360217128cf17f91e1f71314efa5564539d444912e3437efa17f82db6f6ffe76e781eaa068bce01f2bbf81eacb983d7230f2fb02834a21b1ddd0") ));
627+
DO(( s_kt_test_one(256, 1, 17, 0, 0, 64, counter++, "1ba3c02b1fc514474f06c8979978a9056c8483f4a1b63d0dccefe3a28a2f323e1cdcca40ebf006ac76ef0397152346837b1277d3e7faa9c9653b19075098527b") ));
628+
DO(( s_kt_test_one(256, 1, 17*17, 0, 0, 64, counter++, "de8ccbc63e0f133ebb4416814d4c66f691bbf8b6a61ec0a7700f836b086cb029d54f12ac7159472c72db118c35b4e6aa213c6562caaa9dcc518959e69b10f3ba") ));
629+
DO(( s_kt_test_one(256, 1, 17*17*17, 0, 0, 64, counter++, "647efb49fe9d717500171b41e7f11bd491544443209997ce1c2530d15eb1ffbb598935ef954528ffc152b1e4d731ee2683680674365cd191d562bae753b84aa5") ));
630+
DO(( s_kt_test_one(256, 1, 17*17*17*17, 0, 0, 64, counter++, "b06275d284cd1cf205bcbe57dccd3ec1ff6686e3ed15776383e1f2fa3c6ac8f08bf8a162829db1a44b2a43ff83dd89c3cf1ceb61ede659766d5ccf817a62ba8d") ));
631+
DO(( s_kt_test_one(256, 1, 17*17*17*17*17, 0, 0, 64, counter++, "9473831d76a4c7bf77ace45b59f1458b1673d64bcd877a7c66b2664aa6dd149e60eab71b5c2bab858c074ded81ddce2b4022b5215935c0d4d19bf511aeeb0772") ));
632+
DO(( s_kt_test_one(256, 1, 17*17*17*17*17*17, 0, 0, 64, counter++, "0652b740d78c5e1f7c8dcc1777097382768b7ff38f9a7a20f29f413bb1b3045b31a5578f568f911e09cf44746da84224a5266e96a4a535e871324e4f9c7004da") ));
633+
DO(( s_kt_test_one(256, 1, 0, 1, 0, 64, counter++, "9280f5cc39b54a5a594ec63de0bb99371e4609d44bf845c2f5b8c316d72b159811f748f23e3fabbe5c3226ec96c62186df2d33e9df74c5069ceecbb4dd10eff6") ));
634+
DO(( s_kt_test_one(256, 0, 1, 41, 0, 64, counter++, "47ef96dd616f200937aa7847e34ec2feae8087e3761dc0f8c1a154f51dc9ccf845d7adbce57ff64b639722c6a1672e3bf5372d87e00aff89be97240756998853") ));
635+
DO(( s_kt_test_one(256, 0, 3, 41*41, 0, 64, counter++, "3b48667a5051c5966c53c5d42b95de451e05584e7806e2fb765eda959074172cb438a9e91dde337c98e9c41bed94c4e0aef431d0b64ef2324f7932caa6f54969") ));
636+
DO(( s_kt_test_one(256, 0, 7, 41*41*41, 0, 64, counter++, "e0911cc00025e1540831e266d94add9b98712142b80d2629e643aac4efaf5a3a30a88cbf4ac2a91a2432743054fbcc9897670e86ba8cec2fc2ace9c966369724") ));
637+
DO(( s_kt_test_one(256, 1, 8191, 0, 0, 64, counter++, "3081434d93a4108d8d8a3305b89682cebedc7ca4ea8a3ce869fbb73cbe4a58eef6f24de38ffc170514c70e7ab2d01f03812616e863d769afb3753193ba045b20") ));
638+
DO(( s_kt_test_one(256, 1, 8192, 0, 0, 64, counter++, "c6ee8e2ad3200c018ac87aaa031cdac22121b412d07dc6e0dccbb53423747e9a1c18834d99df596cf0cf4b8dfafb7bf02d139d0c9035725adc1a01b7230a41fa") ));
639+
DO(( s_kt_test_one(256, 1, 8192, 8189, 0, 64, counter++, "74e47879f10a9c5d11bd2da7e194fe57e86378bf3c3f7448eff3c576a0f18c5caae0999979512090a7f348af4260d4de3c37f1ecaf8d2c2c96c1d16c64b12496") ));
640+
DO(( s_kt_test_one(256, 1, 8192, 8190, 0, 64, counter++, "f4b5908b929ffe01e0f79ec2f21243d41a396b2e7303a6af1d6399cd6c7a0a2dd7c4f607e8277f9c9b1cb4ab9ddc59d4b92d1fc7558441f1832c3279a4241b8b") ));
641+
return CRYPT_OK;
642+
#endif
643+
}
644+
#endif
645+
521646
#endif
522647

523648
#ifdef LTC_KECCAK

src/headers/tomcrypt_custom.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@
259259
#define LTC_SHA3
260260
#define LTC_KECCAK
261261
#define LTC_TURBO_SHAKE
262+
#define LTC_KT
262263
#define LTC_SHA512
263264
#define LTC_SHA512_256
264265
#define LTC_SHA512_224

0 commit comments

Comments
 (0)