Path: ...!3.eu.feeder.erje.net!feeder.erje.net!news.roellig-ltd.de!open-news-network.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.tota-refugium.de!.POSTED!not-for-mail From: Marcel Logen <333200007110-0201@ybtra.de> Newsgroups: sci.crypt Subject: Re: lun - Lucky Number Date: Sat, 15 Mar 2025 20:44:04 +0100 Organization: Bureau Logen Message-ID: <87senejdap.fsf@pc-731.ybtra.de> References: MIME-Version: 1.0 Content-Type: text/plain Injection-Info: tota-refugium.de; logging-data="1607575"; mail-complaints-to="abuse@news.tota-refugium.de" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Cancel-Lock: sha1:NCLGCwGV9L3/UEYuoHRfCwqekXE= X-User-ID: eJwFwQkRADAIAzBLlPJNzsaBfwlLnIHotPAwX188Sp9Y6DbSHnXShz0lJ5G0S94S2KqUsz8N8BA0 Bytes: 2534 Lines: 66 Richard Heathfield in sci.crypt: [...] >Tell you what, I'll let my source code do the talking and give >you a demo run at the end: Thank you. Interesting. >tuwetest.c: gcc -o tuwetest tuwetest.c tuwe.c > >#include "tuwe.h" > >#include > >static void dump(const void *vb, int n) >{ > int i = 0; > int j = 0; > const unsigned char * b = vb; > for(i = 0; i < n; i++) > { > for(j = 7; j >= 0; j--) > { > fprintf(stdout, "%d", !!(b[i] & (1 << j))); ^^ What does this do? Is it necessary? (As you see, I'm not a C programmer. ;-) > } > putchar('\n'); > } > printf("--------\n"); >} > >int main(void) >{ > unsigned char t[8] = {31, 41, 59, 26, 53, 58, 97, 32}; > unsigned char r[8] = {0, 0, 0, 0, 0, 0, 0, 0}; > unsigned char l[8] = {0, 0, 0, 0, 0, 0, 0, 0}; > > puts("t first"); > dump(t, 8); > puts("now turn it right 90 deg"); > tuwer(r, t); > dump(r, 8); > puts("and back again"); > tuwel(l, r); > dump(t, 8); "dump(l, 8);" (?) > return 0; >} [...] >#define BIT_QRY(x,i) ((x[(i)>>3] & (1<<((i)&7)))!=0) >#define BIT_SET(x,i) (x)[(i)>>3]|=(1<<((i)&7)) >#define BIT_CLR(x,i) (x)[(i)>>3]&=(1<<((i)&7))^0xFF Can you explain this a little bit? Marcel -- Sat Mar 15 20:44:04 2025 CET (1742067844) pc-731 87 sene jdap Lines: 67