Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

CCI Power 6/40: one board, a megabyte of cache, and an attitude...


devel / comp.lang.c / Inconsistent...

SubjectAuthor
* Inconsistent...Chris M. Thomasson
+- Re: Inconsistent...Chris M. Thomasson
+* Re: Inconsistent...Chris M. Thomasson
|`* Re: Inconsistent...Richard Harnden
| `- Re: Inconsistent...Chris M. Thomasson
+* Re: Inconsistent...bart
|+- Re: Inconsistent...bart
|`* Re: Inconsistent...bart
| `* Re: Inconsistent...Ben Bacarisse
|  +* Re: Inconsistent...bart
|  |`* Re: Inconsistent...Ben Bacarisse
|  | `* Re: Inconsistent...bart
|  |  +* Re: Inconsistent...Chris M. Thomasson
|  |  |`- Re: Inconsistent...bart
|  |  `* Re: Inconsistent...Ben Bacarisse
|  |   `* Re: Inconsistent...bart
|  |    `* Re: Inconsistent...Ben Bacarisse
|  |     +- Re: Inconsistent...Chris M. Thomasson
|  |     `- Re: Inconsistent...Chris M. Thomasson
|  `* Re: Inconsistent...Chris M. Thomasson
|   `* Re: Inconsistent...Ben Bacarisse
|    +* Re: Inconsistent...Chris M. Thomasson
|    |`- Re: Inconsistent...Ben Bacarisse
|    `* Re: Inconsistent...bart
|     +* Re: Inconsistent...David Brown
|     |`* Re: Inconsistent...Ben Bacarisse
|     | `* Re: Inconsistent...David Brown
|     |  `* Re: Inconsistent...Chris M. Thomasson
|     |   `* Re: Inconsistent...David Brown
|     |    `* Re: Inconsistent...Chris M. Thomasson
|     |     +* Re: Inconsistent...Chris M. Thomasson
|     |     |`* Re: Inconsistent...David Brown
|     |     | +- Re: Inconsistent...Chris M. Thomasson
|     |     | `* Re: Inconsistent...Chris M. Thomasson
|     |     |  `- Re: Inconsistent...Chris M. Thomasson
|     |     `* Re: Inconsistent...Ben Bacarisse
|     |      `* Re: Inconsistent...David Brown
|     |       +* [OT] Encryption (Was: Inconsistent...)Ben Bacarisse
|     |       |`* Re: [OT] Encryption (Was: Inconsistent...)David Brown
|     |       | `* Re: [OT] Encryption (Was: Inconsistent...)Scott Lurndal
|     |       |  `- Re: [OT] Encryption (Was: Inconsistent...)Chris M. Thomasson
|     |       `- Re: Inconsistent...Chris M. Thomasson
|     `* Re: Inconsistent...Ben Bacarisse
|      `* Re: Inconsistent...Chris M. Thomasson
|       `* Re: Inconsistent...Ben Bacarisse
|        `* Re: Inconsistent...Chris M. Thomasson
|         +* Re: Inconsistent...Ben Bacarisse
|         |`* Re: Inconsistent...Chris M. Thomasson
|         | `* Re: Inconsistent...Ben Bacarisse
|         |  `- Re: Inconsistent...Chris M. Thomasson
|         `- Re: Inconsistent...bart
+* Re: Inconsistent...Ben Bacarisse
|+- Re: Inconsistent...Chris M. Thomasson
|+- Re: Inconsistent...Chris M. Thomasson
|`* Re: Inconsistent...David Brown
| `* Re: Inconsistent...Ben Bacarisse
|  +* Re: Inconsistent...bart
|  |+* Re: Inconsistent...David Brown
|  ||`* Re: Inconsistent...bart
|  || `* Re: Inconsistent...David Brown
|  ||  `* Re: Inconsistent...bart
|  ||   `- Re: Inconsistent...David Brown
|  |`* Re: Inconsistent...Ben Bacarisse
|  | `- Re: Inconsistent...Chris M. Thomasson
|  `- Re: Inconsistent...David Brown
+* Re: Inconsistent...Richard Harnden
|`* Re: Inconsistent...Ben Bacarisse
| +- Re: Inconsistent...Richard Harnden
| `- Re: Inconsistent...Tim Rentsch
+- Re: Inconsistent...Chris M. Thomasson
`- Re: Inconsistent...Chris M. Thomasson

Pages:123
Inconsistent...

<uhp5jb$kbc1$2@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=31597&group=comp.lang.c#31597

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m.thomasson.1@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c
Subject: Inconsistent...
Date: Mon, 30 Oct 2023 14:01:30 -0700
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <uhp5jb$kbc1$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 30 Oct 2023 21:01:31 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="dfd4ea0a7bdc80cf575bc3888311ddf9";
logging-data="667009"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ngULGxWG20IzV3xhyf6tjWiWqiOlEoEE="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:qMrBLHIn8cpRq5msR2OBE559T9s=
Content-Language: en-US
 by: Chris M. Thomasson - Mon, 30 Oct 2023 21:01 UTC

This has to be undefined behavior. Check it out:

Here is my C code for a fun toy experimental fractal:

https://pastebin.com/raw/fcV5YiJH
(raw link to text...)

The cpack is different on the two different compilers. Oh, that is
always fun! Interesting. Here are some screenshots:

Online:

https://i.ibb.co/7n0wdWv/image.png

Notice cpack at 756768?

And on MSVC ver: 4.8.09032:

https://i.ibb.co/Pj0QZLf/image.png

cpack is at 95375807?

Interesting!

When you get some free time, can you compile and run my C code and
report the output? Thanks everybody.

:^)

Re: Inconsistent...

<uhp663$kbc1$4@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=31598&group=comp.lang.c#31598

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!rocksolid2!news.neodome.net!news.mixmin.net!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m.thomasson.1@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c
Subject: Re: Inconsistent...
Date: Mon, 30 Oct 2023 14:11:30 -0700
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <uhp663$kbc1$4@dont-email.me>
References: <uhp5jb$kbc1$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 30 Oct 2023 21:11:32 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="dfd4ea0a7bdc80cf575bc3888311ddf9";
logging-data="667009"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19OUbWKS+CHC4v6dCMvBWCQAZIJlU5PmIE="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:o/0ONmq1Nbgj3lIL+wP78uV5chY=
In-Reply-To: <uhp5jb$kbc1$2@dont-email.me>
Content-Language: en-US
 by: Chris M. Thomasson - Mon, 30 Oct 2023 21:11 UTC

On 10/30/2023 2:01 PM, Chris M. Thomasson wrote:
> This has to be undefined behavior. Check it out:
>
> Here is my C code for a fun toy experimental fractal:
>
> https://pastebin.com/raw/fcV5YiJH
> (raw link to text...)
>
> The cpack is different on the two different compilers. Oh, that is
> always fun! Interesting. Here are some screenshots:
>
> Online:
>
> https://i.ibb.co/7n0wdWv/image.png
>
> Notice cpack at 756768?
>
> And on MSVC ver: 4.8.09032:
>
> https://i.ibb.co/Pj0QZLf/image.png
>
> cpack is at 95375807?
>
> Interesting!
>
> When you get some free time, can you compile and run my C code and
> report the output? Thanks everybody.
>
> :^)

Fwiw, here is an online version of it:

http://funwithfractals.atspace.cc/ffe/

Re: Inconsistent...

<uhp78p$kbc1$5@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=31599&group=comp.lang.c#31599

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m.thomasson.1@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c
Subject: Re: Inconsistent...
Date: Mon, 30 Oct 2023 14:30:00 -0700
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <uhp78p$kbc1$5@dont-email.me>
References: <uhp5jb$kbc1$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 30 Oct 2023 21:30:01 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="dfd4ea0a7bdc80cf575bc3888311ddf9";
logging-data="667009"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19DHTPXIHzlizTSkttjRvP/11SyJBkPL/k="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:38zR96OLNG3e/MnhfkghM3JZNfQ=
Content-Language: en-US
In-Reply-To: <uhp5jb$kbc1$2@dont-email.me>
 by: Chris M. Thomasson - Mon, 30 Oct 2023 21:30 UTC

On 10/30/2023 2:01 PM, Chris M. Thomasson wrote:
> This has to be undefined behavior. Check it out:
>
> Here is my C code for a fun toy experimental fractal:
>
> https://pastebin.com/raw/fcV5YiJH
> (raw link to text...)
>
> The cpack is different on the two different compilers. Oh, that is
> always fun! Interesting. Here are some screenshots:
>
> Online:
>
> https://i.ibb.co/7n0wdWv/image.png
>
> Notice cpack at 756768?
[...]

This is a little bugger!

main.c: In function ‘ct_ffe_gen_private_key’:
main.c:358:22: warning: format ‘%u’ expects argument of type ‘unsigned
int’, but argument 2 has type ‘long unsigned int’ [-Wformat=]
358 | printf("cpack = %u\r\n", cpack);

Re: Inconsistent...

<uhp94c$l54g$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=31600&group=comp.lang.c#31600

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: richard.nospam@gmail.invalid (Richard Harnden)
Newsgroups: comp.lang.c
Subject: Re: Inconsistent...
Date: Mon, 30 Oct 2023 22:01:47 +0000
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <uhp94c$l54g$1@dont-email.me>
References: <uhp5jb$kbc1$2@dont-email.me> <uhp78p$kbc1$5@dont-email.me>
Reply-To: nospam.harnden@invalid.com
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 30 Oct 2023 22:01:48 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c9ecd0896a662fc8daba99d00b754556";
logging-data="693392"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18CM3iEsj2pn/CTssupEleo8Bh9d5vip3M="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:NAmbCXwqtFrX8iz7mPWCEXT1BH0=
Content-Language: en-GB
In-Reply-To: <uhp78p$kbc1$5@dont-email.me>
 by: Richard Harnden - Mon, 30 Oct 2023 22:01 UTC

On 30/10/2023 21:30, Chris M. Thomasson wrote:
> On 10/30/2023 2:01 PM, Chris M. Thomasson wrote:
>> This has to be undefined behavior. Check it out:
>>
>> Here is my C code for a fun toy experimental fractal:
>>
>> https://pastebin.com/raw/fcV5YiJH
>> (raw link to text...)
>>
>> The cpack is different on the two different compilers. Oh, that is
>> always fun! Interesting. Here are some screenshots:
>>
>> Online:
>>
>> https://i.ibb.co/7n0wdWv/image.png
>>
>> Notice cpack at 756768?
> [...]
>
> This is a little bugger!
>
> main.c: In function ‘ct_ffe_gen_private_key’:
> main.c:358:22: warning: format ‘%u’ expects argument of type ‘unsigned
> int’, but argument 2 has type ‘long unsigned int’ [-Wformat=]
>   358 |     printf("cpack = %u\r\n", cpack);
>

That's just %lu, surely?

Do you need all those \r\n's? Doesn't the end of line conversion happen
automatically?

Re: Inconsistent...

<uhp9ib$l4li$2@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=31601&group=comp.lang.c#31601

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m.thomasson.1@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c
Subject: Re: Inconsistent...
Date: Mon, 30 Oct 2023 15:09:14 -0700
Organization: A noiseless patient Spider
Lines: 39
Message-ID: <uhp9ib$l4li$2@dont-email.me>
References: <uhp5jb$kbc1$2@dont-email.me> <uhp78p$kbc1$5@dont-email.me>
<uhp94c$l54g$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 30 Oct 2023 22:09:15 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="dfd4ea0a7bdc80cf575bc3888311ddf9";
logging-data="692914"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Cc/3XBDyrUGroh8hkhaGqvXFqVzhYAgg="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:n9mipmsl4z5g5UWFnO0nKWmwoyY=
In-Reply-To: <uhp94c$l54g$1@dont-email.me>
Content-Language: en-US
 by: Chris M. Thomasson - Mon, 30 Oct 2023 22:09 UTC

On 10/30/2023 3:01 PM, Richard Harnden wrote:
> On 30/10/2023 21:30, Chris M. Thomasson wrote:
>> On 10/30/2023 2:01 PM, Chris M. Thomasson wrote:
>>> This has to be undefined behavior. Check it out:
>>>
>>> Here is my C code for a fun toy experimental fractal:
>>>
>>> https://pastebin.com/raw/fcV5YiJH
>>> (raw link to text...)
>>>
>>> The cpack is different on the two different compilers. Oh, that is
>>> always fun! Interesting. Here are some screenshots:
>>>
>>> Online:
>>>
>>> https://i.ibb.co/7n0wdWv/image.png
>>>
>>> Notice cpack at 756768?
>> [...]
>>
>> This is a little bugger!
>>
>> main.c: In function ‘ct_ffe_gen_private_key’:
>> main.c:358:22: warning: format ‘%u’ expects argument of type ‘unsigned
>> int’, but argument 2 has type ‘long unsigned int’ [-Wformat=]
>>    358 |     printf("cpack = %u\r\n", cpack);
>>
>
> That's just %lu, surely?

Yes. However, I am still getting different cpad results on two different
compilers. So, I need to find some time today or tommorrow to address that.

> Do you need all those \r\n's?  Doesn't the end of line conversion happen
> automatically?

Well, now that I think about this older code, I had HTTP protocol on the
mind during quickly fleshing it out. \r\n\r\n

Re: Inconsistent...

<uhpdrm$3blvk$1@i2pn2.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=31602&group=comp.lang.c#31602

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!.POSTED!not-for-mail
From: bc@freeuk.com (bart)
Newsgroups: comp.lang.c
Subject: Re: Inconsistent...
Date: Mon, 30 Oct 2023 23:22:32 +0000
Organization: i2pn2 (i2pn.org)
Message-ID: <uhpdrm$3blvk$1@i2pn2.org>
References: <uhp5jb$kbc1$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 30 Oct 2023 23:22:30 -0000 (UTC)
Injection-Info: i2pn2.org;
logging-data="3528692"; mail-complaints-to="usenet@i2pn2.org";
posting-account="dVsFrph2cpoFXY+0g13RAVyL1kBF0YjYSsiqIraasbA";
User-Agent: Mozilla Thunderbird
Content-Language: en-GB
In-Reply-To: <uhp5jb$kbc1$2@dont-email.me>
 by: bart - Mon, 30 Oct 2023 23:22 UTC

On 30/10/2023 21:01, Chris M. Thomasson wrote:
> This has to be undefined behavior. Check it out:
>
> Here is my C code for a fun toy experimental fractal:
>
> https://pastebin.com/raw/fcV5YiJH
> (raw link to text...)
>
> The cpack is different on the two different compilers. Oh, that is
> always fun! Interesting. Here are some screenshots:
>
> Online:
>
> https://i.ibb.co/7n0wdWv/image.png
>
> Notice cpack at 756768?
>
> And on MSVC ver: 4.8.09032:
>
> https://i.ibb.co/Pj0QZLf/image.png
>
> cpack is at 95375807?
>
> Interesting!
>
> When you get some free time, can you compile and run my C code and
> report the output? Thanks everybody.
>
> :^)

I tweaked the source code (used explicit assignment to fields of some
structs) to be able to use my compilers.

Then I tried these compilers:

gcc 13.2.0 - this worked. (I assume it is supposed to show some
plaintext, encrypted text starting "fog.IiQ' U'?zDjP))v$oN)?z<xT
CAPNKUfB...", then the identical plaintext)

tcc - failed. The encrypted text started
"xy,$}lu~@NM*a%^z1YA+'N@9yrV]E...", and the decrypted was:
"dEjtkuXVjq5*uzqpWXE6tkzXVjq5czuqpWXE!t9zX\j35czu30/XE!tkuX\!qocuu3pWXEjtkzXVj3oczuq4WXE!0
kz.Vjqocuu3p/TEj0ku.Vj31cuz3pWXEjtkzXVj3o*uzq4W."

gcc/clang on rextester.com - passed (they share the same encrypted text;
it is different from gcc on my Windows machine, but matches that of gcc
under WSL on my machine.).

mcc (my new compiler) - passed, encrypted text matches gcc's.

bcc (my old compiler) - failed, encrypted text started
"z\n:`#-}9tYq,VcI?4aHN_rgCXhy&A'/:am..."

lccwin32 - the result was ... interesting. The decrypted text matched
the original exactly, which is good. But the encrypted text was
"AAAAAAAAAAAAAAAAA...".

I noticed it uses floating point and sin/cos functions. If I change
double to float, the ones that work still work, but the encrypted data
is different between mcc and gcc. The ones that don't work still don't.

Note: I ran the program in your first link, where the input data is
repetitions of your name. I couldn't see any relevance to your posted
screen shots.

Re: Inconsistent...

<uhpf5b$3blvk$2@i2pn2.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=31603&group=comp.lang.c#31603

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!.POSTED!not-for-mail
From: bc@freeuk.com (bart)
Newsgroups: comp.lang.c
Subject: Re: Inconsistent...
Date: Mon, 30 Oct 2023 23:44:43 +0000
Organization: i2pn2 (i2pn.org)
Message-ID: <uhpf5b$3blvk$2@i2pn2.org>
References: <uhp5jb$kbc1$2@dont-email.me> <uhpdrm$3blvk$1@i2pn2.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 30 Oct 2023 23:44:43 -0000 (UTC)
Injection-Info: i2pn2.org;
logging-data="3528692"; mail-complaints-to="usenet@i2pn2.org";
posting-account="dVsFrph2cpoFXY+0g13RAVyL1kBF0YjYSsiqIraasbA";
User-Agent: Mozilla Thunderbird
In-Reply-To: <uhpdrm$3blvk$1@i2pn2.org>
Content-Language: en-GB
 by: bart - Mon, 30 Oct 2023 23:44 UTC

On 30/10/2023 23:22, bart wrote:
> On 30/10/2023 21:01, Chris M. Thomasson wrote:

> gcc/clang on rextester.com - passed (they share the same encrypted text;
> it is different from gcc on my Windows machine, but matches that of gcc
> under WSL on my machine.).

Your (CMT's) code uses 'long' which is 32 bits on Windows and likely 64
bits on Linux.

If I change the type to 'u64', then the encrypted data now matches
between Windows and the presumably Linux system used on rextester.com.

Using float, Windows/Linux gcc/clang encrypted data still match.

Only between gcc/mcc using float is the encrypted data different.

I'll have a look to tomorrow at how practical it is to figure out what's
going on.

Re: Inconsistent...

<87r0lbr7lp.fsf@bsb.me.uk>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=31604&group=comp.lang.c#31604

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!news.hispagatos.org!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ben.usenet@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.c
Subject: Re: Inconsistent...
Date: Mon, 30 Oct 2023 23:52:34 +0000
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <87r0lbr7lp.fsf@bsb.me.uk>
References: <uhp5jb$kbc1$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="592e9a8037ac80732861412e7a8a30f3";
logging-data="728819"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+sPPXBVs7gbfDFJ54ldzdFApP4C8pI94c="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:x55urp7BTZ4O+bGs66M3Y+AcXVA=
sha1:QUiZ50/jUVLyyTaJffATkLqFoeE=
X-BSB-Auth: 1.459ef218824acd99b2fc.20231030235234GMT.87r0lbr7lp.fsf@bsb.me.uk
 by: Ben Bacarisse - Mon, 30 Oct 2023 23:52 UTC

"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> writes:

> This has to be undefined behavior. Check it out:
>
> Here is my C code for a fun toy experimental fractal:
>
> https://pastebin.com/raw/fcV5YiJH
> (raw link to text...)

Ask your compiler for the maximum number of warnings and you should see
lots. For some reason you are mixing types in a peculiar way, and since
some of those types often have different sizes you will get different
arithmetic results on different systems.

> The cpack is different on the two different compilers. Oh, that is always
> fun!

You need to decide what integer types you really want.

> When you get some free time, can you compile and run my C code and report
> the output? Thanks everybody.

What will you learn from that? You would be better off asking for the
warnings we get so you can fix the bugs.

--
Ben.

Re: Inconsistent...

<uhpndq$3c4tj$1@i2pn2.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=31605&group=comp.lang.c#31605

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!.POSTED!not-for-mail
From: bc@freeuk.com (bart)
Newsgroups: comp.lang.c
Subject: Re: Inconsistent...
Date: Tue, 31 Oct 2023 02:05:46 +0000
Organization: i2pn2 (i2pn.org)
Message-ID: <uhpndq$3c4tj$1@i2pn2.org>
References: <uhp5jb$kbc1$2@dont-email.me> <uhpdrm$3blvk$1@i2pn2.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 31 Oct 2023 02:05:46 -0000 (UTC)
Injection-Info: i2pn2.org;
logging-data="3543987"; mail-complaints-to="usenet@i2pn2.org";
posting-account="dVsFrph2cpoFXY+0g13RAVyL1kBF0YjYSsiqIraasbA";
User-Agent: Mozilla Thunderbird
Content-Language: en-GB
In-Reply-To: <uhpdrm$3blvk$1@i2pn2.org>
 by: bart - Tue, 31 Oct 2023 02:05 UTC

On 30/10/2023 23:22, bart wrote:
> On 30/10/2023 21:01, Chris M. Thomasson wrote:
>> This has to be undefined behavior. Check it out:
>>
>> Here is my C code for a fun toy experimental fractal:
>>
>> https://pastebin.com/raw/fcV5YiJH
>> (raw link to text...)
>>
>> The cpack is different on the two different compilers. Oh, that is
>> always fun! Interesting. Here are some screenshots:
>>
>> Online:
>>
>> https://i.ibb.co/7n0wdWv/image.png
>>
>> Notice cpack at 756768?
>>
>> And on MSVC ver: 4.8.09032:
>>
>> https://i.ibb.co/Pj0QZLf/image.png
>>
>> cpack is at 95375807?
>>
>> Interesting!
>>
>> When you get some free time, can you compile and run my C code and
>> report the output? Thanks everybody.
>>
>> :^)
>
> I tweaked the source code (used explicit assignment to fields of some
> structs) to be able to use my compilers.
>
> Then I tried these compilers:
>
> gcc 13.2.0 - this worked. (I assume it is supposed to show some
> plaintext, encrypted text starting "fog.IiQ' U'?zDjP))v$oN)?z<xT
> CAPNKUfB...", then the identical plaintext)
>
> tcc - failed. The encrypted text started
> "xy,$}lu~@NM*a%^z1YA+'N@9yrV]E...", and the decrypted was:
> "dEjtkuXVjq5*uzqpWXE6tkzXVjq5czuqpWXE!t9zX\j35czu30/XE!tkuX\!qocuu3pWXEjtkzXVj3oczuq4WXE!0
> kz.Vjqocuu3p/TEj0ku.Vj31cuz3pWXEjtkzXVj3o*uzq4W."

Regarding tcc, a few things differ internally, but I think one clue is here:

#define CT_MBROT_ABET_LOOKUP(mp_char) \
((strchr(CT_MBROT_ABET, (mp_char))) - CT_MBROT_ABET)

This is effectively doing the following (to get an offset into the string?):

str("ABC", c) - "ABC";

It is assuming that both string literals have the same address. Clearly
on Tiny C they don't!

If I move that string into a variable, then Tcc starts to work. So does
bcc. lccwin32 still has a problem.

Re: Inconsistent...

<87lebjqb6g.fsf@bsb.me.uk>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=31606&group=comp.lang.c#31606

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ben.usenet@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.c
Subject: Re: Inconsistent...
Date: Tue, 31 Oct 2023 11:32:55 +0000
Organization: A noiseless patient Spider
Lines: 48
Message-ID: <87lebjqb6g.fsf@bsb.me.uk>
References: <uhp5jb$kbc1$2@dont-email.me> <uhpdrm$3blvk$1@i2pn2.org>
<uhpndq$3c4tj$1@i2pn2.org>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="592e9a8037ac80732861412e7a8a30f3";
logging-data="1083916"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+0sqrUX03Mbu3+7D31yDsKKtExXyQNCj8="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:x+8BswgVQyB5pUFTt+RzPK9Xlz8=
sha1:9KvdQuaLf64Q0Rbx1LedpDdctwU=
X-BSB-Auth: 1.b3e34e260596520703b6.20231031113255GMT.87lebjqb6g.fsf@bsb.me.uk
 by: Ben Bacarisse - Tue, 31 Oct 2023 11:32 UTC

bart <bc@freeuk.com> writes:

> On 30/10/2023 23:22, bart wrote:
>> On 30/10/2023 21:01, Chris M. Thomasson wrote:

>> I tweaked the source code (used explicit assignment to fields of some
>> structs) to be able to use my compilers.
>> Then I tried these compilers:
>> gcc 13.2.0 - this worked. (I assume it is supposed to show some
>> plaintext, encrypted text starting "fog.IiQ' U'?zDjP))v$oN)?z<xT
>> CAPNKUfB...", then the identical plaintext)
>> tcc - failed. The encrypted text started
>> "xy,$}lu~@NM*a%^z1YA+'N@9yrV]E...", and the decrypted was:
>> "dEjtkuXVjq5*uzqpWXE6tkzXVjq5czuqpWXE!t9zX\j35czu30/XE!tkuX\!qocuu3pWXEjtkzXVj3oczuq4WXE!0
>> kz.Vjqocuu3p/TEj0ku.Vj31cuz3pWXEjtkzXVj3o*uzq4W."
>
> Regarding tcc, a few things differ internally, but I think one clue is here:
>
> #define CT_MBROT_ABET_LOOKUP(mp_char) \
> ((strchr(CT_MBROT_ABET, (mp_char))) - CT_MBROT_ABET)
>
> This is effectively doing the following (to get an offset into the string?):
>
> str("ABC", c) - "ABC";
>
> It is assuming that both string literals have the same address.

This is an unwarranted assumption.

But the result is also undefined when mp_char does not occur in the
string which can happen for two printable ASCII characters.

Chris, you should test your code more thoroughly.

> If I move that string into a variable, then Tcc starts to work. So does
> bcc.

Saying that tcc starts to work when you fix the bug suggests that tcc
was not working before, but it's the code that was not working. tcc
(and presumably bcc) were working fine all along.

> lccwin32 still has a problem.

What's the problem? Are you sure it's lccwin32 and not the source code
that has the problem?

--
Ben.

Re: Inconsistent...

<uhr28e$3dnb9$1@i2pn2.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=31609&group=comp.lang.c#31609

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!.POSTED!not-for-mail
From: bc@freeuk.com (bart)
Newsgroups: comp.lang.c
Subject: Re: Inconsistent...
Date: Tue, 31 Oct 2023 14:16:46 +0000
Organization: i2pn2 (i2pn.org)
Message-ID: <uhr28e$3dnb9$1@i2pn2.org>
References: <uhp5jb$kbc1$2@dont-email.me> <uhpdrm$3blvk$1@i2pn2.org>
<uhpndq$3c4tj$1@i2pn2.org> <87lebjqb6g.fsf@bsb.me.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 31 Oct 2023 14:16:47 -0000 (UTC)
Injection-Info: i2pn2.org;
logging-data="3595625"; mail-complaints-to="usenet@i2pn2.org";
posting-account="dVsFrph2cpoFXY+0g13RAVyL1kBF0YjYSsiqIraasbA";
User-Agent: Mozilla Thunderbird
In-Reply-To: <87lebjqb6g.fsf@bsb.me.uk>
Content-Language: en-GB
 by: bart - Tue, 31 Oct 2023 14:16 UTC

[Reposting as the original reply seems to have vanished, but it may
reappear]

On 31/10/2023 11:32, Ben Bacarisse wrote:
> bart <bc@freeuk.com> writes:
>
>> On 30/10/2023 23:22, bart wrote:
>>> On 30/10/2023 21:01, Chris M. Thomasson wrote:
>
>>> I tweaked the source code (used explicit assignment to fields of some
>>> structs) to be able to use my compilers.
>>> Then I tried these compilers:
>>> gcc 13.2.0 - this worked. (I assume it is supposed to show some
>>> plaintext, encrypted text starting "fog.IiQ' U'?zDjP))v$oN)?z<xT
>>> CAPNKUfB...", then the identical plaintext)
>>> tcc - failed. The encrypted text started
>>> "xy,$}lu~@NM*a%^z1YA+'N@9yrV]E...", and the decrypted was:
>>>
"dEjtkuXVjq5*uzqpWXE6tkzXVjq5czuqpWXE!t9zX\j35czu30/XE!tkuX\!qocuu3pWXEjtkzXVj3oczuq4WXE!0
>>> kz.Vjqocuu3p/TEj0ku.Vj31cuz3pWXEjtkzXVj3o*uzq4W."
>>
>> Regarding tcc, a few things differ internally, but I think one clue
is here:
>>
>> #define CT_MBROT_ABET_LOOKUP(mp_char) \
>> ((strchr(CT_MBROT_ABET, (mp_char))) - CT_MBROT_ABET)
>>
>> This is effectively doing the following (to get an offset into the
string?):
>>
>> str("ABC", c) - "ABC";
>>
>> It is assuming that both string literals have the same address.
>
> This is an unwarranted assumption.
>
> But the result is also undefined when mp_char does not occur in the
> string which can happen for two printable ASCII characters.
>
> Chris, you should test your code more thoroughly.
>
>> If I move that string into a variable, then Tcc starts to work. So does
>> bcc.
>
> Saying that tcc starts to work when you fix the bug suggests that tcc
> was not working before, but it's the code that was not working. tcc
> (and presumably bcc) were working fine all along.
>
>> lccwin32 still has a problem.
>
> What's the problem? Are you sure it's lccwin32 and not the source code
> that has the problem?

When I say that compiler X has a problem, obviously I mean that the
program built with X shows an error. That is, the results are incorrect.

I'm not suggesting the compilers are at fault, although that is a
possibility especially with bcc (however, see below).

Probably this is not what Chris had in mind when he mentioned
inconsistency. But finding out why those compilers are producing the
wrong results I think is a useful first step to find out what is amiss
with this program.

(Throwing loads of -W options at it with gcc didn't show anything that
interesting.)

I next wanted to see next why lccwin32 is producing that data block (the
one output by ct_mbrotplane()) consisting of all 'A' characters, before
looking at that inconsistency issue.

And that does appear to a bug with the 64-bit version of lccwin32,
demonstrated here:

#include <stdio.h>
#include <math.h>

int main(void) {
printf("%f\n", fmod(0.445226, 1.0));
}

This produces an output of 'nan', rather than 0.445226. The program
works (in producing encrypted/decrypted output) with the 32-bit lccwin32.

I suppose what's left is seeing why that data block, regardless of
whether the encrypt/decrypt process appears to work, is why it can vary
across compilers.

Given the amount of floating point, I can't say I'm surprised, but I'd
be interesting in establishing exactly why.

Re: Inconsistent...

<87fs1qrcns.fsf@bsb.me.uk>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=31613&group=comp.lang.c#31613

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ben.usenet@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.c
Subject: Re: Inconsistent...
Date: Tue, 31 Oct 2023 16:15:35 +0000
Organization: A noiseless patient Spider
Lines: 120
Message-ID: <87fs1qrcns.fsf@bsb.me.uk>
References: <uhp5jb$kbc1$2@dont-email.me> <uhpdrm$3blvk$1@i2pn2.org>
<uhpndq$3c4tj$1@i2pn2.org> <87lebjqb6g.fsf@bsb.me.uk>
<uhr28e$3dnb9$1@i2pn2.org>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="592e9a8037ac80732861412e7a8a30f3";
logging-data="1187128"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18RR5T/w1GVHfWeJBxhcsD//6fKjLjvJxk="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:hL7adcgSWKJOkCEgwEe0DEGkph4=
sha1:m3+mNyGEIuywAzPfM8l2FHKbH38=
X-BSB-Auth: 1.fe6dd27e3fc6fb3ab768.20231031161535GMT.87fs1qrcns.fsf@bsb.me.uk
 by: Ben Bacarisse - Tue, 31 Oct 2023 16:15 UTC

bart <bc@freeuk.com> writes:

> [Reposting as the original reply seems to have vanished, but it may
> reappear]
>
> On 31/10/2023 11:32, Ben Bacarisse wrote:
>> bart <bc@freeuk.com> writes:
>>
>>> On 30/10/2023 23:22, bart wrote:
>>>> On 30/10/2023 21:01, Chris M. Thomasson wrote:
>>
>>>> I tweaked the source code (used explicit assignment to fields of some
>>>> structs) to be able to use my compilers.
>>>> Then I tried these compilers:
>>>> gcc 13.2.0 - this worked. (I assume it is supposed to show some
>>>> plaintext, encrypted text starting "fog.IiQ' U'?zDjP))v$oN)?z<xT
>>>> CAPNKUfB...", then the identical plaintext)
>>>> tcc - failed. The encrypted text started
>>>> "xy,$}lu~@NM*a%^z1YA+'N@9yrV]E...", and the decrypted was:
>>>>
> "dEjtkuXVjq5*uzqpWXE6tkzXVjq5czuqpWXE!t9zX\j35czu30/XE!tkuX\!qocuu3pWXEjtkzXVj3oczuq4WXE!0
>>>> kz.Vjqocuu3p/TEj0ku.Vj31cuz3pWXEjtkzXVj3o*uzq4W."
>>>
>>> Regarding tcc, a few things differ internally, but I think one clue is
> here:
>>>
>>> #define CT_MBROT_ABET_LOOKUP(mp_char) \
>>> ((strchr(CT_MBROT_ABET, (mp_char))) - CT_MBROT_ABET)
>>>
>>> This is effectively doing the following (to get an offset into the
> string?):
>>>
>>> str("ABC", c) - "ABC";
>>>
>>> It is assuming that both string literals have the same address.
>>
>> This is an unwarranted assumption.
>>
>> But the result is also undefined when mp_char does not occur in the
>> string which can happen for two printable ASCII characters.
>>
>> Chris, you should test your code more thoroughly.
>>
>>> If I move that string into a variable, then Tcc starts to work. So does
>>> bcc.
>>
>> Saying that tcc starts to work when you fix the bug suggests that tcc
>> was not working before, but it's the code that was not working. tcc
>> (and presumably bcc) were working fine all along.
>>
>>> lccwin32 still has a problem.
>>
>> What's the problem? Are you sure it's lccwin32 and not the source code
>> that has the problem?
>
> When I say that compiler X has a problem, obviously I mean that the program
> built with X shows an error.

That's a very odd way of putting it. My guess is that the
program has multiple meanings (and in some cases none). The compiler is
(probably) correctly picking one of them.

> That is, the results are incorrect.

Ah, then you know more that I. What are the correct results?

> I'm not suggesting the compilers are at fault, although that is a
> possibility especially with bcc (however, see below).
>
> Probably this is not what Chris had in mind when he mentioned
> inconsistency. But finding out why those compilers are producing the wrong
> results I think is a useful first step to find out what is amiss with this
> program.

The compiler is (probably) not producing the wrong results. The program
is producing results that the author did not intend.

> (Throwing loads of -W options at it with gcc didn't show anything that
> interesting.)

I found the result of carefully chosen -W options to be interesting.
Maybe you should reconsider "throwing" options at the compiler

> And that does appear to a bug with the 64-bit version of lccwin32,
> demonstrated here:
>
> #include <stdio.h>
> #include <math.h>
>
> int main(void) {
> printf("%f\n", fmod(0.445226, 1.0));
> }
>
> This produces an output of 'nan', rather than 0.445226.

Better to say that there is a bug in the implementation. The compiler
might be implementing fmod, but it's likely to be comming from a
library. I think lccwin32 has it's own library, but it's still not
really "the compiler".

> Given the amount of floating point, I can't say I'm surprised, but I'd be
> interesting in establishing exactly why.

Yes, some of it unnecessary. For example:

unsigned long
cantor_packing(
unsigned int n0,
unsigned int n1
){
unsigned long ret = 0.5 * (n0 + n1) * (n0 + n1 + 1) + n1;

return ret;
}

There is no need for floating point arithmetic here; C's x/2 works fine
when implementing this function.

--
Ben.

Re: Inconsistent...

<uhrhdm$3edkt$1@i2pn2.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=31615&group=comp.lang.c#31615

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!.POSTED!not-for-mail
From: bc@freeuk.com (bart)
Newsgroups: comp.lang.c
Subject: Re: Inconsistent...
Date: Tue, 31 Oct 2023 18:35:34 +0000
Organization: i2pn2 (i2pn.org)
Message-ID: <uhrhdm$3edkt$1@i2pn2.org>
References: <uhp5jb$kbc1$2@dont-email.me> <uhpdrm$3blvk$1@i2pn2.org>
<uhpndq$3c4tj$1@i2pn2.org> <87lebjqb6g.fsf@bsb.me.uk>
<uhr28e$3dnb9$1@i2pn2.org> <87fs1qrcns.fsf@bsb.me.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 31 Oct 2023 18:35:34 -0000 (UTC)
Injection-Info: i2pn2.org;
logging-data="3618461"; mail-complaints-to="usenet@i2pn2.org";
posting-account="dVsFrph2cpoFXY+0g13RAVyL1kBF0YjYSsiqIraasbA";
User-Agent: Mozilla Thunderbird
In-Reply-To: <87fs1qrcns.fsf@bsb.me.uk>
Content-Language: en-GB
 by: bart - Tue, 31 Oct 2023 18:35 UTC

[Another repost as i2pn2 not always sending my messges]

On 31/10/2023 16:15, Ben Bacarisse wrote:
> bart <bc@freeuk.com> writes:
>
>> [Reposting as the original reply seems to have vanished, but it may
>> reappear]
>>
>> On 31/10/2023 11:32, Ben Bacarisse wrote:
>>> bart <bc@freeuk.com> writes:
>>>
>>>> On 30/10/2023 23:22, bart wrote:
>>>>> On 30/10/2023 21:01, Chris M. Thomasson wrote:
>>>
>>>>> I tweaked the source code (used explicit assignment to fields of some
>>>>> structs) to be able to use my compilers.
>>>>> Then I tried these compilers:
>>>>> gcc 13.2.0 - this worked. (I assume it is supposed to show some
>>>>> plaintext, encrypted text starting "fog.IiQ' U'?zDjP))v$oN)?z<xT
>>>>> CAPNKUfB...", then the identical plaintext)
>>>>> tcc - failed. The encrypted text started
>>>>> "xy,$}lu~@NM*a%^z1YA+'N@9yrV]E...", and the decrypted was:
>>>>>
>>
"dEjtkuXVjq5*uzqpWXE6tkzXVjq5czuqpWXE!t9zX\j35czu30/XE!tkuX\!qocuu3pWXEjtkzXVj3oczuq4WXE!0
>>>>> kz.Vjqocuu3p/TEj0ku.Vj31cuz3pWXEjtkzXVj3o*uzq4W."
>>>>
>>>> Regarding tcc, a few things differ internally, but I think one clue is
>> here:
>>>>
>>>> #define CT_MBROT_ABET_LOOKUP(mp_char) \
>>>> ((strchr(CT_MBROT_ABET, (mp_char))) - CT_MBROT_ABET)
>>>>
>>>> This is effectively doing the following (to get an offset into the
>> string?):
>>>>
>>>> str("ABC", c) - "ABC";
>>>>
>>>> It is assuming that both string literals have the same address.
>>>
>>> This is an unwarranted assumption.
>>>
>>> But the result is also undefined when mp_char does not occur in the
>>> string which can happen for two printable ASCII characters.
>>>
>>> Chris, you should test your code more thoroughly.
>>>
>>>> If I move that string into a variable, then Tcc starts to work. So
does
>>>> bcc.
>>>
>>> Saying that tcc starts to work when you fix the bug suggests that tcc
>>> was not working before, but it's the code that was not working. tcc
>>> (and presumably bcc) were working fine all along.
>>>
>>>> lccwin32 still has a problem.
>>>
>>> What's the problem? Are you sure it's lccwin32 and not the source code
>>> that has the problem?
>>
>> When I say that compiler X has a problem, obviously I mean that the
program
>> built with X shows an error.
>
> That's a very odd way of putting it. My guess is that the
> program has multiple meanings (and in some cases none). The compiler is
> (probably) correctly picking one of them.
>
>> That is, the results are incorrect.
>
> Ah, then you know more that I. What are the correct results?

No spec is given. But I would say one requirement is that encrypting and
then decrypting a piece of plain text should produce the original text.

Another is that encrypted text should be secret, but lccwin32 for
example had that be the same as the plaintext! I assumed that was wrong.

There may be others to do with quality of the encryption, as well as
consistency of the encrpted data across compilers, but those two are
what stood out for me when I ran the program and which seemed obviously
wrong.

Re: Inconsistent...

<uhroij$16v9f$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=31617&group=comp.lang.c#31617

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!news.niel.me!news.gegeweb.eu!gegeweb.org!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m.thomasson.1@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c
Subject: Re: Inconsistent...
Date: Tue, 31 Oct 2023 13:37:39 -0700
Organization: A noiseless patient Spider
Lines: 55
Message-ID: <uhroij$16v9f$1@dont-email.me>
References: <uhp5jb$kbc1$2@dont-email.me> <uhpdrm$3blvk$1@i2pn2.org>
<uhpndq$3c4tj$1@i2pn2.org> <87lebjqb6g.fsf@bsb.me.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 31 Oct 2023 20:37:39 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="79e6b99247793a94ad1533012982a485";
logging-data="1277231"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/gW3QAV8g1bb1SDZyRMUh+Sgrczd9cYyw="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:9blDMtNIxBSDAtLFra3UoJu4PGw=
In-Reply-To: <87lebjqb6g.fsf@bsb.me.uk>
Content-Language: en-US
 by: Chris M. Thomasson - Tue, 31 Oct 2023 20:37 UTC

On 10/31/2023 4:32 AM, Ben Bacarisse wrote:
> bart <bc@freeuk.com> writes:
>
>> On 30/10/2023 23:22, bart wrote:
>>> On 30/10/2023 21:01, Chris M. Thomasson wrote:
>
>>> I tweaked the source code (used explicit assignment to fields of some
>>> structs) to be able to use my compilers.
>>> Then I tried these compilers:
>>> gcc 13.2.0 - this worked. (I assume it is supposed to show some
>>> plaintext, encrypted text starting "fog.IiQ' U'?zDjP))v$oN)?z<xT
>>> CAPNKUfB...", then the identical plaintext)
>>> tcc - failed. The encrypted text started
>>> "xy,$}lu~@NM*a%^z1YA+'N@9yrV]E...", and the decrypted was:
>>> "dEjtkuXVjq5*uzqpWXE6tkzXVjq5czuqpWXE!t9zX\j35czu30/XE!tkuX\!qocuu3pWXEjtkzXVj3oczuq4WXE!0
>>> kz.Vjqocuu3p/TEj0ku.Vj31cuz3pWXEjtkzXVj3o*uzq4W."
>>
>> Regarding tcc, a few things differ internally, but I think one clue is here:
>>
>> #define CT_MBROT_ABET_LOOKUP(mp_char) \
>> ((strchr(CT_MBROT_ABET, (mp_char))) - CT_MBROT_ABET)
>>
>> This is effectively doing the following (to get an offset into the string?):
>>
>> str("ABC", c) - "ABC";
>>
>> It is assuming that both string literals have the same address.
>
> This is an unwarranted assumption.
>
> But the result is also undefined when mp_char does not occur in the
> string which can happen for two printable ASCII characters.
>
> Chris, you should test your code more thoroughly.

Yup. This was quickly fleshed out a while back, and I recently got
reminded if it. So, I ran it again, and noticed the inconsistent
behavior between the two compilers, (MSVC and GCC). This has to be due
to undefined behavior in my code. So, yes, I agree with you, Ben. Big time.

>
>> If I move that string into a variable, then Tcc starts to work. So does
>> bcc.
>
> Saying that tcc starts to work when you fix the bug suggests that tcc
> was not working before, but it's the code that was not working. tcc
> (and presumably bcc) were working fine all along.
>
>> lccwin32 still has a problem.
>
> What's the problem? Are you sure it's lccwin32 and not the source code
> that has the problem?
>

It almost has to be errors in my code. 99.9...% ;^)

Re: Inconsistent...

<uhrp1j$16v9f$2@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=31618&group=comp.lang.c#31618

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m.thomasson.1@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c
Subject: Re: Inconsistent...
Date: Tue, 31 Oct 2023 13:45:39 -0700
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <uhrp1j$16v9f$2@dont-email.me>
References: <uhp5jb$kbc1$2@dont-email.me> <87r0lbr7lp.fsf@bsb.me.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 31 Oct 2023 20:45:40 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="79e6b99247793a94ad1533012982a485";
logging-data="1277231"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+j8C1I3gaBHjUkAXXpGhP5J1F1+16/1Ck="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:DAIildZCFPHGBTML3EiqEWY6c2Q=
In-Reply-To: <87r0lbr7lp.fsf@bsb.me.uk>
Content-Language: en-US
 by: Chris M. Thomasson - Tue, 31 Oct 2023 20:45 UTC

On 10/30/2023 4:52 PM, Ben Bacarisse wrote:
> "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> writes:
>
>> This has to be undefined behavior. Check it out:
>>
>> Here is my C code for a fun toy experimental fractal:
>>
>> https://pastebin.com/raw/fcV5YiJH
>> (raw link to text...)
>
> Ask your compiler for the maximum number of warnings and you should see
> lots. For some reason you are mixing types in a peculiar way, and since
> some of those types often have different sizes you will get different
> arithmetic results on different systems.
>
>> The cpack is different on the two different compilers. Oh, that is always
>> fun!
>
> You need to decide what integer types you really want.
>
>> When you get some free time, can you compile and run my C code and report
>> the output? Thanks everybody.
>
> What will you learn from that? You would be better off asking for the
> warnings we get so you can fix the bugs.
>

I can perhaps learn about some interesting output from compilers that I
have never used before? Fair enough?

Re: Inconsistent...

<uhrq69$17640$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=31620&group=comp.lang.c#31620

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!nntp.comgw.net!paganini.bofh.team!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m.thomasson.1@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c
Subject: Re: Inconsistent...
Date: Tue, 31 Oct 2023 14:05:13 -0700
Organization: A noiseless patient Spider
Lines: 101
Message-ID: <uhrq69$17640$1@dont-email.me>
References: <uhp5jb$kbc1$2@dont-email.me> <uhpdrm$3blvk$1@i2pn2.org>
<uhpndq$3c4tj$1@i2pn2.org> <87lebjqb6g.fsf@bsb.me.uk>
<uhr28e$3dnb9$1@i2pn2.org> <87fs1qrcns.fsf@bsb.me.uk>
<uhrhdm$3edkt$1@i2pn2.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 31 Oct 2023 21:05:14 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="79e6b99247793a94ad1533012982a485";
logging-data="1284224"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/k5eqYL+o2LReFcIs2BLzG1WVte01uRf0="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:SdRW4XKTS7JOwWKqffzElMb400o=
Content-Language: en-US
In-Reply-To: <uhrhdm$3edkt$1@i2pn2.org>
 by: Chris M. Thomasson - Tue, 31 Oct 2023 21:05 UTC

On 10/31/2023 11:35 AM, bart wrote:
> [Another repost as i2pn2 not always sending my messges]
>
> On 31/10/2023 16:15, Ben Bacarisse wrote:
> > bart <bc@freeuk.com> writes:
> >
> >> [Reposting as the original reply seems to have vanished, but it may
> >> reappear]
> >>
> >> On 31/10/2023 11:32, Ben Bacarisse wrote:
> >>> bart <bc@freeuk.com> writes:
> >>>
> >>>> On 30/10/2023 23:22, bart wrote:
> >>>>> On 30/10/2023 21:01, Chris M. Thomasson wrote:
> >>>
> >>>>> I tweaked the source code (used explicit assignment to fields of
> some
> >>>>> structs) to be able to use my compilers.
> >>>>> Then I tried these compilers:
> >>>>> gcc 13.2.0 - this worked. (I assume it is supposed to show some
> >>>>> plaintext, encrypted text starting "fog.IiQ' U'?zDjP))v$oN)?z<xT
> >>>>> CAPNKUfB...", then the identical plaintext)
> >>>>> tcc - failed. The encrypted text started
> >>>>> "xy,$}lu~@NM*a%^z1YA+'N@9yrV]E...", and the decrypted was:
> >>>>>
> >>
> "dEjtkuXVjq5*uzqpWXE6tkzXVjq5czuqpWXE!t9zX\j35czu30/XE!tkuX\!qocuu3pWXEjtkzXVj3oczuq4WXE!0
> >>>>> kz.Vjqocuu3p/TEj0ku.Vj31cuz3pWXEjtkzXVj3o*uzq4W."
> >>>>
> >>>> Regarding tcc, a few things differ internally, but I think one
> clue is
> >>    here:
> >>>>
> >>>>      #define CT_MBROT_ABET_LOOKUP(mp_char) \
> >>>>       ((strchr(CT_MBROT_ABET, (mp_char))) - CT_MBROT_ABET)
> >>>>
> >>>> This is effectively doing the following (to get an offset into the
> >>     string?):
> >>>>
> >>>>       str("ABC", c) - "ABC";
> >>>>
> >>>> It is assuming that both string literals have the same address.
> >>>
> >>> This is an unwarranted assumption.
> >>>
> >>> But the result is also undefined when mp_char does not occur in the
> >>> string which can happen for two printable ASCII characters.
> >>>
> >>> Chris, you should test your code more thoroughly.
> >>>
> >>>> If I move that string into a variable, then Tcc starts to work. So
> does
> >>>> bcc.
> >>>
> >>> Saying that tcc starts to work when you fix the bug suggests that tcc
> >>> was not working before, but it's the code that was not working.  tcc
> >>> (and presumably bcc) were working fine all along.
> >>>
> >>>> lccwin32 still has a problem.
> >>>
> >>> What's the problem?  Are you sure it's lccwin32 and not the source
> code
> >>> that has the problem?
> >>
> >> When I say that compiler X has a problem, obviously I mean that the
> program
> >> built with X shows an error.
> >
> > That's a very odd way of putting it.  My guess is that the
> > program has multiple meanings (and in some cases none).  The compiler is
> > (probably) correctly picking one of them.
> >
> >> That is, the results are incorrect.
> >
> > Ah, then you know more that I.  What are the correct results?
>
> No spec is given. But I would say one requirement is that encrypting and
> then decrypting a piece of plain text should produce the original text.

Indeed. It ideally should work with different compilers, but the
radically infested floating point issues must be an issue. It can act
funny...

>
> Another is that encrypted text should be secret, but lccwin32 for
> example had that be the same as the plaintext! I assumed that was wrong.

Wow! That is really odd to me. Can you drill down on that some more?
Thanks bart.

> There may be others to do with quality of the encryption, as well as
> consistency of the encrpted data across compilers, but those two are
> what stood out for me when I ran the program and which seemed obviously
> wrong.

Take notice of the name... Funny fractal encryption (FFE). So, it is a
fun toy to experiment with, well, imvho that is. :^)

Re: Inconsistent...

<uhrrj0$17gh6$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=31621&group=comp.lang.c#31621

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!news.hispagatos.org!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m.thomasson.1@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c
Subject: Re: Inconsistent...
Date: Tue, 31 Oct 2023 14:29:04 -0700
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <uhrrj0$17gh6$1@dont-email.me>
References: <uhp5jb$kbc1$2@dont-email.me> <87r0lbr7lp.fsf@bsb.me.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 31 Oct 2023 21:29:05 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="79e6b99247793a94ad1533012982a485";
logging-data="1294886"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18/SS4sqBny+eH4zabDC/jvr4I882N37v0="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:h1EdmfV2kx4Su/4aPOV6foALRGs=
In-Reply-To: <87r0lbr7lp.fsf@bsb.me.uk>
Content-Language: en-US
 by: Chris M. Thomasson - Tue, 31 Oct 2023 21:29 UTC

On 10/30/2023 4:52 PM, Ben Bacarisse wrote:
> "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> writes:
>
>> This has to be undefined behavior. Check it out:
>>
>> Here is my C code for a fun toy experimental fractal:
>>
>> https://pastebin.com/raw/fcV5YiJH
>> (raw link to text...)
>
> Ask your compiler for the maximum number of warnings and you should see
> lots. For some reason you are mixing types in a peculiar way, and since
> some of those types often have different sizes you will get different
> arithmetic results on different systems.
>
>> The cpack is different on the two different compilers. Oh, that is always
>> fun!
>
> You need to decide what integer types you really want.
>
>> When you get some free time, can you compile and run my C code and report
>> the output? Thanks everybody.
>
> What will you learn from that? You would be better off asking for the
> warnings we get so you can fix the bugs.
>

Fwiw, I fleshed this out back in 2015. I just got recently reminded of it.

Re: Inconsistent...

<uhrv4p$3evhl$1@i2pn2.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=31622&group=comp.lang.c#31622

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!.POSTED!not-for-mail
From: bc@freeuk.com (bart)
Newsgroups: comp.lang.c
Subject: Re: Inconsistent...
Date: Tue, 31 Oct 2023 22:29:45 +0000
Organization: i2pn2 (i2pn.org)
Message-ID: <uhrv4p$3evhl$1@i2pn2.org>
References: <uhp5jb$kbc1$2@dont-email.me> <uhpdrm$3blvk$1@i2pn2.org>
<uhpndq$3c4tj$1@i2pn2.org> <87lebjqb6g.fsf@bsb.me.uk>
<uhr28e$3dnb9$1@i2pn2.org> <87fs1qrcns.fsf@bsb.me.uk>
<uhrhdm$3edkt$1@i2pn2.org> <uhrq69$17640$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 31 Oct 2023 22:29:45 -0000 (UTC)
Injection-Info: i2pn2.org;
logging-data="3636789"; mail-complaints-to="usenet@i2pn2.org";
posting-account="dVsFrph2cpoFXY+0g13RAVyL1kBF0YjYSsiqIraasbA";
User-Agent: Mozilla Thunderbird
Content-Language: en-GB
In-Reply-To: <uhrq69$17640$1@dont-email.me>
 by: bart - Tue, 31 Oct 2023 22:29 UTC

On 31/10/2023 21:05, Chris M. Thomasson wrote:
> On 10/31/2023 11:35 AM, bart wrote:

>> Another is that encrypted text should be secret, but lccwin32 for
>> example had that be the same as the plaintext! I assumed that was wrong.
>
> Wow! That is really odd to me. Can you drill down on that some more?
> Thanks bart.

That was an apparent bug in the lccwin32's implementation of fmod(),
which always returned 'nan'. It meant every byte of that data block had
the same value.

Re: Inconsistent...

<87a5ryqpc5.fsf@bsb.me.uk>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=31623&group=comp.lang.c#31623

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ben.usenet@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.c
Subject: Re: Inconsistent...
Date: Wed, 01 Nov 2023 00:39:22 +0000
Organization: A noiseless patient Spider
Lines: 83
Message-ID: <87a5ryqpc5.fsf@bsb.me.uk>
References: <uhp5jb$kbc1$2@dont-email.me> <uhpdrm$3blvk$1@i2pn2.org>
<uhpndq$3c4tj$1@i2pn2.org> <87lebjqb6g.fsf@bsb.me.uk>
<uhr28e$3dnb9$1@i2pn2.org> <87fs1qrcns.fsf@bsb.me.uk>
<uhrhdm$3edkt$1@i2pn2.org>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="79d77510b5619879fe941139c0b4673b";
logging-data="1347388"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19/M3EcNPgv0mX/YLmndzt/8nXysDENeAY="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:T0tz1IeNXW/26qFWI89Z25gfip0=
sha1:pzRvGZURUFn3uUXRMS7RWJjvTtM=
X-BSB-Auth: 1.f3bdfe022f3619d7af11.20231101003922GMT.87a5ryqpc5.fsf@bsb.me.uk
 by: Ben Bacarisse - Wed, 1 Nov 2023 00:39 UTC

bart <bc@freeuk.com> writes:

> [Another repost as i2pn2 not always sending my messges]
>
> On 31/10/2023 16:15, Ben Bacarisse wrote:
>> bart <bc@freeuk.com> writes:
>>
>>> [Reposting as the original reply seems to have vanished, but it may
>>> reappear]
>>>
>>> On 31/10/2023 11:32, Ben Bacarisse wrote:
>>>> bart <bc@freeuk.com> writes:
>>>>
>>>>> On 30/10/2023 23:22, bart wrote:
>>>>>> On 30/10/2023 21:01, Chris M. Thomasson wrote:
>>>>
>>>>>> I tweaked the source code (used explicit assignment to fields of some
>>>>>> structs) to be able to use my compilers.
>>>>>> Then I tried these compilers:
>>>>>> gcc 13.2.0 - this worked. (I assume it is supposed to show some
>>>>>> plaintext, encrypted text starting "fog.IiQ' U'?zDjP))v$oN)?z<xT
>>>>>> CAPNKUfB...", then the identical plaintext)
>>>>>> tcc - failed. The encrypted text started
>>>>>> "xy,$}lu~@NM*a%^z1YA+'N@9yrV]E...", and the decrypted was:
>>>>>>
>>>
> "dEjtkuXVjq5*uzqpWXE6tkzXVjq5czuqpWXE!t9zX\j35czu30/XE!tkuX\!qocuu3pWXEjtkzXVj3oczuq4WXE!0
>>>>>> kz.Vjqocuu3p/TEj0ku.Vj31cuz3pWXEjtkzXVj3o*uzq4W."
>>>>>
>>>>> Regarding tcc, a few things differ internally, but I think one clue is
>>> here:
>>>>>
>>>>> #define CT_MBROT_ABET_LOOKUP(mp_char) \
>>>>> ((strchr(CT_MBROT_ABET, (mp_char))) - CT_MBROT_ABET)
>>>>>
>>>>> This is effectively doing the following (to get an offset into the
>>> string?):
>>>>>
>>>>> str("ABC", c) - "ABC";
>>>>>
>>>>> It is assuming that both string literals have the same address.
>>>>
>>>> This is an unwarranted assumption.
>>>>
>>>> But the result is also undefined when mp_char does not occur in the
>>>> string which can happen for two printable ASCII characters.
>>>>
>>>> Chris, you should test your code more thoroughly.
>>>>
>>>>> If I move that string into a variable, then Tcc starts to work. So does
>>>>> bcc.
>>>>
>>>> Saying that tcc starts to work when you fix the bug suggests that tcc
>>>> was not working before, but it's the code that was not working. tcc
>>>> (and presumably bcc) were working fine all along.
>>>>
>>>>> lccwin32 still has a problem.
>>>>
>>>> What's the problem? Are you sure it's lccwin32 and not the source code
>>>> that has the problem?
>>>
>>> When I say that compiler X has a problem, obviously I mean that the
> program
>>> built with X shows an error.
>>
>> That's a very odd way of putting it. My guess is that the
>> program has multiple meanings (and in some cases none). The compiler is
>> (probably) correctly picking one of them.
>>
>>> That is, the results are incorrect.
>>
>> Ah, then you know more that I. What are the correct results?
>
> No spec is given. But I would say one requirement is that encrypting and
> then decrypting a piece of plain text should produce the original
> text.

I think we've ended up talking about different things. I've not seen
such a run. The OP posted two runs that both re-created the original
text, but which had different intermediate data.

--
Ben.

Re: Inconsistent...

<874ji6qp40.fsf@bsb.me.uk>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=31624&group=comp.lang.c#31624

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ben.usenet@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.c
Subject: Re: Inconsistent...
Date: Wed, 01 Nov 2023 00:44:15 +0000
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <874ji6qp40.fsf@bsb.me.uk>
References: <uhp5jb$kbc1$2@dont-email.me> <uhpdrm$3blvk$1@i2pn2.org>
<uhpndq$3c4tj$1@i2pn2.org> <87lebjqb6g.fsf@bsb.me.uk>
<uhroij$16v9f$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="79d77510b5619879fe941139c0b4673b";
logging-data="1347388"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/+ZcuJskXs8dJNazRSP8p2/CzDWLZGLFY="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:MDKYStoUP4sUWyfBXQKaUf1peEw=
sha1:hsHBCrTm/Kwvsmh7pn7LwUdgQ84=
X-BSB-Auth: 1.12fd114be1c93f357b27.20231101004415GMT.874ji6qp40.fsf@bsb.me.uk
 by: Ben Bacarisse - Wed, 1 Nov 2023 00:44 UTC

"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> writes:

> On 10/31/2023 4:32 AM, Ben Bacarisse wrote:

>> But the result is also undefined when mp_char does not occur in the
>> string which can happen for two printable ASCII characters.
>> Chris, you should test your code more thoroughly.
>
> Yup. This was quickly fleshed out a while back, and I recently got reminded
> if it. So, I ran it again, and noticed the inconsistent behavior between the
> two compilers, (MSVC and GCC). This has to be due to undefined behavior in
> my code. So, yes, I agree with you, Ben. Big time.

I don't if you know what I'm talking about. Did you deliberately leave
out two printable ASCII characters from the alphabet?

--
Ben.

Re: Inconsistent...

<uhsghv$1edat$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=31625&group=comp.lang.c#31625

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m.thomasson.1@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c
Subject: Re: Inconsistent...
Date: Tue, 31 Oct 2023 20:26:54 -0700
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <uhsghv$1edat$1@dont-email.me>
References: <uhp5jb$kbc1$2@dont-email.me> <uhpdrm$3blvk$1@i2pn2.org>
<uhpndq$3c4tj$1@i2pn2.org> <87lebjqb6g.fsf@bsb.me.uk>
<uhroij$16v9f$1@dont-email.me> <874ji6qp40.fsf@bsb.me.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 1 Nov 2023 03:26:55 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="d9f5ddcd76d5c404948bcd25141bfa38";
logging-data="1520989"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/I6bf5QdNHAwHkG19V2ydLNF/eDu17ruM="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:sXP3ZUhBOM55dBZ47vsThphv0P0=
Content-Language: en-US
In-Reply-To: <874ji6qp40.fsf@bsb.me.uk>
 by: Chris M. Thomasson - Wed, 1 Nov 2023 03:26 UTC

On 10/31/2023 5:44 PM, Ben Bacarisse wrote:
> "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> writes:
>
>> On 10/31/2023 4:32 AM, Ben Bacarisse wrote:
>
>>> But the result is also undefined when mp_char does not occur in the
>>> string which can happen for two printable ASCII characters.
>>> Chris, you should test your code more thoroughly.
>>
>> Yup. This was quickly fleshed out a while back, and I recently got reminded
>> if it. So, I ran it again, and noticed the inconsistent behavior between the
>> two compilers, (MSVC and GCC). This has to be due to undefined behavior in
>> my code. So, yes, I agree with you, Ben. Big time.
>
> I don't if you know what I'm talking about. Did you deliberately leave
> out two printable ASCII characters from the alphabet?
>

No.

Re: Inconsistent...

<uht9l6$3gfat$1@i2pn2.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=31626&group=comp.lang.c#31626

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!.POSTED!not-for-mail
From: bc@freeuk.com (bart)
Newsgroups: comp.lang.c
Subject: Re: Inconsistent...
Date: Wed, 1 Nov 2023 10:35:17 +0000
Organization: i2pn2 (i2pn.org)
Message-ID: <uht9l6$3gfat$1@i2pn2.org>
References: <uhp5jb$kbc1$2@dont-email.me> <uhpdrm$3blvk$1@i2pn2.org>
<uhpndq$3c4tj$1@i2pn2.org> <87lebjqb6g.fsf@bsb.me.uk>
<uhr28e$3dnb9$1@i2pn2.org> <87fs1qrcns.fsf@bsb.me.uk>
<uhrhdm$3edkt$1@i2pn2.org> <87a5ryqpc5.fsf@bsb.me.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 1 Nov 2023 10:35:18 -0000 (UTC)
Injection-Info: i2pn2.org;
logging-data="3685725"; mail-complaints-to="usenet@i2pn2.org";
posting-account="dVsFrph2cpoFXY+0g13RAVyL1kBF0YjYSsiqIraasbA";
User-Agent: Mozilla Thunderbird
In-Reply-To: <87a5ryqpc5.fsf@bsb.me.uk>
Content-Language: en-GB
 by: bart - Wed, 1 Nov 2023 10:35 UTC

On 01/11/2023 00:39, Ben Bacarisse wrote:
> bart <bc@freeuk.com> writes:
>

>> No spec is given. But I would say one requirement is that encrypting and
>> then decrypting a piece of plain text should produce the original
>> text.
>
> I think we've ended up talking about different things. I've not seen
> such a run. The OP posted two runs that both re-created the original
> text, but which had different intermediate data.
>

Have you tried to run this program? It produces 4 lots of output:

* A big block of random text

* Some plaintext

* The encrypted text

* The decrypted text

The only results posted by the OP were /screenshots/ which showed /part/
of that first data block. One also shows a scroll-bar, but you can't
click it - it's part of the image!

So I don't know what you've seen. I've also mentioned several times that
I'm not just looking at discrepances within that data block across
compilers, but differences and errors in those 3rd and 4th parts.

Re: Inconsistent...

<uhtb2h$3gfat$2@i2pn2.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=31627&group=comp.lang.c#31627

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!.POSTED!not-for-mail
From: bc@freeuk.com (bart)
Newsgroups: comp.lang.c
Subject: Re: Inconsistent...
Date: Wed, 1 Nov 2023 10:59:29 +0000
Organization: i2pn2 (i2pn.org)
Message-ID: <uhtb2h$3gfat$2@i2pn2.org>
References: <uhp5jb$kbc1$2@dont-email.me> <uhpdrm$3blvk$1@i2pn2.org>
<uhpndq$3c4tj$1@i2pn2.org> <87lebjqb6g.fsf@bsb.me.uk>
<uhroij$16v9f$1@dont-email.me> <874ji6qp40.fsf@bsb.me.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 1 Nov 2023 10:59:29 -0000 (UTC)
Injection-Info: i2pn2.org;
logging-data="3685725"; mail-complaints-to="usenet@i2pn2.org";
posting-account="dVsFrph2cpoFXY+0g13RAVyL1kBF0YjYSsiqIraasbA";
User-Agent: Mozilla Thunderbird
Content-Language: en-GB
In-Reply-To: <874ji6qp40.fsf@bsb.me.uk>
 by: bart - Wed, 1 Nov 2023 10:59 UTC

On 01/11/2023 00:44, Ben Bacarisse wrote:
> "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> writes:
>
>> On 10/31/2023 4:32 AM, Ben Bacarisse wrote:
>
>>> But the result is also undefined when mp_char does not occur in the
>>> string which can happen for two printable ASCII characters.
>>> Chris, you should test your code more thoroughly.
>>
>> Yup. This was quickly fleshed out a while back, and I recently got reminded
>> if it. So, I ran it again, and noticed the inconsistent behavior between the
>> two compilers, (MSVC and GCC). This has to be due to undefined behavior in
>> my code. So, yes, I agree with you, Ben. Big time.
>
> I don't if you know what I'm talking about. Did you deliberately leave
> out two printable ASCII characters from the alphabet?
>

Might be helpful to mention that they are | and ".

Re: Inconsistent...

<87y1fhpwc5.fsf@bsb.me.uk>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=31628&group=comp.lang.c#31628

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ben.usenet@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.c
Subject: Re: Inconsistent...
Date: Wed, 01 Nov 2023 11:05:46 +0000
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <87y1fhpwc5.fsf@bsb.me.uk>
References: <uhp5jb$kbc1$2@dont-email.me> <uhpdrm$3blvk$1@i2pn2.org>
<uhpndq$3c4tj$1@i2pn2.org> <87lebjqb6g.fsf@bsb.me.uk>
<uhroij$16v9f$1@dont-email.me> <874ji6qp40.fsf@bsb.me.uk>
<uhsghv$1edat$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="79d77510b5619879fe941139c0b4673b";
logging-data="1675876"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19uCBrP2uXh/hBcPVIe1wtI/SN3EnNOO/o="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:xSUURljG6lF0CUQd1tHQ//Or5S4=
sha1:+FVWddQbVkuzhhm6+nTpoioh9iE=
X-BSB-Auth: 1.fd14a2324fca7b2517ae.20231101110546GMT.87y1fhpwc5.fsf@bsb.me.uk
 by: Ben Bacarisse - Wed, 1 Nov 2023 11:05 UTC

"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> writes:

> On 10/31/2023 5:44 PM, Ben Bacarisse wrote:
>> "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> writes:
>>
>>> On 10/31/2023 4:32 AM, Ben Bacarisse wrote:
>>
>>>> But the result is also undefined when mp_char does not occur in the
>>>> string which can happen for two printable ASCII characters.
>>>> Chris, you should test your code more thoroughly.
>>>
>>> Yup. This was quickly fleshed out a while back, and I recently got reminded
>>> if it. So, I ran it again, and noticed the inconsistent behavior between the
>>> two compilers, (MSVC and GCC). This has to be due to undefined behavior in
>>> my code. So, yes, I agree with you, Ben. Big time.
>> I don't if you know what I'm talking about. Did you deliberately leave
>> out two printable ASCII characters from the alphabet?
>
> No.

You had a clue: you print the alphabet length as 93. Including space,
there are 95 "non-control" ASCII characters.

--
Ben.

Re: Inconsistent...

<uhtem5$1jnt4$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=31629&group=comp.lang.c#31629

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!rocksolid2!news.neodome.net!news.mixmin.net!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.brown@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: Inconsistent...
Date: Wed, 1 Nov 2023 13:01:09 +0100
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <uhtem5$1jnt4$1@dont-email.me>
References: <uhp5jb$kbc1$2@dont-email.me> <uhpdrm$3blvk$1@i2pn2.org>
<uhpndq$3c4tj$1@i2pn2.org> <87lebjqb6g.fsf@bsb.me.uk>
<uhroij$16v9f$1@dont-email.me> <874ji6qp40.fsf@bsb.me.uk>
<uhtb2h$3gfat$2@i2pn2.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 1 Nov 2023 12:01:09 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="53a6e283037f1200d424111992d02f8c";
logging-data="1695652"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+t5xggkeX+eAc8SsX4N30fG0/UswZWbC0="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:JNYiPdGo4dDXqhv/YwHoixJbDUw=
Content-Language: en-GB
In-Reply-To: <uhtb2h$3gfat$2@i2pn2.org>
 by: David Brown - Wed, 1 Nov 2023 12:01 UTC

On 01/11/2023 11:59, bart wrote:
> On 01/11/2023 00:44, Ben Bacarisse wrote:
>> "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> writes:
>>
>>> On 10/31/2023 4:32 AM, Ben Bacarisse wrote:
>>
>>>> But the result is also undefined when mp_char does not occur in the
>>>> string which can happen for two printable ASCII characters.
>>>> Chris, you should test your code more thoroughly.
>>>
>>> Yup. This was quickly fleshed out a while back, and I recently got
>>> reminded
>>> if it. So, I ran it again, and noticed the inconsistent behavior
>>> between the
>>> two compilers, (MSVC and GCC). This has to be due to undefined
>>> behavior in
>>> my code. So, yes, I agree with you, Ben. Big time.
>>
>> I don't if you know what I'm talking about.  Did you deliberately leave
>> out two printable ASCII characters from the alphabet?
>>
>
> Might be helpful to mention that they are | and ".

| and -, as far as I could see in a quick look at the code.

It seems bizarre to spell out lists of ASCII characters in the code
rather than just a simple loop at runtime.

Pages:123
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor