Changeset ddc193 in git
- Timestamp:
- Jul 6, 2015, 9:45:41 AM (8 years ago)
- Branches:
- (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
- Children:
- 63d1994c5890bc99de5206f4dd3d39b2cda38a4f
- Parents:
- 105eb273abbf2ab214f10f04627af4902c750d87988b95c72fc990b11e9eec2eac106b9b5e6e422c
- Location:
- Singular/LIB
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/crypto.lib
r988b95c rddc193 69 69 merkle_hellman_transformation(list knapsack, int key, int mod1 generates a hard knapsack for the Merkle-Hellman Kryptosystem for a given easy knapsack , a multiplicator key and a modulus mod1 70 70 merkle_hellman_encryption(list knapsack, list message) encrypts a message with the Merkle-Hellman Kryptosystem, using a hard knapsack and a message encoded as binary list 71 merkle_hellman_decryption(list knapsack, int key, int mod1, int message) decrypts a message with the multiplicative Merkle-Hellman Kryptosystem, using the hard knapsack, the key, the modulus mod1 and the message encoded as integer 71 merkle_hellman_decryption(list knapsack, int key, int mod1, int message) decrypts a message with the multiplicative Merkle-Hellman Kryptosystem, using the hard knapsack, the key, the modulus mod1 and the message encoded as integer 72 72 super_increasing_knapsack(int ksize) Creates the smallest super-increasing knapsack of given size ksize 73 73 h_increasing_knapsack(int ksize, int h) Creates the smallest h-increasing knapsack of given size ksize and h … … 1272 1272 if((k mod 2)==0) 1273 1273 { 1274 resu=ellipticMult(N,a,b,P,k /2);1274 resu=ellipticMult(N,a,b,P,k div 2); 1275 1275 return(ellipticAdd(N,a,b,resu,resu)); 1276 1276 } -
Singular/LIB/primdec.lib
r105eb27 rddc193 874 874 int uytrewq; 875 875 int nva = nvars(basering); 876 int @k,@s,@n,@k1, zz;876 int @k,@s,@n,@k1,@zz; 877 877 list primary,lres0,lres1,act,@lh,@wh; 878 878 map phi,psi,phi1,psi1; … … 1055 1055 { 1056 1056 poly randp; 1057 for( zz=1;zz<nvars(basering);zz++)1057 for(@zz=1;@zz<nvars(basering);@zz++) 1058 1058 { 1059 1059 randp=randp 1060 +(random(0,5)*par(1)^2+random(0,5)*par(1)+random(0,5))*var( zz);1060 +(random(0,5)*par(1)^2+random(0,5)*par(1)+random(0,5))*var(@zz); 1061 1061 } 1062 1062 randp=randp+var(nvars(basering)); … … 1068 1068 if (size(primary[2*@k])==0) 1069 1069 { 1070 for( zz=1;zz<size(primary[2*@k-1])-1;zz++)1070 for(@zz=1;@zz<size(primary[2*@k-1])-1;@zz++) 1071 1071 { 1072 1072 attrib(primary[2*@k-1],"isSB",1); 1073 if(vdim(primary[2*@k-1])==deg(primary[2*@k-1][ zz]))1073 if(vdim(primary[2*@k-1])==deg(primary[2*@k-1][@zz])) 1074 1074 { 1075 1075 primary[2*@k]=primary[2*@k-1]; … … 1099 1099 if(deg(lead(primary[2*@k-1][@n]))==1) 1100 1100 { 1101 for( zz=1;zz<=nva;zz++)1101 for(@zz=1;@zz<=nva;@zz++) 1102 1102 { 1103 if(lead(primary[2*@k-1][@n])/var( zz)!=0)1103 if(lead(primary[2*@k-1][@n])/var(@zz)!=0) 1104 1104 { 1105 jmap1[ zz]=-1/leadcoef(primary[2*@k-1][@n])*primary[2*@k-1][@n]1105 jmap1[@zz]=-1/leadcoef(primary[2*@k-1][@n])*primary[2*@k-1][@n] 1106 1106 +2/leadcoef(primary[2*@k-1][@n])*lead(primary[2*@k-1][@n]); 1107 jmap2[ zz]=primary[2*@k-1][@n];1108 @qht[@n]=var( zz);1107 jmap2[@zz]=primary[2*@k-1][@n]; 1108 @qht[@n]=var(@zz); 1109 1109 } 1110 1110 } … … 9023 9023 int uytrewq; 9024 9024 int nva = nvars(basering); 9025 int @k,@s,@n,@k1, zz;9025 int @k,@s,@n,@k1,@zz; 9026 9026 list primary,lres0,lres1,act,@lh,@wh; 9027 9027 map phi,psi,phi1,psi1; … … 9206 9206 { 9207 9207 poly randp; 9208 for( zz=1;zz<nvars(basering);zz++)9208 for(@zz=1;@zz<nvars(basering);@zz++) 9209 9209 { 9210 9210 randp=randp 9211 +(random(0,5)*par(1)^2+random(0,5)*par(1)+random(0,5))*var( zz);9211 +(random(0,5)*par(1)^2+random(0,5)*par(1)+random(0,5))*var(@zz); 9212 9212 } 9213 9213 randp=randp+var(nvars(basering)); … … 9219 9219 if (size(primary[2*@k])==0) 9220 9220 { 9221 for( zz=1;zz<size(primary[2*@k-1])-1;zz++)9221 for(@zz=1;@zz<size(primary[2*@k-1])-1;@zz++) 9222 9222 { 9223 9223 attrib(primary[2*@k-1],"isSB",1); 9224 if(vdim(primary[2*@k-1])==deg(primary[2*@k-1][ zz]))9224 if(vdim(primary[2*@k-1])==deg(primary[2*@k-1][@zz])) 9225 9225 { 9226 9226 primary[2*@k]=primary[2*@k-1]; … … 9250 9250 if(deg(lead(primary[2*@k-1][@n]))==1) 9251 9251 { 9252 for( zz=1;zz<=nva;zz++)9252 for(@zz=1;@zz<=nva;@zz++) 9253 9253 { 9254 if(lead(primary[2*@k-1][@n])/var( zz)!=0)9254 if(lead(primary[2*@k-1][@n])/var(@zz)!=0) 9255 9255 { 9256 jmap1[ zz]=-1/leadcoef(primary[2*@k-1][@n])*primary[2*@k-1][@n]9256 jmap1[@zz]=-1/leadcoef(primary[2*@k-1][@n])*primary[2*@k-1][@n] 9257 9257 +2/leadcoef(primary[2*@k-1][@n])*lead(primary[2*@k-1][@n]); 9258 jmap2[ zz]=primary[2*@k-1][@n];9259 @qht[@n]=var( zz);9258 jmap2[@zz]=primary[2*@k-1][@n]; 9259 @qht[@n]=var(@zz); 9260 9260 } 9261 9261 }
Note: See TracChangeset
for help on using the changeset viewer.