🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.delphi.basm
5 messages
5 total messages Started by Diviner Chan Fri, 06 Sep 2002 19:14
How to make invert for a 8-bit value?
#99
Author: Diviner Chan
Date: Fri, 06 Sep 2002 19:14
10 lines
1225 bytes
Hi,

I wait to wait a DES sub-routine. Some of the steps needs make invert
for 8-bit, 16-bit, 32-bit (and so forth) values. Any shortest code for
it?
Of cause I hope the code is in ASM because of good efficiency.

--
Best regards,
Diviner.
Re: How to make invert for a 8-bit value?
#194
Author: Gary Williams
Date: Fri, 06 Sep 2002 21:10
20 lines
1374 bytes
"Diviner Chan" <diviner@i-cable.com> wrote in message
news:3D78FE88.468B70BE@i-cable.com...
> Hi,
>
> I wait to wait a DES sub-routine. Some of the steps needs make invert
> for 8-bit, 16-bit, 32-bit (and so forth) values. Any shortest code for
> it?

X := not X; // X is a variable any ordinal type

> Of cause I hope the code is in ASM because of good efficiency.

not al
not ax
not eax

etc.

-Gary
Re: How to make invert for a 8-bit value?
#202
Author: Guido Gybels
Date: Mon, 09 Sep 2002 07:27
20 lines
1519 bytes
"Diviner Chan" <diviner@i-cable.com> wrote in message
news:3D78FE88.468B70BE@i-cable.com...
> I wait to wait a DES sub-routine. Some of the steps needs make invert
> for 8-bit, 16-bit, 32-bit (and so forth) values. Any shortest code for
> it?

See description of "not" in the fine manual.

> Of cause I hope the code is in ASM because of good efficiency.

The compiler will already generate the most optimal code for this.

Guido


--
Guido Gybels
http://www.optimalcode.com/Guido
(Disclaimer: all remarks made apply to Intel processors unless specified
otherwise)
Re: How to make invert for a 8-bit value?
#204
Author: Guido Gybels
Date: Mon, 09 Sep 2002 08:11
24 lines
1885 bytes
"Diviner" <diviner@i-cable.com> wrote in message
news:3D7C5129.54E635@i-cable.com...
> Thank you for your help. But it is not my needed. May be I explain
> more for the requirement for doing DES. What I say Invert like this:
> e.g.: (8bit)
>     10010001 --> 10001001
>     11110000 --> 00001111
>     11000010 --> 01000011

Mirroring of a byte IMHO can be best done using a lookup table with 256
entries That will be the fastest solution (can be done in 1 single operation
after all). The overloaded word and dword versions should simply mirror
every byte separately and use xchg ah,al or bswap to reorder the bytes in
word or dword versions.

Guido

PS: And please do not email me unless agreed beforehand.

--
Guido Gybels
http://www.optimalcode.com/Guido
(Disclaimer: all remarks made apply to Intel processors unless specified
otherwise)
Re: How to make invert for a 8-bit value?
#153
Author: Henrick Hellström
Date: Thu, 12 Sep 2002 23:50
20 lines
1716 bytes
Diviner wrote:
> Gary Williams,
> 
> Thank you for your help. But it is not my needed. May be I explain
> more for the requirement for doing DES. What I say Invert like this:
> e.g.: (8bit)
>     10010001 --> 10001001
>     11110000 --> 00001111
>     11000010 --> 01000011

But there is *no* such operation anywhere in the DES algorithm.


-- 
Henrick Hellstr�m,
StreamSec http://www.streamsec.com
Borland Technology Partner
Need to security enhance your Delphi application? Don't settle for 
anything less than StrSecII:
http://www.streamsec.com/prod_strsec2.asp
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads