• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Snippet] sbox

Level 6
Joined
Jan 17, 2010
Messages
149
wonder if it's possible for a better syntax to swap values in the box..

lets say I wanted to use a different box.. I'd have to rewrite the whole thing.. making this rather more useless to jass than it is right now.

maybe there's a way to abuse /* */ + comment new line removal + string parser + 2D arrays here.

hashtable + stringhash sounds more natural than arrays.. also..
 
Level 6
Joined
Jan 17, 2010
Messages
149
you're using a 16 by 16. Standard stuff.

I'm talking about defining a custom size 8 by 8 ... 32 by 32.. etc + it's contents (i.e instead of defining 0xXX + XbyY array calls, just put string and parser parses it).

But not sure if vjass syntax can support it easily, otherwise we are stuck with rewriting this.

Strong encryption for anything a wc3 map generates not possible unless you can hash the map file itself WHILE running the map. But that's beside the point.
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
hm...

8x8 would have less possible permutations, so that shouldn't really be done. 32x32 would be interesting, but you'd need to link a 32x32 sbox. Well, you could generate it using the math I suppose.


I hardcoded it as I figured everyone would use 16x16. That's pretty standard.

Read up on here to generate them dynamically -> http://en.wikipedia.org/wiki/Rijndael_S-box
 
Level 6
Joined
Jan 17, 2010
Messages
149
I'm trying to be constructively critical here, probably not very good at it

Between you and me, nobody else will probably use this, and I already have a similar thing like this. Heck, doubt even 5 people on here will understand what this is without looking up a wiki.

I used 64x64 because I was lazy and didn't want to deal with B64->B16->B64 BS. Weakness from this is irrelevant.. strong cipher not possible.. we have a nasty loophole.

However a syntax for defining 2D arrays would be sexy and solve all these kinds of problems (i viewed your other resources)

ex:

Code:
String row1 = "00,01,aa,bb, .. etc"
String row2 = "ba,66,11, ..etc"
 
Top