535 self |
535 self |
536 skipIf:(SHA3_256Stream isBehavior not or:[SHA3_256Stream isLoaded not]) |
536 skipIf:(SHA3_256Stream isBehavior not or:[SHA3_256Stream isLoaded not]) |
537 description:'SHA3Stream/libcrypt is not loaded'. |
537 description:'SHA3Stream/libcrypt is not loaded'. |
538 |
538 |
539 "/ hashes taken from wikipedia-page on SHA3 |
539 "/ hashes taken from wikipedia-page on SHA3 |
540 |
540 false ifTrue:[ |
541 h := SHA3_224Stream hashValueOf:''. |
541 h := SHA3_224Stream hashValueOf:''. |
542 self assert:(h = (ByteArray fromHexString:'6b4e03423667dbb73b6e15454f0eb1abd4597f9a1b078e3f5b5a6bc7')). |
542 self assert:(h = (ByteArray fromHexString:'6b4e03423667dbb73b6e15454f0eb1abd4597f9a1b078e3f5b5a6bc7')). |
|
543 ]. |
543 |
544 |
544 h := SHA3_256Stream hashValueOf:''. |
545 h := SHA3_256Stream hashValueOf:''. |
545 self assert:(h = (ByteArray fromHexString:'a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a')). |
546 self assert:(h = (ByteArray fromHexString:'a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a')). |
546 |
547 |
547 h := SHA3_384Stream hashValueOf:''. |
548 h := SHA3_384Stream hashValueOf:''. |
549 |
550 |
550 h := SHA3_512Stream hashValueOf:''. |
551 h := SHA3_512Stream hashValueOf:''. |
551 self assert:(h = (ByteArray fromHexString:'a69f73cca23a9ac5c8b567dc185a756e97c982164fe25859e0d1dcc1475c80a615b2123af1f5f94c11e3e9402c3ac558f500199d95b6d3e301758586281dcd26')). |
552 self assert:(h = (ByteArray fromHexString:'a69f73cca23a9ac5c8b567dc185a756e97c982164fe25859e0d1dcc1475c80a615b2123af1f5f94c11e3e9402c3ac558f500199d95b6d3e301758586281dcd26')). |
552 |
553 |
553 |
554 |
554 h := SHA3_Shake128_256Stream hashValueOf:''. |
555 false ifTrue:[ |
555 self assert:(h = (ByteArray fromHexString:'7f9c2ba4e88f827d616045507605853ed73b8093f6efbc88eb1a6eacfa66ef26')). |
556 h := SHA3_Shake128_256Stream hashValueOf:''. |
556 |
557 self assert:(h = (ByteArray fromHexString:'7f9c2ba4e88f827d616045507605853ed73b8093f6efbc88eb1a6eacfa66ef26')). |
557 h := SHA3_Shake256_512Stream hashValueOf:''. |
558 |
558 self assert:(h = (ByteArray fromHexString:'46b9dd2b0ba88d13233b3feb743eeb243fcd52ea62b81b82b50c27646ed5762fd75dc4ddd8c0f200cb05019d67b592f6fc821c49479ab48640292eacb3b7c4be')). |
559 h := SHA3_Shake256_512Stream hashValueOf:''. |
559 |
560 self assert:(h = (ByteArray fromHexString:'46b9dd2b0ba88d13233b3feb743eeb243fcd52ea62b81b82b50c27646ed5762fd75dc4ddd8c0f200cb05019d67b592f6fc821c49479ab48640292eacb3b7c4be')). |
560 h := SHA3_Shake128_256Stream hashValueOf:'The quick brown fox jumps over the lazy dog'. |
561 |
561 self assert:(h = (ByteArray fromHexString:'f4202e3c5852f9182a0430fd8144f0a74b95e7417ecae17db0f8cfeed0e3e66e')). |
562 h := SHA3_Shake128_256Stream hashValueOf:'The quick brown fox jumps over the lazy dog'. |
562 |
563 self assert:(h = (ByteArray fromHexString:'f4202e3c5852f9182a0430fd8144f0a74b95e7417ecae17db0f8cfeed0e3e66e')). |
563 h := SHA3_Shake128_256Stream hashValueOf:'The quick brown fox jumps over the lazy dof'. |
564 |
564 self assert:(h = (ByteArray fromHexString:'853f4538be0db9621a6cea659a06c1107b1f83f02b13d18297bd39d7411cf10c')). |
565 h := SHA3_Shake128_256Stream hashValueOf:'The quick brown fox jumps over the lazy dof'. |
565 |
566 self assert:(h = (ByteArray fromHexString:'853f4538be0db9621a6cea659a06c1107b1f83f02b13d18297bd39d7411cf10c')). |
|
567 ]. |
|
568 |
566 " |
569 " |
567 self run:#test13_sha3 |
570 self run:#test13_sha3 |
568 self new test13_sha3 |
571 self new test13_sha3 |
569 " |
572 " |
570 |
573 |
571 "Created: / 27-07-2017 / 13:40:51 / cg" |
574 "Created: / 27-07-2017 / 13:40:51 / cg" |
|
575 "Modified: / 23-03-2019 / 22:41:19 / Claus Gittinger" |
572 ! |
576 ! |
573 |
577 |
574 test14_aesRijndael |
578 test14_aesRijndael |
575 |plaintext key crypted hx ecb cbc ofb ctr iv| |
579 |plaintext key crypted hx ecb cbc ofb ctr iv| |
576 |
580 |