diff options
author | Juergen Gross <jgross@suse.com> | 2018-01-29 15:54:46 +0100 |
---|---|---|
committer | Juergen Gross <jgross@suse.com> | 2018-01-29 15:54:46 +0100 |
commit | fe8cbbbc0e68dad845f72ad75c8099b88f7ff049 (patch) | |
tree | 2bf17da93b86508fe2f66e87f39897a1d4b403dc /crypto/gf128mul.c | |
parent | 40248a5f572a9ee5602fb61b33ddcc7de3b4cf5b (diff) | |
parent | 21864b027d847a6d91903a5ba219770403ba8aad (diff) | |
download | linux-crypto-fe8cbbbc0e68dad845f72ad75c8099b88f7ff049.tar.gz linux-crypto-fe8cbbbc0e68dad845f72ad75c8099b88f7ff049.zip |
Merge branch 'master' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/torvalds/linux
Diffstat (limited to 'crypto/gf128mul.c')
-rw-r--r-- | crypto/gf128mul.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/crypto/gf128mul.c b/crypto/gf128mul.c index dc012129..24e60195 100644 --- a/crypto/gf128mul.c +++ b/crypto/gf128mul.c @@ -156,6 +156,19 @@ static void gf128mul_x8_bbe(be128 *x) x->b = cpu_to_be64((b << 8) ^ _tt); } +void gf128mul_x8_ble(le128 *r, const le128 *x) +{ + u64 a = le64_to_cpu(x->a); + u64 b = le64_to_cpu(x->b); + + /* equivalent to gf128mul_table_be[b >> 63] (see crypto/gf128mul.c): */ + u64 _tt = gf128mul_table_be[a >> 56]; + + r->a = cpu_to_le64((a << 8) | (b >> 56)); + r->b = cpu_to_le64((b << 8) ^ _tt); +} +EXPORT_SYMBOL(gf128mul_x8_ble); + void gf128mul_lle(be128 *r, const be128 *b) { be128 p[8]; |