Tang-Deng’s g(x/y)

D-Tang 根据Tu-Deng conjecture做的一些工作(论文下载链接)
论文名称:Balanced Boolean Functions with (Almost) Optimal Algebraic Immunity and Very High Nonlinearity
1. Construction1(修改Tu-Deng Function)
这里写图片描述
2.Construction1 optimal algebraic immunity n/2
3.Construction1 algebraic degree n-1
4.Construction 1 nonlinearity

//此为magma代码
//计算唐灯根据Tu-Deng猜想做的工作construction1非线性度
k:=7;
//for ss:=0 to 2^k-2 by 1 do 
ss:=0;
G<x>:=GF(2,k);
Z:=IntegerRing();
g:=[];
for tt:=0 to 2^k-2 by 1 do //初始化g的真值表全为0
bin1:=Eltseq(x^tt, GF(2)); toInt1 := [Z | bin1 [j] : j in {1.. k by 1}];
k1:=&+[toInt1[i]*(2^(i-1)): i in [1..k]]; g[k1]:=0;
end for;

n:=2*k;
F<w>:=GF(2,n);
f:=[];
for tt:=0 to 2^n-2 by 1 do //初始化f的真值表全为0
bin3:=Eltseq(w^tt, GF(2)); toInt3 := [Z | bin3 [j] : j in {1.. n by 1}];
k3:=&+[toInt3[i]*(2^(i-1)): i in [1..n]]; f[k3]:=0;
end for;

for tt:=0+ss to 2^(k-1)+ss-1 by 1 do //根据g的支撑架生成g的真值表
bin2:=Eltseq(x^tt, GF(2)); toInt2 := [Z | bin2 [j] : j in {1.. k by 1}];
k2:=&+[toInt2[i]*(2^(i-1)): i in [1..k]]; g[k2]:=1;
end for;
//g:=[0] cat g;

for tt:=0 to 2^k-2 by 1 do //x不等于0,y不等于0
    for dd:=0 to 2^k-2 by 1 do 
    bin4:=Eltseq(x^tt, GF(2)); toInt4 := [Z | bin4 [j] : j in {1.. k by 1}];
    bin5:=Eltseq(x^dd, GF(2)); toInt5 := [Z | bin5 [j] : j in {1.. k by 1}];
    bin6:=Eltseq(x^(tt-dd), GF(2)); toInt6 := [Z | bin6 [j] : j in {1.. k by 1}];
    toIntw:=toInt4 cat toInt5;
    k4:=&+[toIntw[i]*(2^(i-1)): i in [1..n]]; 
    k5:=&+[to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0,1,0,0,0,1,1,0,1,1,1,0,\
    0,0,1,1,0,0,0,1,0,0,1,1,1,1,0,0,0,1,1,1,0,0,0,1,0,0,1,1,0,1,0,0,1,1,1,\
    0,1,1,0,0,1,0,1,0,0,1,1,0,1,1,0];

for dd:=0 to 2^k-2 by 1 do //当x=0,根据不同k值,选取不同u(x)的真值表
    bin7:=Eltseq(x^dd, GF(2)); toInt7 := [Z | bin7 [j] : j in {1.. k by 1}];
    k7:=&+[toInt7[i]*(2^(i-1)): i in [1..k]]; f[k7]:=u7[k7+1];
end for;

for tt:=0 to 2^k-2 by 1 do //x不等于0,y=0
    bin8:=Eltseq(x^tt, GF(2)); toInt8 := [Z | bin8 [j] : j in {1.. k by 1}];
    k8:=&+[toInt8[i]*(2^(i+k-1)): i in [1..k]]; f[k8]:=0;
end for;

f:=[u7[1]] cat f;

a:= [1-2*f[i]:i in [1..2^n]];
for tt:=1 to n by 1 do // butterfly algorithm
    t:=2^n div 2^tt;
for j:=0 to 2^tt-1 by 2 do
for l:=1 to t by 1 do
        a[t*j+l]:=a[t*j+l]+a[t*(j+1)+l];
        a[t*(j+1)+l]:=a[t*j+l]-2*a[t*(j+1)+l];
