X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=crypto%2Fgf128mul.c;h=a90d260528d4fbe09e3df8832736dc627f25de21;hb=5433137336b049f1de8fc9a393991a49f1c1eb66;hp=0a2aadfa1d850378cc2e2ec6884f8b89c2676318;hpb=c494e0705d670c51ac736c8c4d92750705fe3187;p=safe%2Fjmp%2Flinux-2.6 diff --git a/crypto/gf128mul.c b/crypto/gf128mul.c index 0a2aadf..a90d260 100644 --- a/crypto/gf128mul.c +++ b/crypto/gf128mul.c @@ -4,7 +4,7 @@ * Copyright (c) 2006, Rik Snel * * Based on Dr Brian Gladman's (GPL'd) work published at - * http://fp.gladman.plus.com/cryptography_technology/index.htm + * http://gladman.plushost.co.uk/oldsite/cryptography_technology/index.php * See the original copyright notice below. * * This program is free software; you can redistribute it and/or modify it @@ -142,6 +142,17 @@ static void gf128mul_x_bbe(be128 *r, const be128 *x) r->b = cpu_to_be64((b << 1) ^ _tt); } +void gf128mul_x_ble(be128 *r, const be128 *x) +{ + u64 a = le64_to_cpu(x->a); + u64 b = le64_to_cpu(x->b); + u64 _tt = gf128mul_table_bbe[b >> 63]; + + r->a = cpu_to_le64((a << 1) ^ _tt); + r->b = cpu_to_le64((b << 1) | (a >> 63)); +} +EXPORT_SYMBOL(gf128mul_x_ble); + static void gf128mul_x8_lle(be128 *x) { u64 a = be64_to_cpu(x->a);