Dividing a point by a specific number in elliptic curve [closed] - cryptography

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
There is a elliptic curve with parameters:
a = 0xb3b04200486514cb8fdcf3037397558a8717c85acf19bac71ce72698a23f635
b = 0x12f55f6e7419e26d728c429a2b206a2645a7a56a31dbd5bfb66864425c8a2320
Also the prime number is:
q = 0x247ce416cf31bae96a1c548ef57b012a645b8bff68d3979e26aa54fc49a2c297
How can I solve the equation P * 65537 = H and obtain the value of P?
P and H are points and H equals to (72782057986002698850567456295979356220866771008308693184283729159903205979695, 7766776325114464021923523189912759786515131109431296018171065280757067869793).
Note that in the equation we have Elliptic curve point multiplication!

You need to know the number of points on the curve to solve this. Let's call that number n. Then you will have to compute the inverse of 65537 modulo n and do a scalar multiply of your point H by that number.

Related

Time complexity apparently exponential [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I got a question
What would be the time complexity of this function?
Function (int n) {
for (i = 1 to n):
print("hello")
}
apparently it's exponential because of binary numbers or something??
it should be O(n) right?
This is clearly O(n). The function prints "hello" n times. So the time-complexity is O(n) and it is not exponential. It is linear.
Since for loop is running from 1 to n, therefore complexity will be O(n). It is linear.

Example of Polynomial time algorithm [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
What is the example of polynomial time algorithm
Is polynomial time algorithm fastest?
Suppose 100 elements in array , then how can I decide algorithm is polynomial time?
Q: What is the example of polynomial time algorithm?
for (i = 0; i < n; ++i)
printf("%d", i);
This is a linear algorithm, and linear belongs to polynomial class.
Q: Is polynomial time algorithm fastest?
No, logarithmic and constant-time algorithms are asymptotically faster than polynomial algorithms.
Q: Suppose 100 elements in array , then how can I decide algorithm is
polynomial time?
You haven't specified any algorithm here, just the data structure (array with 100 elements). However, to determine whether algorithm is polynomial time or not, you should find big-o for that algorithm. If it is O(n^k), then it is polynomial time. Read more here and here.

Rcpp zeros of a quadratic equation in two variables [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am new to Rcpp so I apologize in advance if this question is simple to answer. I searched on the web but couldn't find much help and I am hoping the savviness in this forum can help me!
I have an existing code in R using Rcpp, and I need to add to this code the following. I have a quadratic function in two variables, f(x, y), and I need to find the zeros of it:
f(x, y) = (x + by + c)' W (x + by + c)
where the unknowns are x and y. That is, I am interested in finding the set of pairs (x, y) that satisfy f(x , y)=0.
Note: This is a simulation exercise where I need to find the zeros of this function for different values of a, b, c and W. Therefore, I need to code this in a mechanical way (cannot just find the solution, for instance, by graphical inspection). Both variables are continue, and I don't want to work with a grid for (x,y) to see when f(x,y)=0. I need a more general/optimization solution. I don't really know what values (x,y) can take.
Before diving into the numerical part I think you should define this question in a better way. Here I assume that x, y, and c are vectors, and b is a scalar.
A quick observation is that, if W is positive definite, then f(x, y) = 0 implies that x + by + c = 0. If both x and y are free variables, then the solution is not unique. For example, if (x, y) is a solution, then (x - b, y + 1) (element-wise operations) is also a solution.
If W is indefinite, then the equation also has multiple solutions. I just give a very simple example here. Imagine that W is a 2x2 diagonal matrix with 1 and -1 on the diagonal. Then as long as x + by + c = (t, t)' for any t, the function value is exactly zero.
In short, under my assumption on the notations, the equation has infinite number of solutions. I believe you need additional restrictions to make it unique.

All versions of differential evolution algorithm [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
explain all updates in the basic algorithm of differential evolution. i am not able to find all versions of this algorithm. explain all versions of this algorithm as a survey and i am not clearly understand the theory behind this algorithm as given in the Wikipedia. Wikipedia also define only basic algorithm of differential evolution but i want to all updates of this algorithm
For complete survey in Differential Evolution, I suggest you the paper entitled Differential Evolution: A Survey of the State-of-the-Art but the brief explanation is :
DE has 2 basic crossover and 5 basic mutation operators, so we have 2*5=10 basic DE variants.
Two crossover operators are Exponential and Binomial.
Exponential Crossover:
D is problem space dimensionality, n is randomly chosen from [1,D], Cr is crossover rate and L is drawn from [1,D] according to above pseudocode.
Binomial Crossover:
j is refer to j-th dimension, i is vector number and G is generation number and jrand is randomly chosen index from [1,D].
Five mutation operators are DE/rand/1 , DE/best/1 , DE/target-to-best/1 , DE/best/2 and DE/rand/2.
DE/rand/1: V(i)=X(r1)+F*(X(r2)-X(r3))
DE/best/1: V(i)=X(best)+F*(X(r1)-X(r2))
DE/target-to-best/1: V(i)=X(i)+F*(X(best)-X(i))+F*(X(r1)-X(r2))
DE/best/2: V(i)=X(best)+F*(X(r1)-X(r2))+F*(X(r3)-X(r4))
DE/rand/2: V(i)=X(r1)+F*(X(r2)-X(r3))+F*(x(r4)-X(r5))
V(i) is donor(mutant) vector for target vector X(i), F is difference vector's scale factor, r1,r2,r3,r4,r5 are mutually exclusive, randomly chosen from [1,NP] and differ from i, best is the fittest vector's index in the current population, finally NP is population size.
These are all of things you can know about basic variants of DE.
DE also has many variants for many purposes which has explained in the mentioned paper.

Need intersect point for a line coming from center of circle? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have a line with start point as P1(x1, y1) & end Point as P2(x2, y2). This line is from the center of circle. The circle radius is r. Need a simple equation to identify the circle line intersect point?
Assuming P1 is the center of the circle, first get the slope of the line, then follow it from P1 to distance r along that direction.
phi = atan2(y2-y1, x2-x1)
x = x1 + r * cos(phi)
y = y1 + r * sin(phi)
The equation for a circle is (x-h)^2 - (y-k)^2 = r^2, where the center is (h, k) (which will end up being (0, 0) relative to your line)
Given two points, you can find the slope of the line, now you can plug it into the formula y = m*x + b.
You now have a system of two equations, solve for x or y in one equation, then plug that expression into the other equation and you will find the numeric value of the variable you did not solve for. You can then plug that back into the equation for a line and find the second variable.
Here is the general formula: http://mathworld.wolfram.com/Circle-LineIntersection.html
And some other answers: Circle line-segment collision detection algorithm?