end for;
    end for;
end for;
b:=[Abs (a[i]):i in [1..2^n]];
nl:=2^(n-1)-Max(b) div 2;
nl;
Write("input.txt",f);
//end for;

程序计算结果
这里写图片描述

5.construction1 Immunity against fast algebraic attacks
n=4: (1,1)
n=6; (1,3),(2,2)
n=8: (1,4),(2,4),(3,3)
n=10: (1,5),(2,5),(3,5),(4,4)
n=12: (1,6),(2,6),(3,6),(4,6),(5,5)
6.Construction2
这里写图片描述
7.Construction2 is 1-Resilient
这里写图片描述
8.Construction algebraic immunity ≥(n-2)/2
9.Construction2 algebraic degree n-2
10.The low bound of Construction2 nonlinearity
这里写图片描述
11.The real value of Construction2 nonlinearity

//此为magma代码
//计算唐灯根据Tu-Deng猜想做的工作construction2一阶弹性函数非线性度
k:=6;
G<x>:=GF(2,k);
Z:=IntegerRing();
g:=[];
for tt:=0 to 2^k-2 by 1 do //初始化g的真值表全为0
bin1:=Eltseq(x^tt, GF(2)); toInt1 := [Z | bin1 [j] : j in {1.. k by 1}];
k1:=&+[toInt1[i]*(2^(i-1)): i in [1..k]]; g[k1]:=0;
end for;

n:=2*k;
F<w>:=GF(2,n);
f:=[];
for tt:=0 to 2^n-2 by 1 do //初始化f的真值表全为0
bin3:=Eltseq(w^tt, GF(2)); toInt3 := [Z | bin3 [j] : j in {1.. n by 1}];
k3:=&+[toInt3[i]*(2^(i-1)): i in [1..n]]; f[k3]:=0;
end for;


for tt:=0 to 2^(k-1)-1 by 1 do //根据g的支撑架生成g的真值表
bin2:=Eltseq(x^tt, GF(2)); toInt2 := [Z | bin2 [j] : j in {1.. k by 1}];
k2:=&+[toInt2[i]*(2^(i-1)): i in [1..k]]; g[k2]:=1;
end for;
//g:=[0] cat g;

//设定u(x)真值表
u2:=[0,1,1,0];
u3:=[1,1,1,0,0,1,0,0];
u4:=[0,1,1,0,0,1,0,1,0,0,1,1,0,1,1,0];
u5:=[0,0,1,0,0,1,0,1,1,1,1,1,1,0,1,1,0,1,1,1,0,0,0,0,0,1,0,1,0,1,0,0];
u6:=[0,1,0,1,0,1,1,0,0,1,1,1,0,1,0,0,1,1,0,0,0,1,1,0,1,0,1,1,0,0,0,1,\
    0,1,1,1,0,0,0,1,1,0,1,0,0,0,1,1,1,0,0,0,0,1,1,1,1,1,1,0,0,1,0,0];
u7:=[1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,\
    0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,0,1,\
    1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,1,0,\
    1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1];
u8:=[0,1,0,1,1,1,0,0,1,0,0,0,0,1,1,1,0,1,1,1,1,1,0,0,1,0,0,0,0,1,1,0,0,\
    1,0,0,1,1,0,0,1,0,1,0,0,1,1,1,1,1,1,1,0,0,1,1,0,1,0,1,0,0,0,0,0,1,\
    1,1,0,1,1,1,0,1,0,1,0,0,0,0,0,1,1,1,0,1,1,0,0,0,0,1,0,1,1,0,1,0,0,0,\
    1,1,0,0,1,0,1,0,0,1,1,1,1,0,0,0,1,0,1,1,0,1,1,1,0,0,0,1,0,1,1,1,0,1,0,\
    0,1,0,0,1,0,1,1,0,1,0,1,1,0,0,1,1,0,1,1,1,0,0,0,0,0,1,1,1,0,1,1,0,0,1,\
    0,1,0,1,0,0,1,0,0,0,1,0,1,1,1,1,1,0,0,0,0,1,1,0,1,0,0,0,1,1,0,1,1,1,0,\
    0,0,1,1,0,0,0,1,0,0,1,1,1,1,0,0,0,1,1,1,0,0,0,1,0,0,1,1,0,1,0,0,1,1,1,\
    0,1,1,0,0,1,0,1,0,0,1,1,0,1,1,0];

