]> git.cryptolib.org Git - avr-crypto-lib.git/blobdiff - gf256mul/gf256mul.S
fixing E-Mail-Address & Copyright
[avr-crypto-lib.git] / gf256mul / gf256mul.S
index b269d3a4a1b760d2d372598bb0cbfdf87de1009c..36991aed0c5bd2d6269ba929663e8fa5a8f9a0cc 100644 (file)
@@ -1,7 +1,7 @@
 /* gf256mul.S */
 /*
     This file is part of the AVR-Crypto-Lib.
-    Copyright (C) 2008  Daniel Otte (daniel.otte@rub.de)
+    Copyright (C) 2006-2015 Daniel Otte (bg@nerilex.org)
 
     This program is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -62,8 +62,26 @@ gf256mul:
 
 #else
 
+/*
+
+uint8_t gf256mul(uint8_t a, uint8_t b, uint8_t p) {
+       uint8_t r = 0, c = 8;
+       do {
+           if (a & 1) {
+               r ^= b;
+           }
+           a >>= 1;
+           if (b & 0x80) {
+               b ^= p;
+           }
+           b <<= 1;
+       } while (--c);
+       return r;
+}
+
+ */
 gf256mul:
-       mov r21, r24
+       mov A, r24
        clr r24
        ldi r25, 8
 1: