X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/f94b972d1c0389e4e9203cc9919ceaadbe655b61..0f9bd85aa42c06b55d7a4e1693981233d95c62ff:/f-binpoly.c diff --git a/f-binpoly.c b/f-binpoly.c index 23d9984..5f6a527 100644 --- a/f-binpoly.c +++ b/f-binpoly.c @@ -7,7 +7,7 @@ * (c) 2004 Straylight/Edgeware */ -/*----- Licensing notice --------------------------------------------------* +/*----- Licensing notice --------------------------------------------------* * * This file is part of Catacomb. * @@ -15,12 +15,12 @@ * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. - * + * * Catacomb is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. - * + * * You should have received a copy of the GNU Library General Public * License along with Catacomb; if not, write to the Free * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, @@ -41,7 +41,7 @@ static void fdestroy(field *ff) { fctx_binpoly *f = (fctx_binpoly *)ff; - gfreduce_destroy(&f->r); + gfreduce_destroy(&f->r); MP_DROP(f->f.q); DESTROY(f); } @@ -114,6 +114,7 @@ field *field_binpoly(mp *p) f->f.noctets = (f->f.nbits + 7) >> 3; gfreduce_create(&f->r, p); f->f.m = f->r.p; + f->f.q = mp_lsl(MP_NEW, MP_ONE, f->f.nbits); return (&f->f); } @@ -123,7 +124,7 @@ field *field_binpoly(mp *p) static void fndestroy(field *ff) { fctx_binnorm *f = (fctx_binnorm *)ff; gfreduce_destroy(&f->f.r); - gfn_destroy(&f->ntop); gfn_destroy(&f->pton); + gfn_destroy(&f->ntop); gfn_destroy(&f->pton); MP_DROP(f->f.f.q); DESTROY(f); } @@ -175,6 +176,7 @@ field *field_binnorm(mp *p, mp *beta) f->f.f.noctets = (f->f.f.nbits + 7) >> 3; gfreduce_create(&f->f.r, p); f->f.f.m = f->f.r.p; + f->f.f.q = mp_lsl(MP_NEW, MP_ONE, f->f.f.nbits); gfn_create(p, beta, &f->ntop, &f->pton); return (&f->f.f); }