| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Serpent Cipher 8-way parallel algorithm (x86_64/AVX) |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 5 | 6 | * <Johannes.Goetzfried@informatik.stud.uni-erlangen.de> |
|---|
| 6 | 7 | * |
|---|
| 7 | 8 | * Copyright © 2011-2013 Jussi Kivilinna <jussi.kivilinna@iki.fi> |
|---|
| 8 | | - * |
|---|
| 9 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 10 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 11 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 12 | | - * (at your option) any later version. |
|---|
| 13 | | - * |
|---|
| 14 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 15 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 16 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 17 | | - * GNU General Public License for more details. |
|---|
| 18 | | - * |
|---|
| 19 | | - * You should have received a copy of the GNU General Public License |
|---|
| 20 | | - * along with this program; if not, write to the Free Software |
|---|
| 21 | | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
|---|
| 22 | | - * USA |
|---|
| 23 | | - * |
|---|
| 24 | 9 | */ |
|---|
| 25 | 10 | |
|---|
| 26 | 11 | #include <linux/linkage.h> |
|---|
| .. | .. |
|---|
| 570 | 555 | transpose_4x4(x0, x1, x2, x3, t0, t1, t2) |
|---|
| 571 | 556 | |
|---|
| 572 | 557 | .align 8 |
|---|
| 573 | | -__serpent_enc_blk8_avx: |
|---|
| 558 | +SYM_FUNC_START_LOCAL(__serpent_enc_blk8_avx) |
|---|
| 574 | 559 | /* input: |
|---|
| 575 | 560 | * %rdi: ctx, CTX |
|---|
| 576 | 561 | * RA1, RB1, RC1, RD1, RA2, RB2, RC2, RD2: blocks |
|---|
| .. | .. |
|---|
| 620 | 605 | write_blocks(RA1, RB1, RC1, RD1, RK0, RK1, RK2); |
|---|
| 621 | 606 | write_blocks(RA2, RB2, RC2, RD2, RK0, RK1, RK2); |
|---|
| 622 | 607 | |
|---|
| 623 | | - ret; |
|---|
| 624 | | -ENDPROC(__serpent_enc_blk8_avx) |
|---|
| 608 | + RET; |
|---|
| 609 | +SYM_FUNC_END(__serpent_enc_blk8_avx) |
|---|
| 625 | 610 | |
|---|
| 626 | 611 | .align 8 |
|---|
| 627 | | -__serpent_dec_blk8_avx: |
|---|
| 612 | +SYM_FUNC_START_LOCAL(__serpent_dec_blk8_avx) |
|---|
| 628 | 613 | /* input: |
|---|
| 629 | 614 | * %rdi: ctx, CTX |
|---|
| 630 | 615 | * RA1, RB1, RC1, RD1, RA2, RB2, RC2, RD2: encrypted blocks |
|---|
| .. | .. |
|---|
| 674 | 659 | write_blocks(RC1, RD1, RB1, RE1, RK0, RK1, RK2); |
|---|
| 675 | 660 | write_blocks(RC2, RD2, RB2, RE2, RK0, RK1, RK2); |
|---|
| 676 | 661 | |
|---|
| 677 | | - ret; |
|---|
| 678 | | -ENDPROC(__serpent_dec_blk8_avx) |
|---|
| 662 | + RET; |
|---|
| 663 | +SYM_FUNC_END(__serpent_dec_blk8_avx) |
|---|
| 679 | 664 | |
|---|
| 680 | | -ENTRY(serpent_ecb_enc_8way_avx) |
|---|
| 665 | +SYM_FUNC_START(serpent_ecb_enc_8way_avx) |
|---|
| 681 | 666 | /* input: |
|---|
| 682 | 667 | * %rdi: ctx, CTX |
|---|
| 683 | 668 | * %rsi: dst |
|---|
| .. | .. |
|---|
| 692 | 677 | store_8way(%rsi, RA1, RB1, RC1, RD1, RA2, RB2, RC2, RD2); |
|---|
| 693 | 678 | |
|---|
| 694 | 679 | FRAME_END |
|---|
| 695 | | - ret; |
|---|
| 696 | | -ENDPROC(serpent_ecb_enc_8way_avx) |
|---|
| 680 | + RET; |
|---|
| 681 | +SYM_FUNC_END(serpent_ecb_enc_8way_avx) |
|---|
| 697 | 682 | |
|---|
| 698 | | -ENTRY(serpent_ecb_dec_8way_avx) |
|---|
| 683 | +SYM_FUNC_START(serpent_ecb_dec_8way_avx) |
|---|
| 699 | 684 | /* input: |
|---|
| 700 | 685 | * %rdi: ctx, CTX |
|---|
| 701 | 686 | * %rsi: dst |
|---|
| .. | .. |
|---|
| 710 | 695 | store_8way(%rsi, RC1, RD1, RB1, RE1, RC2, RD2, RB2, RE2); |
|---|
| 711 | 696 | |
|---|
| 712 | 697 | FRAME_END |
|---|
| 713 | | - ret; |
|---|
| 714 | | -ENDPROC(serpent_ecb_dec_8way_avx) |
|---|
| 698 | + RET; |
|---|
| 699 | +SYM_FUNC_END(serpent_ecb_dec_8way_avx) |
|---|
| 715 | 700 | |
|---|
| 716 | | -ENTRY(serpent_cbc_dec_8way_avx) |
|---|
| 701 | +SYM_FUNC_START(serpent_cbc_dec_8way_avx) |
|---|
| 717 | 702 | /* input: |
|---|
| 718 | 703 | * %rdi: ctx, CTX |
|---|
| 719 | 704 | * %rsi: dst |
|---|
| .. | .. |
|---|
| 728 | 713 | store_cbc_8way(%rdx, %rsi, RC1, RD1, RB1, RE1, RC2, RD2, RB2, RE2); |
|---|
| 729 | 714 | |
|---|
| 730 | 715 | FRAME_END |
|---|
| 731 | | - ret; |
|---|
| 732 | | -ENDPROC(serpent_cbc_dec_8way_avx) |
|---|
| 716 | + RET; |
|---|
| 717 | +SYM_FUNC_END(serpent_cbc_dec_8way_avx) |
|---|
| 733 | 718 | |
|---|
| 734 | | -ENTRY(serpent_ctr_8way_avx) |
|---|
| 719 | +SYM_FUNC_START(serpent_ctr_8way_avx) |
|---|
| 735 | 720 | /* input: |
|---|
| 736 | 721 | * %rdi: ctx, CTX |
|---|
| 737 | 722 | * %rsi: dst |
|---|
| .. | .. |
|---|
| 748 | 733 | store_ctr_8way(%rdx, %rsi, RA1, RB1, RC1, RD1, RA2, RB2, RC2, RD2); |
|---|
| 749 | 734 | |
|---|
| 750 | 735 | FRAME_END |
|---|
| 751 | | - ret; |
|---|
| 752 | | -ENDPROC(serpent_ctr_8way_avx) |
|---|
| 736 | + RET; |
|---|
| 737 | +SYM_FUNC_END(serpent_ctr_8way_avx) |
|---|
| 753 | 738 | |
|---|
| 754 | | -ENTRY(serpent_xts_enc_8way_avx) |
|---|
| 739 | +SYM_FUNC_START(serpent_xts_enc_8way_avx) |
|---|
| 755 | 740 | /* input: |
|---|
| 756 | 741 | * %rdi: ctx, CTX |
|---|
| 757 | 742 | * %rsi: dst |
|---|
| .. | .. |
|---|
| 770 | 755 | store_xts_8way(%rsi, RA1, RB1, RC1, RD1, RA2, RB2, RC2, RD2); |
|---|
| 771 | 756 | |
|---|
| 772 | 757 | FRAME_END |
|---|
| 773 | | - ret; |
|---|
| 774 | | -ENDPROC(serpent_xts_enc_8way_avx) |
|---|
| 758 | + RET; |
|---|
| 759 | +SYM_FUNC_END(serpent_xts_enc_8way_avx) |
|---|
| 775 | 760 | |
|---|
| 776 | | -ENTRY(serpent_xts_dec_8way_avx) |
|---|
| 761 | +SYM_FUNC_START(serpent_xts_dec_8way_avx) |
|---|
| 777 | 762 | /* input: |
|---|
| 778 | 763 | * %rdi: ctx, CTX |
|---|
| 779 | 764 | * %rsi: dst |
|---|
| .. | .. |
|---|
| 792 | 777 | store_xts_8way(%rsi, RC1, RD1, RB1, RE1, RC2, RD2, RB2, RE2); |
|---|
| 793 | 778 | |
|---|
| 794 | 779 | FRAME_END |
|---|
| 795 | | - ret; |
|---|
| 796 | | -ENDPROC(serpent_xts_dec_8way_avx) |
|---|
| 780 | + RET; |
|---|
| 781 | +SYM_FUNC_END(serpent_xts_dec_8way_avx) |
|---|