4 This file is part of the AVR-Crypto-Lib.
5 Copyright (C) 2008, 2009 Daniel Otte (daniel.otte@rub.de)
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
32 while(x&1==0 && y&1==0) do
38 printf("DBG: initshift = %04X\n", i)
39 u=x; v=y; a=1; b=0; c=0; d=1
41 printf(" while u%%2==0; u = %X\n", u)
42 printf("DBG: (10) a = %s\n", a.to_s(16).upcase)
43 printf("DBG: (10) b = %s\n", b.to_s(16).upcase)
44 printf("DBG: (10) c = %s\n", c.to_s(16).upcase)
45 printf("DBG: (10) d = %s\n", d.to_s(16).upcase)
53 printf(" while v%%2==0; v = %X\n", v)
54 printf("DBG: (20) a = %s\n", a.to_s(16).upcase)
55 printf("DBG: (20) b = %s\n", b.to_s(16).upcase)
56 printf("DBG: (20) c = %s\n", c.to_s(16).upcase)
57 printf("DBG: (20) d = %s\n", d.to_s(16).upcase)
61 # printf("DBG: (qq) b = %s\n", b.to_s(16).upcase)
64 printf("DBG: (xx) d = %s\n", d.to_s(16).upcase)
68 printf(" if u>=v ...\n")
69 printf("DBG: (30) a = %s\n", a.to_s(16).upcase)
70 printf("DBG: (30) b = %s\n", b.to_s(16).upcase)
71 printf("DBG: (30) c = %s\n", c.to_s(16).upcase)
72 printf("DBG: (30) d = %s\n", d.to_s(16).upcase)
89 # 1609000771, 6fac577d72
94 printf("gcdext( %s, %s) => a = %s; b = %s; gcd = %s\n",
95 a.to_s(16),b.to_s(16),r[1].to_s(16),r[2].to_s(16),r[0].to_s(16))