diff options
author | Jussi Kivilinna <jussi.kivilinna@mbnet.fi> | 2011-10-18 06:32:34 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2011-11-08 22:52:19 -0500 |
commit | d7bfc0fa31bc237a5d49e9c5638676a5dedff6fc (patch) | |
tree | 114034ebf848699484be1c1d8e50a5b0ab92901a /crypto | |
parent | 6c2205b8ffec035f4925b8ee84b7758afeee58b5 (diff) |
crypto: testmgr - add lrw(serpent) test vectors
Add test vectors for lrw(serpent). These are generated from lrw(aes) test vectors.
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/testmgr.c | 15 | ||||
-rw-r--r-- | crypto/testmgr.h | 502 |
2 files changed, 517 insertions, 0 deletions
diff --git a/crypto/testmgr.c b/crypto/testmgr.c index 49436b900081..3cfd8b05554c 100644 --- a/crypto/testmgr.c +++ b/crypto/testmgr.c | |||
@@ -2237,6 +2237,21 @@ static const struct alg_test_desc alg_test_descs[] = { | |||
2237 | } | 2237 | } |
2238 | } | 2238 | } |
2239 | }, { | 2239 | }, { |
2240 | .alg = "lrw(serpent)", | ||
2241 | .test = alg_test_skcipher, | ||
2242 | .suite = { | ||
2243 | .cipher = { | ||
2244 | .enc = { | ||
2245 | .vecs = serpent_lrw_enc_tv_template, | ||
2246 | .count = SERPENT_LRW_ENC_TEST_VECTORS | ||
2247 | }, | ||
2248 | .dec = { | ||
2249 | .vecs = serpent_lrw_dec_tv_template, | ||
2250 | .count = SERPENT_LRW_DEC_TEST_VECTORS | ||
2251 | } | ||
2252 | } | ||
2253 | } | ||
2254 | }, { | ||
2240 | .alg = "lzo", | 2255 | .alg = "lzo", |
2241 | .test = alg_test_comp, | 2256 | .test = alg_test_comp, |
2242 | .suite = { | 2257 | .suite = { |
diff --git a/crypto/testmgr.h b/crypto/testmgr.h index ed4aec950faf..1f7c3fd064c0 100644 --- a/crypto/testmgr.h +++ b/crypto/testmgr.h | |||
@@ -3108,6 +3108,9 @@ static struct cipher_testvec tf_ctr_dec_tv_template[] = { | |||
3108 | #define SERPENT_CTR_ENC_TEST_VECTORS 2 | 3108 | #define SERPENT_CTR_ENC_TEST_VECTORS 2 |
3109 | #define SERPENT_CTR_DEC_TEST_VECTORS 2 | 3109 | #define SERPENT_CTR_DEC_TEST_VECTORS 2 |
3110 | 3110 | ||
3111 | #define SERPENT_LRW_ENC_TEST_VECTORS 8 | ||
3112 | #define SERPENT_LRW_DEC_TEST_VECTORS 8 | ||
3113 | |||
3111 | static struct cipher_testvec serpent_enc_tv_template[] = { | 3114 | static struct cipher_testvec serpent_enc_tv_template[] = { |
3112 | { | 3115 | { |
3113 | .input = "\x00\x01\x02\x03\x04\x05\x06\x07" | 3116 | .input = "\x00\x01\x02\x03\x04\x05\x06\x07" |
@@ -3665,6 +3668,505 @@ static struct cipher_testvec serpent_ctr_dec_tv_template[] = { | |||
3665 | }, | 3668 | }, |
3666 | }; | 3669 | }; |
3667 | 3670 | ||
3671 | static struct cipher_testvec serpent_lrw_enc_tv_template[] = { | ||
3672 | /* Generated from AES-LRW test vectors */ | ||
3673 | { | ||
3674 | .key = "\x45\x62\xac\x25\xf8\x28\x17\x6d" | ||
3675 | "\x4c\x26\x84\x14\xb5\x68\x01\x85" | ||
3676 | "\x25\x8e\x2a\x05\xe7\x3e\x9d\x03" | ||
3677 | "\xee\x5a\x83\x0c\xcc\x09\x4c\x87", | ||
3678 | .klen = 32, | ||
3679 | .iv = "\x00\x00\x00\x00\x00\x00\x00\x00" | ||
3680 | "\x00\x00\x00\x00\x00\x00\x00\x01", | ||
3681 | .input = "\x30\x31\x32\x33\x34\x35\x36\x37" | ||
3682 | "\x38\x39\x41\x42\x43\x44\x45\x46", | ||
3683 | .ilen = 16, | ||
3684 | .result = "\x6f\xbf\xd4\xa4\x5d\x71\x16\x79" | ||
3685 | "\x63\x9c\xa6\x8e\x40\xbe\x0d\x8a", | ||
3686 | .rlen = 16, | ||
3687 | }, { | ||
3688 | .key = "\x59\x70\x47\x14\xf5\x57\x47\x8c" | ||
3689 | "\xd7\x79\xe8\x0f\x54\x88\x79\x44" | ||
3690 | "\x0d\x48\xf0\xb7\xb1\x5a\x53\xea" | ||
3691 | "\x1c\xaa\x6b\x29\xc2\xca\xfb\xaf", | ||
3692 | .klen = 32, | ||
3693 | .iv = "\x00\x00\x00\x00\x00\x00\x00\x00" | ||
3694 | "\x00\x00\x00\x00\x00\x00\x00\x02", | ||
3695 | .input = "\x30\x31\x32\x33\x34\x35\x36\x37" | ||
3696 | "\x38\x39\x41\x42\x43\x44\x45\x46", | ||
3697 | .ilen = 16, | ||
3698 | .result = "\xfd\xb2\x66\x98\x80\x96\x55\xad" | ||
3699 | "\x08\x94\x54\x9c\x21\x7c\x69\xe3", | ||
3700 | .rlen = 16, | ||
3701 | }, { | ||
3702 | .key = "\xd8\x2a\x91\x34\xb2\x6a\x56\x50" | ||
3703 | "\x30\xfe\x69\xe2\x37\x7f\x98\x47" | ||
3704 | "\xcd\xf9\x0b\x16\x0c\x64\x8f\xb6" | ||
3705 | "\xb0\x0d\x0d\x1b\xae\x85\x87\x1f", | ||
3706 | .klen = 32, | ||
3707 | .iv = "\x00\x00\x00\x00\x00\x00\x00\x00" | ||
3708 | "\x00\x00\x00\x02\x00\x00\x00\x00", | ||
3709 | .input = "\x30\x31\x32\x33\x34\x35\x36\x37" | ||
3710 | "\x38\x39\x41\x42\x43\x44\x45\x46", | ||
3711 | .ilen = 16, | ||
3712 | .result = "\x14\x5e\x3d\x70\xc0\x6e\x9c\x34" | ||
3713 | "\x5b\x5e\xcf\x0f\xe4\x8c\x21\x5c", | ||
3714 | .rlen = 16, | ||
3715 | }, { | ||
3716 | .key = "\x0f\x6a\xef\xf8\xd3\xd2\xbb\x15" | ||
3717 | "\x25\x83\xf7\x3c\x1f\x01\x28\x74" | ||
3718 | "\xca\xc6\xbc\x35\x4d\x4a\x65\x54" | ||
3719 | "\x90\xae\x61\xcf\x7b\xae\xbd\xcc" | ||
3720 | "\xad\xe4\x94\xc5\x4a\x29\xae\x70", | ||
3721 | .klen = 40, | ||
3722 | .iv = "\x00\x00\x00\x00\x00\x00\x00\x00" | ||
3723 | "\x00\x00\x00\x00\x00\x00\x00\x01", | ||
3724 | .input = "\x30\x31\x32\x33\x34\x35\x36\x37" | ||
3725 | "\x38\x39\x41\x42\x43\x44\x45\x46", | ||
3726 | .ilen = 16, | ||
3727 | .result = "\x25\x39\xaa\xa5\xf0\x65\xc8\xdc" | ||
3728 | "\x5d\x45\x95\x30\x8f\xff\x2f\x1b", | ||
3729 | .rlen = 16, | ||
3730 | }, { | ||
3731 | .key = "\x8a\xd4\xee\x10\x2f\xbd\x81\xff" | ||
3732 | "\xf8\x86\xce\xac\x93\xc5\xad\xc6" | ||
3733 | "\xa0\x19\x07\xc0\x9d\xf7\xbb\xdd" | ||
3734 | "\x52\x13\xb2\xb7\xf0\xff\x11\xd8" | ||
3735 | "\xd6\x08\xd0\xcd\x2e\xb1\x17\x6f", | ||
3736 | .klen = 40, | ||
3737 | .iv = "\x00\x00\x00\x00\x00\x00\x00\x00" | ||
3738 | "\x00\x00\x00\x02\x00\x00\x00\x00", | ||
3739 | .input = "\x30\x31\x32\x33\x34\x35\x36\x37" | ||
3740 | "\x38\x39\x41\x42\x43\x44\x45\x46", | ||
3741 | .ilen = 16, | ||
3742 | .result = "\x0c\x20\x20\x63\xd6\x8b\xfc\x8f" | ||
3743 | "\xc0\xe2\x17\xbb\xd2\x59\x6f\x26", | ||
3744 | .rlen = 16, | ||
3745 | }, { | ||
3746 | .key = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c" | ||
3747 | "\x23\x84\xcb\x1c\x77\xd6\x19\x5d" | ||
3748 | "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21" | ||
3749 | "\xa7\x9c\x21\xf8\xcb\x90\x02\x89" | ||
3750 | "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1" | ||
3751 | "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e", | ||
3752 | .klen = 48, | ||
3753 | .iv = "\x00\x00\x00\x00\x00\x00\x00\x00" | ||
3754 | "\x00\x00\x00\x00\x00\x00\x00\x01", | ||
3755 | .input = "\x30\x31\x32\x33\x34\x35\x36\x37" | ||
3756 | "\x38\x39\x41\x42\x43\x44\x45\x46", | ||
3757 | .ilen = 16, | ||
3758 | .result = "\xc1\x35\x2e\x53\xf0\x96\x4d\x9c" | ||
3759 | "\x2e\x18\xe6\x99\xcd\xd3\x15\x68", | ||
3760 | .rlen = 16, | ||
3761 | }, { | ||
3762 | .key = "\xfb\x76\x15\xb2\x3d\x80\x89\x1d" | ||
3763 | "\xd4\x70\x98\x0b\xc7\x95\x84\xc8" | ||
3764 | "\xb2\xfb\x64\xce\x60\x97\x87\x8d" | ||
3765 | "\x17\xfc\xe4\x5a\x49\xe8\x30\xb7" | ||
3766 | "\x6e\x78\x17\xe7\x2d\x5e\x12\xd4" | ||
3767 | "\x60\x64\x04\x7a\xf1\x2f\x9e\x0c", | ||
3768 | .klen = 48, | ||
3769 | .iv = "\x00\x00\x00\x00\x00\x00\x00\x00" | ||
3770 | "\x00\x00\x00\x02\x00\x00\x00\x00", | ||
3771 | .input = "\x30\x31\x32\x33\x34\x35\x36\x37" | ||
3772 | "\x38\x39\x41\x42\x43\x44\x45\x46", | ||
3773 | .ilen = 16, | ||
3774 | .result = "\x86\x0a\xc6\xa9\x1a\x9f\xe7\xe6" | ||
3775 | "\x64\x3b\x33\xd6\xd5\x84\xd6\xdf", | ||
3776 | .rlen = 16, | ||
3777 | }, { | ||
3778 | .key = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c" | ||
3779 | "\x23\x84\xcb\x1c\x77\xd6\x19\x5d" | ||
3780 | "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21" | ||
3781 | "\xa7\x9c\x21\xf8\xcb\x90\x02\x89" | ||
3782 | "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1" | ||
3783 | "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e", | ||
3784 | .klen = 48, | ||
3785 | .iv = "\x00\x00\x00\x00\x00\x00\x00\x00" | ||
3786 | "\x00\x00\x00\x00\x00\x00\x00\x01", | ||
3787 | .input = "\x05\x11\xb7\x18\xab\xc6\x2d\xac" | ||
3788 | "\x70\x5d\xf6\x22\x94\xcd\xe5\x6c" | ||
3789 | "\x17\x6b\xf6\x1c\xf0\xf3\x6e\xf8" | ||
3790 | "\x50\x38\x1f\x71\x49\xb6\x57\xd6" | ||
3791 | "\x8f\xcb\x8d\x6b\xe3\xa6\x29\x90" | ||
3792 | "\xfe\x2a\x62\x82\xae\x6d\x8b\xf6" | ||
3793 | "\xad\x1e\x9e\x20\x5f\x38\xbe\x04" | ||
3794 | "\xda\x10\x8e\xed\xa2\xa4\x87\xab" | ||
3795 | "\xda\x6b\xb4\x0c\x75\xba\xd3\x7c" | ||
3796 | "\xc9\xac\x42\x31\x95\x7c\xc9\x04" | ||
3797 | "\xeb\xd5\x6e\x32\x69\x8a\xdb\xa6" | ||
3798 | "\x15\xd7\x3f\x4f\x2f\x66\x69\x03" | ||
3799 | "\x9c\x1f\x54\x0f\xde\x1f\xf3\x65" | ||
3800 | "\x4c\x96\x12\xed\x7c\x92\x03\x01" | ||
3801 | "\x6f\xbc\x35\x93\xac\xf1\x27\xf1" | ||
3802 | "\xb4\x96\x82\x5a\x5f\xb0\xa0\x50" | ||
3803 | "\x89\xa4\x8e\x66\x44\x85\xcc\xfd" | ||
3804 | "\x33\x14\x70\xe3\x96\xb2\xc3\xd3" | ||
3805 | "\xbb\x54\x5a\x1a\xf9\x74\xa2\xc5" | ||
3806 | "\x2d\x64\x75\xdd\xb4\x54\xe6\x74" | ||
3807 | "\x8c\xd3\x9d\x9e\x86\xab\x51\x53" | ||
3808 | "\xb7\x93\x3e\x6f\xd0\x4e\x2c\x40" | ||
3809 | "\xf6\xa8\x2e\x3e\x9d\xf4\x66\xa5" | ||
3810 | "\x76\x12\x73\x44\x1a\x56\xd7\x72" | ||
3811 | "\x88\xcd\x21\x8c\x4c\x0f\xfe\xda" | ||
3812 | "\x95\xe0\x3a\xa6\xa5\x84\x46\xcd" | ||
3813 | "\xd5\x3e\x9d\x3a\xe2\x67\xe6\x60" | ||
3814 | "\x1a\xe2\x70\x85\x58\xc2\x1b\x09" | ||
3815 | "\xe1\xd7\x2c\xca\xad\xa8\x8f\xf9" | ||
3816 | "\xac\xb3\x0e\xdb\xca\x2e\xe2\xb8" | ||
3817 | "\x51\x71\xd9\x3c\x6c\xf1\x56\xf8" | ||
3818 | "\xea\x9c\xf1\xfb\x0c\xe6\xb7\x10" | ||
3819 | "\x1c\xf8\xa9\x7c\xe8\x53\x35\xc1" | ||
3820 | "\x90\x3e\x76\x4a\x74\xa4\x21\x2c" | ||
3821 | "\xf6\x2c\x4e\x0f\x94\x3a\x88\x2e" | ||
3822 | "\x41\x09\x6a\x33\x7d\xf6\xdd\x3f" | ||
3823 | "\x8d\x23\x31\x74\x84\xeb\x88\x6e" | ||
3824 | "\xcc\xb9\xbc\x22\x83\x19\x07\x22" | ||
3825 | "\xa5\x2d\xdf\xa5\xf3\x80\x85\x78" | ||
3826 | "\x84\x39\x6a\x6d\x6a\x99\x4f\xa5" | ||
3827 | "\x15\xfe\x46\xb0\xe4\x6c\xa5\x41" | ||
3828 | "\x3c\xce\x8f\x42\x60\x71\xa7\x75" | ||
3829 | "\x08\x40\x65\x8a\x82\xbf\xf5\x43" | ||
3830 | "\x71\x96\xa9\x4d\x44\x8a\x20\xbe" | ||
3831 | "\xfa\x4d\xbb\xc0\x7d\x31\x96\x65" | ||
3832 | "\xe7\x75\xe5\x3e\xfd\x92\x3b\xc9" | ||
3833 | "\x55\xbb\x16\x7e\xf7\xc2\x8c\xa4" | ||
3834 | "\x40\x1d\xe5\xef\x0e\xdf\xe4\x9a" | ||
3835 | "\x62\x73\x65\xfd\x46\x63\x25\x3d" | ||
3836 | "\x2b\xaf\xe5\x64\xfe\xa5\x5c\xcf" | ||
3837 | "\x24\xf3\xb4\xac\x64\xba\xdf\x4b" | ||
3838 | "\xc6\x96\x7d\x81\x2d\x8d\x97\xf7" | ||
3839 | "\xc5\x68\x77\x84\x32\x2b\xcc\x85" | ||
3840 | "\x74\x96\xf0\x12\x77\x61\xb9\xeb" | ||
3841 | "\x71\xaa\x82\xcb\x1c\xdb\x89\xc8" | ||
3842 | "\xc6\xb5\xe3\x5c\x7d\x39\x07\x24" | ||
3843 | "\xda\x39\x87\x45\xc0\x2b\xbb\x01" | ||
3844 | "\xac\xbc\x2a\x5c\x7f\xfc\xe8\xce" | ||
3845 | "\x6d\x9c\x6f\xed\xd3\xc1\xa1\xd6" | ||
3846 | "\xc5\x55\xa9\x66\x2f\xe1\xc8\x32" | ||
3847 | "\xa6\x5d\xa4\x3a\x98\x73\xe8\x45" | ||
3848 | "\xa4\xc7\xa8\xb4\xf6\x13\x03\xf6" | ||
3849 | "\xe9\x2e\xc4\x29\x0f\x84\xdb\xc4" | ||
3850 | "\x21\xc4\xc2\x75\x67\x89\x37\x0a", | ||
3851 | .ilen = 512, | ||
3852 | .result = "\xe3\x5a\x38\x0f\x4d\x92\x3a\x74" | ||
3853 | "\x15\xb1\x50\x8c\x9a\xd8\x99\x1d" | ||
3854 | "\x82\xec\xf1\x5f\x03\x6d\x02\x58" | ||
3855 | "\x90\x67\xfc\xdd\x8d\xe1\x38\x08" | ||
3856 | "\x7b\xc9\x9b\x4b\x04\x09\x50\x15" | ||
3857 | "\xce\xab\xda\x33\x30\x20\x12\xfa" | ||
3858 | "\x83\xc4\xa6\x9a\x2e\x7d\x90\xd9" | ||
3859 | "\xa6\xa6\x67\x43\xb4\xa7\xa8\x5c" | ||
3860 | "\xbb\x6a\x49\x2b\x8b\xf8\xd0\x22" | ||
3861 | "\xe5\x9e\xba\xe8\x8c\x67\xb8\x5b" | ||
3862 | "\x60\xbc\xf5\xa4\x95\x4e\x66\xe5" | ||
3863 | "\x6d\x8e\xa9\xf6\x65\x2e\x04\xf5" | ||
3864 | "\xba\xb5\xdb\x88\xc2\xf6\x7a\x4b" | ||
3865 | "\x89\x58\x7c\x9a\xae\x26\xe8\xb7" | ||
3866 | "\xb7\x28\xcc\xd6\xcc\xa5\x98\x4d" | ||
3867 | "\xb9\x91\xcb\xb4\xe4\x8b\x96\x47" | ||
3868 | "\x5f\x03\x8b\xdd\x94\xd1\xee\x12" | ||
3869 | "\xa7\x83\x80\xf2\xc1\x15\x74\x4f" | ||
3870 | "\x49\xf9\xb0\x7e\x6f\xdc\x73\x2f" | ||
3871 | "\xe2\xcf\xe0\x1b\x34\xa5\xa0\x52" | ||
3872 | "\xfb\x3c\x5d\x85\x91\xe6\x6d\x98" | ||
3873 | "\x04\xd6\xdd\x4c\x00\x64\xd9\x54" | ||
3874 | "\x5c\x3c\x08\x1d\x4c\x06\x9f\xb8" | ||
3875 | "\x1c\x4d\x8d\xdc\xa4\x3c\xb9\x3b" | ||
3876 | "\x9e\x85\xce\xc3\xa8\x4a\x0c\xd9" | ||
3877 | "\x04\xc3\x6f\x17\x66\xa9\x1f\x59" | ||
3878 | "\xd9\xe2\x19\x36\xa3\x88\xb8\x0b" | ||
3879 | "\x0f\x4a\x4d\xf8\xc8\x6f\xd5\x43" | ||
3880 | "\xeb\xa0\xab\x1f\x61\xc0\x06\xeb" | ||
3881 | "\x93\xb7\xb8\x6f\x0d\xbd\x07\x49" | ||
3882 | "\xb3\xac\x5d\xcf\x31\xa0\x27\x26" | ||
3883 | "\x21\xbe\x94\x2e\x19\xea\xf4\xee" | ||
3884 | "\xb5\x13\x89\xf7\x94\x0b\xef\x59" | ||
3885 | "\x44\xc5\x78\x8b\x3c\x3b\x71\x20" | ||
3886 | "\xf9\x35\x0c\x70\x74\xdc\x5b\xc2" | ||
3887 | "\xb4\x11\x0e\x2c\x61\xa1\x52\x46" | ||
3888 | "\x18\x11\x16\xc6\x86\x44\xa7\xaf" | ||
3889 | "\xd5\x0c\x7d\xa6\x9e\x25\x2d\x1b" | ||
3890 | "\x9a\x8f\x0f\xf8\x6a\x61\xa0\xea" | ||
3891 | "\x3f\x0e\x90\xd6\x8f\x83\x30\x64" | ||
3892 | "\xb5\x51\x2d\x08\x3c\xcd\x99\x36" | ||
3893 | "\x96\xd4\xb1\xb5\x48\x30\xca\x48" | ||
3894 | "\xf7\x11\xa8\xf5\x97\x8a\x6a\x6d" | ||
3895 | "\x12\x33\x2f\xc0\xe8\xda\xec\x8a" | ||
3896 | "\xe1\x88\x72\x63\xde\x20\xa3\xe1" | ||
3897 | "\x8e\xac\x84\x37\x35\xf5\xf7\x3f" | ||
3898 | "\x00\x02\x0e\xe4\xc1\x53\x68\x3f" | ||
3899 | "\xaa\xd5\xac\x52\x3d\x20\x2f\x4d" | ||
3900 | "\x7c\x83\xd0\xbd\xaa\x97\x35\x36" | ||
3901 | "\x98\x88\x59\x5d\xe7\x24\xe3\x90" | ||
3902 | "\x9d\x30\x47\xa7\xc3\x60\x35\xf4" | ||
3903 | "\xd5\xdb\x0e\x4d\x44\xc1\x81\x8b" | ||
3904 | "\xfd\xbd\xc3\x2b\xba\x68\xfe\x8d" | ||
3905 | "\x49\x5a\x3c\x8a\xa3\x01\xae\x25" | ||
3906 | "\x42\xab\xd2\x87\x1b\x35\xd6\xd2" | ||
3907 | "\xd7\x70\x1c\x1f\x72\xd1\xe1\x39" | ||
3908 | "\x1c\x58\xa2\xb4\xd0\x78\x55\x72" | ||
3909 | "\x76\x59\xea\xd9\xd7\x6e\x63\x8b" | ||
3910 | "\xcc\x9b\xa7\x74\x89\xfc\xa3\x68" | ||
3911 | "\x86\x28\xd1\xbb\x54\x8d\x66\xad" | ||
3912 | "\x2a\x92\xf9\x4e\x04\x3d\xae\xfd" | ||
3913 | "\x1b\x2b\x7f\xc3\x2f\x1a\x78\x0a" | ||
3914 | "\x5c\xc6\x84\xfe\x7c\xcb\x26\xfd" | ||
3915 | "\xd9\x51\x0f\xd7\x94\x2f\xc5\xa7", | ||
3916 | .rlen = 512, | ||
3917 | }, | ||
3918 | }; | ||
3919 | |||
3920 | static struct cipher_testvec serpent_lrw_dec_tv_template[] = { | ||
3921 | /* Generated from AES-LRW test vectors */ | ||
3922 | /* same as enc vectors with input and result reversed */ | ||
3923 | { | ||
3924 | .key = "\x45\x62\xac\x25\xf8\x28\x17\x6d" | ||
3925 | "\x4c\x26\x84\x14\xb5\x68\x01\x85" | ||
3926 | "\x25\x8e\x2a\x05\xe7\x3e\x9d\x03" | ||
3927 | "\xee\x5a\x83\x0c\xcc\x09\x4c\x87", | ||
3928 | .klen = 32, | ||
3929 | .iv = "\x00\x00\x00\x00\x00\x00\x00\x00" | ||
3930 | "\x00\x00\x00\x00\x00\x00\x00\x01", | ||
3931 | .input = "\x6f\xbf\xd4\xa4\x5d\x71\x16\x79" | ||
3932 | "\x63\x9c\xa6\x8e\x40\xbe\x0d\x8a", | ||
3933 | .ilen = 16, | ||
3934 | .result = "\x30\x31\x32\x33\x34\x35\x36\x37" | ||
3935 | "\x38\x39\x41\x42\x43\x44\x45\x46", | ||
3936 | .rlen = 16, | ||
3937 | }, { | ||
3938 | .key = "\x59\x70\x47\x14\xf5\x57\x47\x8c" | ||
3939 | "\xd7\x79\xe8\x0f\x54\x88\x79\x44" | ||
3940 | "\x0d\x48\xf0\xb7\xb1\x5a\x53\xea" | ||
3941 | "\x1c\xaa\x6b\x29\xc2\xca\xfb\xaf", | ||
3942 | .klen = 32, | ||
3943 | .iv = "\x00\x00\x00\x00\x00\x00\x00\x00" | ||
3944 | "\x00\x00\x00\x00\x00\x00\x00\x02", | ||
3945 | .input = "\xfd\xb2\x66\x98\x80\x96\x55\xad" | ||
3946 | "\x08\x94\x54\x9c\x21\x7c\x69\xe3", | ||
3947 | .ilen = 16, | ||
3948 | .result = "\x30\x31\x32\x33\x34\x35\x36\x37" | ||
3949 | "\x38\x39\x41\x42\x43\x44\x45\x46", | ||
3950 | .rlen = 16, | ||
3951 | }, { | ||
3952 | .key = "\xd8\x2a\x91\x34\xb2\x6a\x56\x50" | ||
3953 | "\x30\xfe\x69\xe2\x37\x7f\x98\x47" | ||
3954 | "\xcd\xf9\x0b\x16\x0c\x64\x8f\xb6" | ||
3955 | "\xb0\x0d\x0d\x1b\xae\x85\x87\x1f", | ||
3956 | .klen = 32, | ||
3957 | .iv = "\x00\x00\x00\x00\x00\x00\x00\x00" | ||
3958 | "\x00\x00\x00\x02\x00\x00\x00\x00", | ||
3959 | .input = "\x14\x5e\x3d\x70\xc0\x6e\x9c\x34" | ||
3960 | "\x5b\x5e\xcf\x0f\xe4\x8c\x21\x5c", | ||
3961 | .ilen = 16, | ||
3962 | .result = "\x30\x31\x32\x33\x34\x35\x36\x37" | ||
3963 | "\x38\x39\x41\x42\x43\x44\x45\x46", | ||
3964 | .rlen = 16, | ||
3965 | }, { | ||
3966 | .key = "\x0f\x6a\xef\xf8\xd3\xd2\xbb\x15" | ||
3967 | "\x25\x83\xf7\x3c\x1f\x01\x28\x74" | ||
3968 | "\xca\xc6\xbc\x35\x4d\x4a\x65\x54" | ||
3969 | "\x90\xae\x61\xcf\x7b\xae\xbd\xcc" | ||
3970 | "\xad\xe4\x94\xc5\x4a\x29\xae\x70", | ||
3971 | .klen = 40, | ||
3972 | .iv = "\x00\x00\x00\x00\x00\x00\x00\x00" | ||
3973 | "\x00\x00\x00\x00\x00\x00\x00\x01", | ||
3974 | .input = "\x25\x39\xaa\xa5\xf0\x65\xc8\xdc" | ||
3975 | "\x5d\x45\x95\x30\x8f\xff\x2f\x1b", | ||
3976 | .ilen = 16, | ||
3977 | .result = "\x30\x31\x32\x33\x34\x35\x36\x37" | ||
3978 | "\x38\x39\x41\x42\x43\x44\x45\x46", | ||
3979 | .rlen = 16, | ||
3980 | }, { | ||
3981 | .key = "\x8a\xd4\xee\x10\x2f\xbd\x81\xff" | ||
3982 | "\xf8\x86\xce\xac\x93\xc5\xad\xc6" | ||
3983 | "\xa0\x19\x07\xc0\x9d\xf7\xbb\xdd" | ||
3984 | "\x52\x13\xb2\xb7\xf0\xff\x11\xd8" | ||
3985 | "\xd6\x08\xd0\xcd\x2e\xb1\x17\x6f", | ||
3986 | .klen = 40, | ||
3987 | .iv = "\x00\x00\x00\x00\x00\x00\x00\x00" | ||
3988 | "\x00\x00\x00\x02\x00\x00\x00\x00", | ||
3989 | .input = "\x0c\x20\x20\x63\xd6\x8b\xfc\x8f" | ||
3990 | "\xc0\xe2\x17\xbb\xd2\x59\x6f\x26", | ||
3991 | .ilen = 16, | ||
3992 | .result = "\x30\x31\x32\x33\x34\x35\x36\x37" | ||
3993 | "\x38\x39\x41\x42\x43\x44\x45\x46", | ||
3994 | .rlen = 16, | ||
3995 | }, { | ||
3996 | .key = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c" | ||
3997 | "\x23\x84\xcb\x1c\x77\xd6\x19\x5d" | ||
3998 | "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21" | ||
3999 | "\xa7\x9c\x21\xf8\xcb\x90\x02\x89" | ||
4000 | "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1" | ||
4001 | "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e", | ||
4002 | .klen = 48, | ||
4003 | .iv = "\x00\x00\x00\x00\x00\x00\x00\x00" | ||
4004 | "\x00\x00\x00\x00\x00\x00\x00\x01", | ||
4005 | .input = "\xc1\x35\x2e\x53\xf0\x96\x4d\x9c" | ||
4006 | "\x2e\x18\xe6\x99\xcd\xd3\x15\x68", | ||
4007 | .ilen = 16, | ||
4008 | .result = "\x30\x31\x32\x33\x34\x35\x36\x37" | ||
4009 | "\x38\x39\x41\x42\x43\x44\x45\x46", | ||
4010 | .rlen = 16, | ||
4011 | }, { | ||
4012 | .key = "\xfb\x76\x15\xb2\x3d\x80\x89\x1d" | ||
4013 | "\xd4\x70\x98\x0b\xc7\x95\x84\xc8" | ||
4014 | "\xb2\xfb\x64\xce\x60\x97\x87\x8d" | ||
4015 | "\x17\xfc\xe4\x5a\x49\xe8\x30\xb7" | ||
4016 | "\x6e\x78\x17\xe7\x2d\x5e\x12\xd4" | ||
4017 | "\x60\x64\x04\x7a\xf1\x2f\x9e\x0c", | ||
4018 | .klen = 48, | ||
4019 | .iv = "\x00\x00\x00\x00\x00\x00\x00\x00" | ||
4020 | "\x00\x00\x00\x02\x00\x00\x00\x00", | ||
4021 | .input = "\x86\x0a\xc6\xa9\x1a\x9f\xe7\xe6" | ||
4022 | "\x64\x3b\x33\xd6\xd5\x84\xd6\xdf", | ||
4023 | .ilen = 16, | ||
4024 | .result = "\x30\x31\x32\x33\x34\x35\x36\x37" | ||
4025 | "\x38\x39\x41\x42\x43\x44\x45\x46", | ||
4026 | .rlen = 16, | ||
4027 | }, { | ||
4028 | .key = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c" | ||
4029 | "\x23\x84\xcb\x1c\x77\xd6\x19\x5d" | ||
4030 | "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21" | ||
4031 | "\xa7\x9c\x21\xf8\xcb\x90\x02\x89" | ||
4032 | "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1" | ||
4033 | "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e", | ||
4034 | .klen = 48, | ||
4035 | .iv = "\x00\x00\x00\x00\x00\x00\x00\x00" | ||
4036 | "\x00\x00\x00\x00\x00\x00\x00\x01", | ||
4037 | .input = "\xe3\x5a\x38\x0f\x4d\x92\x3a\x74" | ||
4038 | "\x15\xb1\x50\x8c\x9a\xd8\x99\x1d" | ||
4039 | "\x82\xec\xf1\x5f\x03\x6d\x02\x58" | ||
4040 | "\x90\x67\xfc\xdd\x8d\xe1\x38\x08" | ||
4041 | "\x7b\xc9\x9b\x4b\x04\x09\x50\x15" | ||
4042 | "\xce\xab\xda\x33\x30\x20\x12\xfa" | ||
4043 | "\x83\xc4\xa6\x9a\x2e\x7d\x90\xd9" | ||
4044 | "\xa6\xa6\x67\x43\xb4\xa7\xa8\x5c" | ||
4045 | "\xbb\x6a\x49\x2b\x8b\xf8\xd0\x22" | ||
4046 | "\xe5\x9e\xba\xe8\x8c\x67\xb8\x5b" | ||
4047 | "\x60\xbc\xf5\xa4\x95\x4e\x66\xe5" | ||
4048 | "\x6d\x8e\xa9\xf6\x65\x2e\x04\xf5" | ||
4049 | "\xba\xb5\xdb\x88\xc2\xf6\x7a\x4b" | ||
4050 | "\x89\x58\x7c\x9a\xae\x26\xe8\xb7" | ||
4051 | "\xb7\x28\xcc\xd6\xcc\xa5\x98\x4d" | ||
4052 | "\xb9\x91\xcb\xb4\xe4\x8b\x96\x47" | ||
4053 | "\x5f\x03\x8b\xdd\x94\xd1\xee\x12" | ||
4054 | "\xa7\x83\x80\xf2\xc1\x15\x74\x4f" | ||
4055 | "\x49\xf9\xb0\x7e\x6f\xdc\x73\x2f" | ||
4056 | "\xe2\xcf\xe0\x1b\x34\xa5\xa0\x52" | ||
4057 | "\xfb\x3c\x5d\x85\x91\xe6\x6d\x98" | ||
4058 | "\x04\xd6\xdd\x4c\x00\x64\xd9\x54" | ||
4059 | "\x5c\x3c\x08\x1d\x4c\x06\x9f\xb8" | ||
4060 | "\x1c\x4d\x8d\xdc\xa4\x3c\xb9\x3b" | ||
4061 | "\x9e\x85\xce\xc3\xa8\x4a\x0c\xd9" | ||
4062 | "\x04\xc3\x6f\x17\x66\xa9\x1f\x59" | ||
4063 | "\xd9\xe2\x19\x36\xa3\x88\xb8\x0b" | ||
4064 | "\x0f\x4a\x4d\xf8\xc8\x6f\xd5\x43" | ||
4065 | "\xeb\xa0\xab\x1f\x61\xc0\x06\xeb" | ||
4066 | "\x93\xb7\xb8\x6f\x0d\xbd\x07\x49" | ||
4067 | "\xb3\xac\x5d\xcf\x31\xa0\x27\x26" | ||
4068 | "\x21\xbe\x94\x2e\x19\xea\xf4\xee" | ||
4069 | "\xb5\x13\x89\xf7\x94\x0b\xef\x59" | ||
4070 | "\x44\xc5\x78\x8b\x3c\x3b\x71\x20" | ||
4071 | "\xf9\x35\x0c\x70\x74\xdc\x5b\xc2" | ||
4072 | "\xb4\x11\x0e\x2c\x61\xa1\x52\x46" | ||
4073 | "\x18\x11\x16\xc6\x86\x44\xa7\xaf" | ||
4074 | "\xd5\x0c\x7d\xa6\x9e\x25\x2d\x1b" | ||
4075 | "\x9a\x8f\x0f\xf8\x6a\x61\xa0\xea" | ||
4076 | "\x3f\x0e\x90\xd6\x8f\x83\x30\x64" | ||
4077 | "\xb5\x51\x2d\x08\x3c\xcd\x99\x36" | ||
4078 | "\x96\xd4\xb1\xb5\x48\x30\xca\x48" | ||
4079 | "\xf7\x11\xa8\xf5\x97\x8a\x6a\x6d" | ||
4080 | "\x12\x33\x2f\xc0\xe8\xda\xec\x8a" | ||
4081 | "\xe1\x88\x72\x63\xde\x20\xa3\xe1" | ||
4082 | "\x8e\xac\x84\x37\x35\xf5\xf7\x3f" | ||
4083 | "\x00\x02\x0e\xe4\xc1\x53\x68\x3f" | ||
4084 | "\xaa\xd5\xac\x52\x3d\x20\x2f\x4d" | ||
4085 | "\x7c\x83\xd0\xbd\xaa\x97\x35\x36" | ||
4086 | "\x98\x88\x59\x5d\xe7\x24\xe3\x90" | ||
4087 | "\x9d\x30\x47\xa7\xc3\x60\x35\xf4" | ||
4088 | "\xd5\xdb\x0e\x4d\x44\xc1\x81\x8b" | ||
4089 | "\xfd\xbd\xc3\x2b\xba\x68\xfe\x8d" | ||
4090 | "\x49\x5a\x3c\x8a\xa3\x01\xae\x25" | ||
4091 | "\x42\xab\xd2\x87\x1b\x35\xd6\xd2" | ||
4092 | "\xd7\x70\x1c\x1f\x72\xd1\xe1\x39" | ||
4093 | "\x1c\x58\xa2\xb4\xd0\x78\x55\x72" | ||
4094 | "\x76\x59\xea\xd9\xd7\x6e\x63\x8b" | ||
4095 | "\xcc\x9b\xa7\x74\x89\xfc\xa3\x68" | ||
4096 | "\x86\x28\xd1\xbb\x54\x8d\x66\xad" | ||
4097 | "\x2a\x92\xf9\x4e\x04\x3d\xae\xfd" | ||
4098 | "\x1b\x2b\x7f\xc3\x2f\x1a\x78\x0a" | ||
4099 | "\x5c\xc6\x84\xfe\x7c\xcb\x26\xfd" | ||
4100 | "\xd9\x51\x0f\xd7\x94\x2f\xc5\xa7", | ||
4101 | .ilen = 512, | ||
4102 | .result = "\x05\x11\xb7\x18\xab\xc6\x2d\xac" | ||
4103 | "\x70\x5d\xf6\x22\x94\xcd\xe5\x6c" | ||
4104 | "\x17\x6b\xf6\x1c\xf0\xf3\x6e\xf8" | ||
4105 | "\x50\x38\x1f\x71\x49\xb6\x57\xd6" | ||
4106 | "\x8f\xcb\x8d\x6b\xe3\xa6\x29\x90" | ||
4107 | "\xfe\x2a\x62\x82\xae\x6d\x8b\xf6" | ||
4108 | "\xad\x1e\x9e\x20\x5f\x38\xbe\x04" | ||
4109 | "\xda\x10\x8e\xed\xa2\xa4\x87\xab" | ||
4110 | "\xda\x6b\xb4\x0c\x75\xba\xd3\x7c" | ||
4111 | "\xc9\xac\x42\x31\x95\x7c\xc9\x04" | ||
4112 | "\xeb\xd5\x6e\x32\x69\x8a\xdb\xa6" | ||
4113 | "\x15\xd7\x3f\x4f\x2f\x66\x69\x03" | ||
4114 | "\x9c\x1f\x54\x0f\xde\x1f\xf3\x65" | ||
4115 | "\x4c\x96\x12\xed\x7c\x92\x03\x01" | ||
4116 | "\x6f\xbc\x35\x93\xac\xf1\x27\xf1" | ||
4117 | "\xb4\x96\x82\x5a\x5f\xb0\xa0\x50" | ||
4118 | "\x89\xa4\x8e\x66\x44\x85\xcc\xfd" | ||
4119 | "\x33\x14\x70\xe3\x96\xb2\xc3\xd3" | ||
4120 | "\xbb\x54\x5a\x1a\xf9\x74\xa2\xc5" | ||
4121 | "\x2d\x64\x75\xdd\xb4\x54\xe6\x74" | ||
4122 | "\x8c\xd3\x9d\x9e\x86\xab\x51\x53" | ||
4123 | "\xb7\x93\x3e\x6f\xd0\x4e\x2c\x40" | ||
4124 | "\xf6\xa8\x2e\x3e\x9d\xf4\x66\xa5" | ||
4125 | "\x76\x12\x73\x44\x1a\x56\xd7\x72" | ||
4126 | "\x88\xcd\x21\x8c\x4c\x0f\xfe\xda" | ||
4127 | "\x95\xe0\x3a\xa6\xa5\x84\x46\xcd" | ||
4128 | "\xd5\x3e\x9d\x3a\xe2\x67\xe6\x60" | ||
4129 | "\x1a\xe2\x70\x85\x58\xc2\x1b\x09" | ||
4130 | "\xe1\xd7\x2c\xca\xad\xa8\x8f\xf9" | ||
4131 | "\xac\xb3\x0e\xdb\xca\x2e\xe2\xb8" | ||
4132 | "\x51\x71\xd9\x3c\x6c\xf1\x56\xf8" | ||
4133 | "\xea\x9c\xf1\xfb\x0c\xe6\xb7\x10" | ||
4134 | "\x1c\xf8\xa9\x7c\xe8\x53\x35\xc1" | ||
4135 | "\x90\x3e\x76\x4a\x74\xa4\x21\x2c" | ||
4136 | "\xf6\x2c\x4e\x0f\x94\x3a\x88\x2e" | ||
4137 | "\x41\x09\x6a\x33\x7d\xf6\xdd\x3f" | ||
4138 | "\x8d\x23\x31\x74\x84\xeb\x88\x6e" | ||
4139 | "\xcc\xb9\xbc\x22\x83\x19\x07\x22" | ||
4140 | "\xa5\x2d\xdf\xa5\xf3\x80\x85\x78" | ||
4141 | "\x84\x39\x6a\x6d\x6a\x99\x4f\xa5" | ||
4142 | "\x15\xfe\x46\xb0\xe4\x6c\xa5\x41" | ||
4143 | "\x3c\xce\x8f\x42\x60\x71\xa7\x75" | ||
4144 | "\x08\x40\x65\x8a\x82\xbf\xf5\x43" | ||
4145 | "\x71\x96\xa9\x4d\x44\x8a\x20\xbe" | ||
4146 | "\xfa\x4d\xbb\xc0\x7d\x31\x96\x65" | ||
4147 | "\xe7\x75\xe5\x3e\xfd\x92\x3b\xc9" | ||
4148 | "\x55\xbb\x16\x7e\xf7\xc2\x8c\xa4" | ||
4149 | "\x40\x1d\xe5\xef\x0e\xdf\xe4\x9a" | ||
4150 | "\x62\x73\x65\xfd\x46\x63\x25\x3d" | ||
4151 | "\x2b\xaf\xe5\x64\xfe\xa5\x5c\xcf" | ||
4152 | "\x24\xf3\xb4\xac\x64\xba\xdf\x4b" | ||
4153 | "\xc6\x96\x7d\x81\x2d\x8d\x97\xf7" | ||
4154 | "\xc5\x68\x77\x84\x32\x2b\xcc\x85" | ||
4155 | "\x74\x96\xf0\x12\x77\x61\xb9\xeb" | ||
4156 | "\x71\xaa\x82\xcb\x1c\xdb\x89\xc8" | ||
4157 | "\xc6\xb5\xe3\x5c\x7d\x39\x07\x24" | ||
4158 | "\xda\x39\x87\x45\xc0\x2b\xbb\x01" | ||
4159 | "\xac\xbc\x2a\x5c\x7f\xfc\xe8\xce" | ||
4160 | "\x6d\x9c\x6f\xed\xd3\xc1\xa1\xd6" | ||
4161 | "\xc5\x55\xa9\x66\x2f\xe1\xc8\x32" | ||
4162 | "\xa6\x5d\xa4\x3a\x98\x73\xe8\x45" | ||
4163 | "\xa4\xc7\xa8\xb4\xf6\x13\x03\xf6" | ||
4164 | "\xe9\x2e\xc4\x29\x0f\x84\xdb\xc4" | ||
4165 | "\x21\xc4\xc2\x75\x67\x89\x37\x0a", | ||
4166 | .rlen = 512, | ||
4167 | }, | ||
4168 | }; | ||
4169 | |||
3668 | /* Cast6 test vectors from RFC 2612 */ | 4170 | /* Cast6 test vectors from RFC 2612 */ |
3669 | #define CAST6_ENC_TEST_VECTORS 3 | 4171 | #define CAST6_ENC_TEST_VECTORS 3 |
3670 | #define CAST6_DEC_TEST_VECTORS 3 | 4172 | #define CAST6_DEC_TEST_VECTORS 3 |