for tt:=0 to 2^k-2 by 1 do //x不等于0,y不等于0
    for dd:=0 to 2^k-2 by 1 do 
    if (tt ne dd) then 
    bin4:=Eltseq(x^tt, GF(2)); toInt4 := [Z | bin4 [j] : j in {1.. k by 1}];
    bin5:=Eltseq(x^dd, GF(2)); toInt5 := [Z | bin5 [j] : j in {1.. k by 1}];
    bin6:=Eltseq(x^(tt-dd), GF(2)); toInt6 := [Z | bin6 [j] : j in {1.. k by 1}];
    toIntw:=toInt4 cat toInt5;
    k4:=&+[toIntw[i]*(2^(i-1)): i in [1..n]]; 
    k5:=&+[toInt6[i]*(2^(i-1)): i in [1..k]];
    value:=g[k5];
    f[k4]:=value;
    end if;
    end for;
end for;

//x=y不等于0
for tt:=0 to 2^k-2 by 1 do 
    bin7:=Eltseq(x^tt, GF(2)); toInt7 := [Z | bin7 [j] : j in {1.. k by 1}];
    bin8:=Eltseq(x^dd, GF(2)); toInt8 := [Z | bin8 [j] : j in {1.. k by 1}];
    toIntw1:=toInt7 cat toInt8;
    k6:=&+[toIntw[i]*(2^(i-1)): i in [1..n]]; 
    k7:=&+[toInt7[i]*(2^(i-1)): i in [1..k]];
    f[k6]:=(1+u6[k7+1])mod 2;//此处有u
end for;

for tt:=0 to 2^k-2 by 1 do //x不等于0,y=0
    bin9:=Eltseq(x^tt, GF(2)); toInt9 := [Z | bin9 [j] : j in {1.. k by 1}];
    k8:=&+[toInt9[i]*(2^(i+k-1)): i in [1..k]]; 
    k9:=&+[toInt9[i]*(2^(i-1)): i in [1..k]];
    f[k8]:=u6[k9+1];//此处有u

end for;

for tt:=0 to 2^k-2 by 1 do //x等于0,y不等于0
    bin10:=Eltseq(x^tt, GF(2)); toInt10 := [Z | bin10 [j] : j in {1.. k by 1}];
    k10:=&+[toInt10[i]*(2^(i-1)): i in [1..k]]; f[k10]:=0;
    f[k10]:=u6[k10+1];//此处有u
end for;

f:=[u6[1]] cat f;

a:= [1-2*f[i]:i in [1..2^n]];
for tt:=1 to n by 1 do // butterfly algorithm
    t:=2^n div 2^tt;
for j:=0 to 2^tt-1 by 2 do
for l:=1 to t by 1 do
        a[t*j+l]:=a[t*j+l]+a[t*(j+1)+l];
        a[t*(j+1)+l]:=a[t*j+l]-2*a[t*(j+1)+l];
end for;
    end for;
end for;
b:=[Abs (a[i]):i in [1..2^n]];
nl:=2^(n-1)-Max(b) div 2;
nl;
//Write("input.txt",f);
//end for;

程序计算结果
这里写图片描述
12.Construction2 immunity against fast algebraic attacks
n=6: (1,4),(2,2)
n=8: (1,5),(2,4),(3,3)
n=10: (1,7),(2,5),(3,5),(4,4)
n= 12: (1,9),(2,6),(3,6),(4,6),(5,5)
n=14: (1,10),(2,7),(3,7)

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值