Group Abstract Group Abstract

Message Boards Message Boards

Integer Differential Cryptanalisys of Kuznyechik cipher

POSTED BY: Dariia Porechna
4 Replies

enter image description here - you earned "Featured Contributor" badge, congratulations !

This is a great post and it has been selected for the curated Staff Picks group. Your profile is now distinguished by a "Featured Contributor" badge and displayed on the "Featured Contributor" board.

POSTED BY: EDITORIAL BOARD

Thanks for sharing! Very interesting.

In your code:

Table[Do[AppendTo[tabs,RandomSample[rows[[RandomInteger[{1,l}]]]]],{size}],{quan}];

You might be able to speed this up considerably by not repeatedly appending things to tabs, but rather using Sow and Reap like so (i did not test it, but should work):

tabs =  Reap[Table[Do[Sow[RandomSample[rows[[RandomInteger[{1, l}]]]]],{size}],{quan}]][[2,1]];

Since you don't use 'Table' to store things, it might be faster to use a Do loop as well. And you can combine the two do loops for additional speed:

Do[......,{quan},{size}]  (* the opposite order*)

and now since Mathematica 10 (I believe) you can even simplify that further:

Do[......,quan,size]

Also:

Mod[{gam,gam+1,gam+2,gam+3,gam+4,gam+5,gam+6,gam+7,gam+8},256]

If i understand correctly if gam just a number. In that case you can make it faster and neater doing this:

Mod[gam+Range[0,8],256]

Once again, thanks for sharing!

POSTED BY: Sander Huisman

These are really good advices, thank you!

POSTED BY: Dariia Porechna

You're welcome.

I'm just puzzled by this line of code:

    Map[Mod[#,mod]&, Table[(-1)^(i+j) Det[Delete[#,j]&/@Delete[matrix,i]],{j,16},{i,16}]*PowerMod[Det[matrix],-1,mod],{2}];

Very intricate code :-D

Btw Mod[Table[................],mod] will just work fine, no need to Map it, Mod is listable...

POSTED BY: Sander Huisman
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard