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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9dec3ff1604723d9 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!proxad.net!newsfeed.stueberl.de!uucp.gnuu.de!newsfeed.arcor.de!news.arcor.de!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Bitmanipulation in Ada From: Bernd.Specht@gmx.com (Bernd Specht) References: <87k6vwrwym.fsf@insalien.org> Organization: No company Message-ID: User-Agent: Xnews/4.05.03 Date: 19 Aug 2004 18:28:02 GMT NNTP-Posting-Date: 19 Aug 2004 20:28:02 MEST NNTP-Posting-Host: ffe0cb7b.newsread4.arcor-online.net X-Trace: DXC=cA1?@>WTM:YD__2dTlB=E[:ejgIfPPldTjW\KbG]kaMXlSE5DYV?adQVoN=S]ccfiWWEh14DWb8DXA>4g4gGQh=]=]]5jE@XJPT X-Complaints-To: abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:2867 Date: 2004-08-19T20:28:02+02:00 List-Id: "Martin Dowie" wrote in news:cg2qcj$de0$1@titan.btinternet.com: > Bernd Specht wrote: >> Always? What do you think about bitscrambling software which has to >> treat data alternating as bitvector and as integer value in a loop >> like this (not exeactly this for securitity reasons): >> >> ... >> loop >> declare >> x : boolean; >> begin >> x := b(k); >> b(k) := b(32 - k); >> b (32 - k) := x; >> I := I * prime1 mod prime2; >> end; >> end loop; >> >> >> Can you find an equivalent algorithm where you can separate the >> bit-ops and the integer-ops? > > Sorry, I'm missing something... Are "I" and "b" different views of the > same address space? > Sorry, I and b are as mentioned earlier: >> TYPE ov is record >> case boolean of >> true : i : integer; >> false : byte_array; >> end; >> end;