diff options
author | David Howells <dhowells@redhat.com> | 2006-12-15 20:13:14 -0500 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2007-02-06 17:20:59 -0500 |
commit | 90831639a65592d6d3dc888dc3341f54ebf932e6 (patch) | |
tree | 30f3c32f414ff69d76b2c733a71739229f00be97 /crypto/tcrypt.h | |
parent | 91652be5d1b901673a8e926455f0ed146cfaa588 (diff) |
[CRYPTO] fcrypt: Add FCrypt from RxRPC
Add a crypto module to provide FCrypt encryption as used by RxRPC.
Signed-Off-By: David Howells <dhowells@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/tcrypt.h')
-rw-r--r-- | crypto/tcrypt.h | 128 |
1 files changed, 128 insertions, 0 deletions
diff --git a/crypto/tcrypt.h b/crypto/tcrypt.h index 6c7b7a1e73f4..ec77814d104e 100644 --- a/crypto/tcrypt.h +++ b/crypto/tcrypt.h | |||
@@ -3559,6 +3559,134 @@ static struct cipher_testvec xeta_dec_tv_template[] = { | |||
3559 | } | 3559 | } |
3560 | }; | 3560 | }; |
3561 | 3561 | ||
3562 | /* | ||
3563 | * FCrypt test vectors | ||
3564 | */ | ||
3565 | #define FCRYPT_ENC_TEST_VECTORS ARRAY_SIZE(fcrypt_pcbc_enc_tv_template) | ||
3566 | #define FCRYPT_DEC_TEST_VECTORS ARRAY_SIZE(fcrypt_pcbc_dec_tv_template) | ||
3567 | |||
3568 | static struct cipher_testvec fcrypt_pcbc_enc_tv_template[] = { | ||
3569 | { /* http://www.openafs.org/pipermail/openafs-devel/2000-December/005320.html */ | ||
3570 | .key = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
3571 | .klen = 8, | ||
3572 | .iv = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
3573 | .input = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
3574 | .ilen = 8, | ||
3575 | .result = { 0x0E, 0x09, 0x00, 0xC7, 0x3E, 0xF7, 0xED, 0x41 }, | ||
3576 | .rlen = 8, | ||
3577 | }, { | ||
3578 | .key = { 0x11, 0x44, 0x77, 0xAA, 0xDD, 0x00, 0x33, 0x66 }, | ||
3579 | .klen = 8, | ||
3580 | .iv = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
3581 | .input = { 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0 }, | ||
3582 | .ilen = 8, | ||
3583 | .result = { 0xD8, 0xED, 0x78, 0x74, 0x77, 0xEC, 0x06, 0x80 }, | ||
3584 | .rlen = 8, | ||
3585 | }, { /* From Arla */ | ||
3586 | .key = { 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87 }, | ||
3587 | .klen = 8, | ||
3588 | .iv = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 }, | ||
3589 | .input = "The quick brown fox jumps over the lazy dogs.\0\0", | ||
3590 | .ilen = 48, | ||
3591 | .result = { 0x00, 0xf0, 0xe, 0x11, 0x75, 0xe6, 0x23, 0x82, | ||
3592 | 0xee, 0xac, 0x98, 0x62, 0x44, 0x51, 0xe4, 0x84, | ||
3593 | 0xc3, 0x59, 0xd8, 0xaa, 0x64, 0x60, 0xae, 0xf7, | ||
3594 | 0xd2, 0xd9, 0x13, 0x79, 0x72, 0xa3, 0x45, 0x03, | ||
3595 | 0x23, 0xb5, 0x62, 0xd7, 0x0c, 0xf5, 0x27, 0xd1, | ||
3596 | 0xf8, 0x91, 0x3c, 0xac, 0x44, 0x22, 0x92, 0xef }, | ||
3597 | .rlen = 48, | ||
3598 | }, { | ||
3599 | .key = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 }, | ||
3600 | .klen = 8, | ||
3601 | .iv = { 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87 }, | ||
3602 | .input = "The quick brown fox jumps over the lazy dogs.\0\0", | ||
3603 | .ilen = 48, | ||
3604 | .result = { 0xca, 0x90, 0xf5, 0x9d, 0xcb, 0xd4, 0xd2, 0x3c, | ||
3605 | 0x01, 0x88, 0x7f, 0x3e, 0x31, 0x6e, 0x62, 0x9d, | ||
3606 | 0xd8, 0xe0, 0x57, 0xa3, 0x06, 0x3a, 0x42, 0x58, | ||
3607 | 0x2a, 0x28, 0xfe, 0x72, 0x52, 0x2f, 0xdd, 0xe0, | ||
3608 | 0x19, 0x89, 0x09, 0x1c, 0x2a, 0x8e, 0x8c, 0x94, | ||
3609 | 0xfc, 0xc7, 0x68, 0xe4, 0x88, 0xaa, 0xde, 0x0f }, | ||
3610 | .rlen = 48, | ||
3611 | }, { /* split-page version */ | ||
3612 | .key = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 }, | ||
3613 | .klen = 8, | ||
3614 | .iv = { 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87 }, | ||
3615 | .input = "The quick brown fox jumps over the lazy dogs.\0\0", | ||
3616 | .ilen = 48, | ||
3617 | .result = { 0xca, 0x90, 0xf5, 0x9d, 0xcb, 0xd4, 0xd2, 0x3c, | ||
3618 | 0x01, 0x88, 0x7f, 0x3e, 0x31, 0x6e, 0x62, 0x9d, | ||
3619 | 0xd8, 0xe0, 0x57, 0xa3, 0x06, 0x3a, 0x42, 0x58, | ||
3620 | 0x2a, 0x28, 0xfe, 0x72, 0x52, 0x2f, 0xdd, 0xe0, | ||
3621 | 0x19, 0x89, 0x09, 0x1c, 0x2a, 0x8e, 0x8c, 0x94, | ||
3622 | 0xfc, 0xc7, 0x68, 0xe4, 0x88, 0xaa, 0xde, 0x0f }, | ||
3623 | .rlen = 48, | ||
3624 | .np = 2, | ||
3625 | .tap = { 20, 28 }, | ||
3626 | } | ||
3627 | }; | ||
3628 | |||
3629 | static struct cipher_testvec fcrypt_pcbc_dec_tv_template[] = { | ||
3630 | { /* http://www.openafs.org/pipermail/openafs-devel/2000-December/005320.html */ | ||
3631 | .key = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
3632 | .klen = 8, | ||
3633 | .iv = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
3634 | .input = { 0x0E, 0x09, 0x00, 0xC7, 0x3E, 0xF7, 0xED, 0x41 }, | ||
3635 | .ilen = 8, | ||
3636 | .result = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
3637 | .rlen = 8, | ||
3638 | }, { | ||
3639 | .key = { 0x11, 0x44, 0x77, 0xAA, 0xDD, 0x00, 0x33, 0x66 }, | ||
3640 | .klen = 8, | ||
3641 | .iv = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | ||
3642 | .input = { 0xD8, 0xED, 0x78, 0x74, 0x77, 0xEC, 0x06, 0x80 }, | ||
3643 | .ilen = 8, | ||
3644 | .result = { 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0 }, | ||
3645 | .rlen = 8, | ||
3646 | }, { /* From Arla */ | ||
3647 | .key = { 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87 }, | ||
3648 | .klen = 8, | ||
3649 | .iv = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 }, | ||
3650 | .input = { 0x00, 0xf0, 0xe, 0x11, 0x75, 0xe6, 0x23, 0x82, | ||
3651 | 0xee, 0xac, 0x98, 0x62, 0x44, 0x51, 0xe4, 0x84, | ||
3652 | 0xc3, 0x59, 0xd8, 0xaa, 0x64, 0x60, 0xae, 0xf7, | ||
3653 | 0xd2, 0xd9, 0x13, 0x79, 0x72, 0xa3, 0x45, 0x03, | ||
3654 | 0x23, 0xb5, 0x62, 0xd7, 0x0c, 0xf5, 0x27, 0xd1, | ||
3655 | 0xf8, 0x91, 0x3c, 0xac, 0x44, 0x22, 0x92, 0xef }, | ||
3656 | .ilen = 48, | ||
3657 | .result = "The quick brown fox jumps over the lazy dogs.\0\0", | ||
3658 | .rlen = 48, | ||
3659 | }, { | ||
3660 | .key = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 }, | ||
3661 | .klen = 8, | ||
3662 | .iv = { 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87 }, | ||
3663 | .input = { 0xca, 0x90, 0xf5, 0x9d, 0xcb, 0xd4, 0xd2, 0x3c, | ||
3664 | 0x01, 0x88, 0x7f, 0x3e, 0x31, 0x6e, 0x62, 0x9d, | ||
3665 | 0xd8, 0xe0, 0x57, 0xa3, 0x06, 0x3a, 0x42, 0x58, | ||
3666 | 0x2a, 0x28, 0xfe, 0x72, 0x52, 0x2f, 0xdd, 0xe0, | ||
3667 | 0x19, 0x89, 0x09, 0x1c, 0x2a, 0x8e, 0x8c, 0x94, | ||
3668 | 0xfc, 0xc7, 0x68, 0xe4, 0x88, 0xaa, 0xde, 0x0f }, | ||
3669 | .ilen = 48, | ||
3670 | .result = "The quick brown fox jumps over the lazy dogs.\0\0", | ||
3671 | .rlen = 48, | ||
3672 | }, { /* split-page version */ | ||
3673 | .key = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 }, | ||
3674 | .klen = 8, | ||
3675 | .iv = { 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87 }, | ||
3676 | .input = { 0xca, 0x90, 0xf5, 0x9d, 0xcb, 0xd4, 0xd2, 0x3c, | ||
3677 | 0x01, 0x88, 0x7f, 0x3e, 0x31, 0x6e, 0x62, 0x9d, | ||
3678 | 0xd8, 0xe0, 0x57, 0xa3, 0x06, 0x3a, 0x42, 0x58, | ||
3679 | 0x2a, 0x28, 0xfe, 0x72, 0x52, 0x2f, 0xdd, 0xe0, | ||
3680 | 0x19, 0x89, 0x09, 0x1c, 0x2a, 0x8e, 0x8c, 0x94, | ||
3681 | 0xfc, 0xc7, 0x68, 0xe4, 0x88, 0xaa, 0xde, 0x0f }, | ||
3682 | .ilen = 48, | ||
3683 | .result = "The quick brown fox jumps over the lazy dogs.\0\0", | ||
3684 | .rlen = 48, | ||
3685 | .np = 2, | ||
3686 | .tap = { 20, 28 }, | ||
3687 | } | ||
3688 | }; | ||
3689 | |||
3562 | /* | 3690 | /* |
3563 | * Compression stuff. | 3691 | * Compression stuff. |
3564 | */ | 3692 | */ |