4 Copyright (C) 2013 Niels Möller
6 This file is part of GNU Nettle.
8 GNU Nettle is free software: you can redistribute it and/or
9 modify it under the terms of either:
11 * the GNU Lesser General Public License as published by the Free
12 Software Foundation; either version 3 of the License, or (at your
13 option) any later version.
17 * the GNU General Public License as published by the Free
18 Software Foundation; either version 2 of the License, or (at your
19 option) any later version.
21 or both in parallel, as here.
23 GNU Nettle is distributed in the hope that it will be useful,
24 but WITHOUT ANY WARRANTY; without even the implied warranty of
25 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
26 General Public License for more details.
28 You should have received copies of the GNU General Public License and
29 the GNU Lesser General Public License along with this program. If
30 not, see http://www.gnu.org/licenses/.
37 define(<LENGTH>, <r1>)
45 define(<QRIGHT>, <q10>)
55 PROLOGUE(_nettle_umac_nh)
56 C Setup for 64-bit aligned reads
59 vld1.8 {DM}, [MSG :64]
61 addeq SHIFT, SHIFT, #8
63 C FIXME: Combine as rsb ?
67 C Right shift in QRIGHT (both halves)
68 vmov.i32 D0REG(QRIGHT)[0], SHIFT
69 vmov.32 D1REG(QRIGHT), D0REG(QRIGHT)
72 vmov.i32 D0REG(QLEFT)[0], SHIFT
73 vmov.32 D1REG(QLEFT), D0REG(QLEFT)
77 vshl.u64 DM, DM, D0REG(QRIGHT)
79 C Set m[i] <-- m[i-1] >> RSHIFT + m[i] << LSHIFT
80 vld1.8 {QA, QB}, [MSG :64]!
81 vshl.u64 QT0, QA, QRIGHT
82 vshl.u64 QT1, QB, QRIGHT
83 vshl.u64 QA, QA, QLEFT
84 vshl.u64 QB, QB, QLEFT
85 veor D0REG(QA), D0REG(QA), DM
86 veor D1REG(QA), D1REG(QA), D0REG(QT0)
87 veor D0REG(QB), D0REG(QB), D1REG(QT0)
88 veor D1REG(QB), D1REG(QB), D0REG(QT1)
91 vld1.i32 {QK0, QK1}, [KEY]!
94 subs LENGTH, LENGTH, #32
95 vmlal.u32 QY, D0REG(QA), D0REG(QB)
96 vmlal.u32 QY, D1REG(QA), D1REG(QB)
99 vadd.i64 D0REG(QY), D0REG(QY), D1REG(QY)
100 vmov r0, r1, D0REG(QY)
102 EPILOGUE(_nettle_umac_nh)