Score:2

How to find linear complexity of non binary prime fields using berlekamp_massey algorithm in Sagemath?

cn flag

I am having a prime field of large size (assume it of the type GF(2**18)) and I need to find linear complexity of a sequence (of some specified length) defined on this field. I am using the inbuilt berlekamp_massey function to get the linear complexity (the degree of minimal polynomial) of the sequence. Current Work:

from sage.matrix.berlekamp_massey import berlekamp_massey
F = GF(2**18)
.
.

#Function to get a primitive element
#function to generate the desired sequence
.
.
#sequence in hand Let's call it s
lin_complexity = berlekamp_massey(s).degree()
#The lin_complexity turns out to be a float which is incorrect

Issue I am getting wrong results as linear complexity is turning out to be a float number. Please help me understand how to calculate linear complexity of non-binary sequences in sagemath.

fgrieu avatar
ng flag
But $\operatorname{GF}(2^{18})$ is not a prime field! Also, it is not of large size from a cryptographic standpoint. Perhaps show us what `type(s[0])`and `s[0].base_ring()` are. Does the problem happen with `s` shortened to `s[0:4]` ? Independently: this is more a Sagemath question than a crypto question.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.