Overview
Comment: | Updated SHAKE128 and SHAKE256 test cases |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | crypto |
Files: | files | file ages | folders |
SHA3-256: |
c0f29458a6bfa4f4a80b2e76caebc735 |
User & Date: | bohagan on 2024-03-14 00:30:32 |
Other Links: | branch diff | manifest | tags |
Context
2024-03-14
| ||
01:09 | Updated documentation to add XOF use of -length arg check-in: 5d50e20efb user: bohagan tags: crypto | |
00:30 | Updated SHAKE128 and SHAKE256 test cases check-in: c0f29458a6 user: bohagan tags: crypto | |
2024-03-13
| ||
23:07 | Finished SHAKE128 and SHAKE256 XOF hash functions by adding optional -length arg to set output length. check-in: 59eac2fc22 user: bohagan tags: crypto | |
Changes
Modified tests/digest.csv from [f8d5498d86] to [62013deed8].
︙ | |||
31 32 33 34 35 36 37 | 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | - + | ",,,,,,,,, command,"proc digest_accumulate {string args} { set cmd [{*}$args -command dcmd] $cmd update [string range $string 0 20] $cmd update [string range $string 21 end] return [$cmd finalize] } |
︙ | |||
105 106 107 108 109 110 111 | 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | - + | ,,,,,,,,,, command,# MD Error Cases,,,,,,,,, MD Errors,Too few args,,,::tls::md,,,"wrong # args: should be ""::tls::md ?-bin|-hex? ?-cipher name? ?-digest name? ?-key key? ?-mac name? [-channel chan | -command cmdName | -file filename | ?-data? data]""",,,1 MD Errors,Too many args,,,::tls::md too many command line args to pass the test without an error or failing,,,"wrong # args: should be ""::tls::md ?-bin|-hex? ?-cipher name? ?-digest name? ?-key key? ?-mac name? [-channel chan | -command cmdName | -file filename | ?-data? data]""",,,1 MD Errors,Invalid digest,,,::tls::md bogus data,,,"invalid digest ""bogus""",,,1 MD Errors,Invalid digest Arg,,,::tls::md -digest bogus -data data,,,"invalid digest ""bogus""",,,1 MD Errors,No digest,,,::tls::md -hex -data value,,,no digest,,,1 |
︙ |
Modified tests/digest.test from [141e7b6f90] to [e9e6e071d9].
︙ | |||
275 276 277 278 279 280 281 | 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 | - + | test MD_Errors-8.5 {No digest} -body { ::tls::md -hex -data value } -result {no digest} -returnCodes {1} test MD_Errors-8.6 {Invalid option} -body { ::tls::md -digest sha256 -bogus value |
︙ |
Modified tests/test_vectors/Hash/SHAKE128.test from [4b0878e01e] to [1d727205ad].
1 2 3 4 5 6 7 8 9 10 11 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | - + - + - + | # Auto generated from "SHAKE128.txt" lappend auto_path [file dirname [file dirname [file dirname [file dirname [file join [pwd] [info script]]]]]] package require tls package require tcltest tcltest::testConstraint SHAKE128 [expr {[lsearch -nocase [tls::digests] SHAKE128] > -1}] catch {tls::provider legacy} tcltest::test Hash_SHAKE128-1.1 {SHAKE128} \ -constraints SHAKE128 \ -setup {set data ""} \ |
Modified tests/test_vectors/Hash/SHAKE128.txt from [0a5deb8560] to [42be99e84a].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | + + + | # SHAKE128 # From https://csrc.nist.gov/projects/cryptographic-standards-and-guidelines/example-values # and FIPS 202 [L = 32] Len = 0 Msg = "" MD = 7f9c2ba4e88f827d616045507605853ed73b8093f6efbc88eb1a6eacfa66ef26 Length = 32 Len = 43 Msg = "The quick brown fox jumps over the lazy dog" MD = f4202e3c5852f9182a0430fd8144f0a74b95e7417ecae17db0f8cfeed0e3e66e Length = 32 Len = 200 Repeat = 200 Msg = a3 MD = 131ab8d2b594946b9c81333f9bb6e0ce75c3b93104fa3469d3917457385da037 Length = 32 |
Modified tests/test_vectors/Hash/SHAKE256.test from [2e2114455d] to [211c0f99b9].
1 2 3 4 5 6 7 8 9 10 11 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | - + - + - + | # Auto generated from "SHAKE256.txt" lappend auto_path [file dirname [file dirname [file dirname [file dirname [file join [pwd] [info script]]]]]] package require tls package require tcltest tcltest::testConstraint SHAKE256 [expr {[lsearch -nocase [tls::digests] SHAKE256] > -1}] catch {tls::provider legacy} tcltest::test Hash_SHAKE256-1.1 {SHAKE256} \ -constraints SHAKE256 \ -setup {set data ""} \ |
Modified tests/test_vectors/Hash/SHAKE256.txt from [4480b876cb] to [dc5cbee49c].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | + + + | # SHAKE256 # From https://csrc.nist.gov/projects/cryptographic-standards-and-guidelines/example-values # and FIPS 202 [L = 64] Len = 0 Msg = "" MD = 46b9dd2b0ba88d13233b3feb743eeb243fcd52ea62b81b82b50c27646ed5762fd75dc4ddd8c0f200cb05019d67b592f6fc821c49479ab48640292eacb3b7c4be Length = 64 Len = 43 Msg = "The quick brown fox jumps over the lazy dog" MD = 2f671343d9b2e1604dc9dcf0753e5fe15c7c64a0d283cbbf722d411a0e36f6ca1d01d1369a23539cd80f7c054b6e5daf9c962cad5b8ed5bd11998b40d5734442 Length = 64 Len = 200 Repeat = 200 Msg = a3 MD = cd8a920ed141aa0407a22d59288652e9d9f1a7ee0c1e7c1ca699424da84a904d2d700caae7396ece96604440577da4f3aa22aeb8857f961c4cd8e06f0ae6610b Length = 64 |
Modified tests/test_vectors/Hash/make_test.tcl from [e263a6e534] to [e069950966].
1 2 3 4 5 6 7 8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | - + | # # Test Vectors # # # Create test case and output to test file # proc do_test {group tail file_num tc digest params} { |
︙ | |||
31 32 33 34 35 36 37 38 39 | 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | + + + + + + - + | if {$is_hex} { append line [format {-setup {set data [binary decode hex %s]}} $data] } else { append line [format {-setup {set data %s}} $data] } append line " \\\n\t" if {$config(Length) ne ""} { set opts [format " -length %d" $config(Length)] } else { set opts "" } # Test body |
︙ |