From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9dec3ff1604723d9 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news2.google.com!proxad.net!proxad.net!oleane.net!oleane!skymaster!nobody From: Jean-Pierre Rosen Newsgroups: comp.lang.ada Subject: Re: Bitmanipulation in Ada Date: Fri, 20 Aug 2004 09:26:34 +0200 Organization: Guest of France Telecom's news reading service Message-ID: <1394gc.kok.ln@skymaster> References: <87k6vwrwym.fsf@insalien.org> NNTP-Posting-Host: mailhost.axlog.fr Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: s5.feed.news.oleane.net 1092988935 3331 195.25.228.57 (20 Aug 2004 08:02:15 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Fri, 20 Aug 2004 08:02:15 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr-FR; rv:1.7.2) Gecko/20040803 X-Accept-Language: fr-fr, en-us, en In-Reply-To: Xref: g2news1.google.com comp.lang.ada:2884 Date: 2004-08-20T09:26:34+02:00 List-Id: Bernd Specht a =E9crit : > Always? What do you think about bitscrambling software which has to tre= at=20 > data alternating as bitvector and as integer value in a loop like this = (not=20 > exeactly this for securitity reasons): >=20 > ... > loop > declare > x : boolean; > begin > x :=3D b(k); > b(k) :=3D b(32 - k); > b (32 - k) :=3D x; > I :=3D I * prime1 mod prime2; > end; > end loop; >=20 Such software does not use signed integers, but modular integers. And=20 you have all the bit operations you need on modular integers. --=20 --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr