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.1 required=5.0 tests=BAYES_00,FREEMAIL_FROM, PP_MIME_FAKE_ASCII_TEXT autolearn=no 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!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.freenet.de!151.189.20.20.MISMATCH!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> <1394gc.kok.ln@skymaster> Organization: No company Message-ID: User-Agent: Xnews/4.05.03 Date: 20 Aug 2004 21:20:49 GMT NNTP-Posting-Date: 20 Aug 2004 23:20:49 MEST NNTP-Posting-Host: c66a8491.newsread2.arcor-online.net X-Trace: DXC=K3@GVgQ7BOHeoBec=`Q1lFQ5U85hF6f;DjW\KbG]kaMHdglQn]=09hDCYnlA3gMKnGmfobaMi:^oN5ABNGeXe Jean-Pierre Rosen wrote in news:1394gc.kok.ln@skymaster: > Bernd Specht a �crit : > >> 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; >> > > Such software does not use signed integers, but modular integers. And > you have all the bit operations you need on modular integers. In fact, thats right :-o Can I declare full 32-bit modular types? Ada itself has no 32-bit unsigned (except in Interfaces.C). Natural is only a *subrange* from Integer.