Re: [sage-support] Error when trying to input an 8-bit Sbox into the argument of S = mq.SBox(.)

95 views
Skip to first unread message

Martin Albrecht

unread,
Dec 22, 2012, 12:16:31 PM12/22/12
to sage-s...@googlegroups.com

Pass a list of numbers instead of independent numbers. SBox( [1,2,3]) not SBox(1,2,3)

sent from a telephone.

On 19 Dec 2012 08:17, "sea21" <choyva...@gmail.com> wrote:
Why is it that when I try to input an 8-bit Sbox into the argument of S = mq.SBox(.), I get the error: "SyntaxError: more than 255 arguments"? Does this class not work for more than 7-bit S-boxes?

--
You received this message because you are subscribed to the Google Groups "sage-support" group.
To post to this group, send email to sage-s...@googlegroups.com.
To unsubscribe from this group, send email to sage-support...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.


Lei Poo

unread,
Jun 18, 2014, 8:48:59 PM6/18/14
to sage-s...@googlegroups.com, martinr...@googlemail.com
I am also having this problem. I also tried enclosing the numbers with [ ], i.e. S=mq.SBox([1,2,3]) but it did not work. Does anybody know how to fix this?

Martin Albrecht

unread,
Jun 19, 2014, 4:31:57 AM6/19/14
to sage-s...@googlegroups.com
Works for me.


sage: s = range(256)
sage: S = mq.SBox(s)
sage: S
(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128,
129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158,
159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173,
174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188,
189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203,
204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218,
219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233,
234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248,
249, 250, 251, 252, 253, 254, 255)
sage: shuffle(s)
sage: S = mq.SBox(s)
sage: S
(198, 15, 199, 161, 183, 147, 244, 107, 95, 14, 193, 139, 216, 231, 144, 20,
63, 228, 46, 72, 235, 143, 169, 186, 90, 210, 121, 190, 194, 101, 10, 3, 180,
43, 120, 42, 73, 117, 222, 254, 45, 105, 148, 109, 128, 178, 159, 8, 52, 217,
170, 75, 2, 239, 221, 48, 140, 233, 103, 94, 245, 34, 224, 122, 208, 18, 189,
100, 204, 85, 201, 114, 58, 12, 131, 57, 205, 206, 53, 69, 24, 214, 51, 243,
96, 55, 184, 188, 28, 236, 29, 197, 227, 6, 7, 56, 16, 226, 154, 61, 116, 242,
153, 157, 150, 181, 86, 44, 185, 168, 187, 74, 76, 225, 36, 156, 195, 171, 92,
158, 155, 149, 135, 234, 249, 64, 70, 84, 127, 252, 182, 93, 237, 138, 71,
232, 220, 47, 196, 203, 134, 27, 81, 68, 39, 41, 129, 173, 142, 118, 11, 82,
112, 123, 30, 26, 200, 219, 50, 209, 79, 229, 31, 246, 207, 25, 124, 22, 241,
176, 108, 179, 141, 13, 126, 247, 212, 106, 102, 165, 21, 33, 60, 104, 132,
17, 191, 125, 174, 99, 0, 215, 97, 145, 23, 137, 83, 80, 192, 111, 177, 230,
162, 9, 166, 146, 19, 110, 38, 255, 240, 136, 88, 4, 78, 160, 113, 119, 59,
223, 250, 251, 62, 49, 213, 151, 89, 115, 164, 66, 248, 152, 172, 32, 238,
211, 167, 35, 40, 175, 1, 130, 163, 77, 253, 133, 87, 91, 37, 218, 54, 98, 67,
65, 5, 202)

On Wednesday 18 Jun 2014 17:48:59 Lei Poo wrote:
> I am also having this problem. I also tried enclosing the numbers with [ ],
> i.e. S=mq.SBox([1,2,3]) but it did not work. Does anybody know how to fix
> this?
>
> On Saturday, December 22, 2012 9:16:31 AM UTC-8, Martin Albrecht wrote:
> > Pass a list of numbers instead of independent numbers. SBox( [1,2,3]) not
> > SBox(1,2,3)
> >
> > sent from a telephone.
> >
> > On 19 Dec 2012 08:17, "sea21" <choyva...@gmail.com <javascript:>> wrote:
> >> Why is it that when I try to input an 8-bit Sbox into the argument of S =
> >> mq.SBox(.), I get the error: "SyntaxError: more than 255 arguments"? Does
> >> this class not work for more than 7-bit S-boxes?
> >>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "sage-support" group.
> >> To post to this group, send email to sage-s...@googlegroups.com
> >> <javascript:>.
> >> To unsubscribe from this group, send email to
> >> sage-support...@googlegroups.com <javascript:>.
Reply all
Reply to author
Forward
0 new messages