Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
embedded
Embedded Project group 6
Commits
6f8e77c9
Commit
6f8e77c9
authored
Jul 23, 2019
by
Naga Suramouli
Browse files
Upload New File
parent
ba8e3448
Changes
1
Hide whitespace changes
Inline
Side-by-side
ECC Over GF(2m)/sage/point_validation_Jacobian.sage
0 → 100644
View file @
6f8e77c9
def Pointvalidation_Jacobi_Mont(x,y,a,b,PRECISION):
r=(2^PRECISION).__xor__(n); rpoly = str_to_poly(r)
r2poly = rpoly * rpoly; r2 = poly_to_str(r2poly)
rinvpoly = rpoly^-1; rinv = poly_to_str(rinvpoly)
x_poly = str_to_poly(x)
y_poly = str_to_poly(y)
x_poly_MD = x_poly * r2poly * rinvpoly
y_poly_MD = y_poly * r2poly * rinvpoly
L_poly_MD = L_poly * r2poly * rinvpoly
R_poly_MD = R_poly * r2poly * rinvpoly
temp1_poly_MD = x_poly_MD * rinvpoly
temp2_poly_MD = y_poly_MD * rinvpoly
temp3_poly_MD = a_poly_MD * rinvpoly
temp4_poly_MD = b_poly_MD * rinvpoly
temp5_poly_MD = temp1_poly_MD * temp1_poly_MD * rinvpoly
temp6_poly_MD = temp5_poly_MD * temp1_poly_MD * rinvpoly
temp7_poly_MD = temp2_poly_MD * temp2_poly_MD * rinvpoly
temp8_poly_MD = temp1_poly_MD * temp2_poly_MD * rinvpoly
temp9_poly_MD = temp3_poly_MD * temp5_poly_MD * rinvpoly
L_poly_MD = temp7_poly_MD + temp8_poly_MD * rinvpoly
R_poly_MD = temp4_poly_MD + temp9_poly_MD + temp6_poly_MD * rinvpoly
print 'L_MD=',poly_to_str(L_poly_MD)
print 'R_MD=',poly_to_str(R_poly_MD)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment