ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 04 Sep 2017 07:39:52 -0500pre-reduction multiplication result in binary fieldhttp://ask.sagemath.org/question/38734/pre-reduction-multiplication-result-in-binary-field/The following will do multiplication in a finite field:
X = Integer(0x009D73616F35F4AB1407D73562C10F);
Y = Integer(0x00A52830277958EE84D1315ED31886);
F.<x> = GF(2)[];
p = x^113 + x^9 + 1;
BF = GF(2^113, 'x', modulus=p);
X_bf = BF._cache.fetch_int(X);
Y_bf = BF._cache.fetch_int(Y);
temp = Y * X; temp
The problem with this is that the result you get back has had the reduction step already ran. I'd like to see the multiplication result pre-reduction.
Any ideas?Sun, 03 Sep 2017 22:44:52 -0500http://ask.sagemath.org/question/38734/pre-reduction-multiplication-result-in-binary-field/Answer by B r u n o for <p>The following will do multiplication in a finite field:</p>
<pre><code>X = Integer(0x009D73616F35F4AB1407D73562C10F);
Y = Integer(0x00A52830277958EE84D1315ED31886);
F.<x> = GF(2)[];
p = x^113 + x^9 + 1;
BF = GF(2^113, 'x', modulus=p);
X_bf = BF._cache.fetch_int(X);
Y_bf = BF._cache.fetch_int(Y);
temp = Y * X; temp
</code></pre>
<p>The problem with this is that the result you get back has had the reduction step already ran. I'd like to see the multiplication result pre-reduction.</p>
<p>Any ideas?</p>
http://ask.sagemath.org/question/38734/pre-reduction-multiplication-result-in-binary-field/?answer=38737#post-id-38737If you want to see the polynomial result before reduction, you can use the method `polynomial` which gives you the polynomial representing the element of your binary field, as an element of the polynomial ring. That is:
sage: X_poly = X_bf.polynomial()
sage: Y_poly = Y_bf.polynomial()
sage: X_poly * Y_poly
x^222 + x^220 + x^219 + x^218 + x^217 + x^216 + x^215 + x^214 + x^213 + x^211 + x^205 + x^204 + x^203 + x^202 + x^200 + x^199 + x^198 + x^197 + x^191 + x^188 + x^186 + x^185 + x^182 + x^179 + x^178 + x^177 + x^176 + x^175 + x^172 + x^171 + x^170 + x^169 + x^163 + x^160 + x^159 + x^154 + x^152 + x^151 + x^149 + x^146 + x^143 + x^140 + x^136 + x^132 + x^131 + x^128 + x^127 + x^126 + x^125 + x^124 + x^123 + x^120 + x^119 + x^116 + x^115 + x^113 + x^111 + x^110 + x^109 + x^106 + x^105 + x^103 + x^101 + x^97 + x^96 + x^94 + x^88 + x^85 + x^83 + x^82 + x^80 + x^75 + x^70 + x^68 + x^67 + x^66 + x^65 + x^64 + x^61 + x^58 + x^57 + x^55 + x^54 + x^46 + x^44 + x^43 + x^41 + x^35 + x^34 + x^31 + x^30 + x^27 + x^24 + x^23 + x^20 + x^18 + x^17 + x^16 + x^15 + x^11 + x^8 + x^7 + x^5 + x
And if you want the result as an integer:
sage: sum(2^i for i in _.exponents()) # _ represents the latest result
10100206405814666335316365818931450998837311752455571104712025934242Mon, 04 Sep 2017 07:39:52 -0500http://ask.sagemath.org/question/38734/pre-reduction-multiplication-result-in-binary-field/?answer=38737#post-id-38737