Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Does anyone know what these pseudocode symbols mean?

Options
  • 06-07-2008 1:15am
    #1
    Closed Accounts Posts: 12,382 ✭✭✭✭


    Hello

    I hope someone can help me with this.

    I'm teaching myself Elliptic Curve Cryptography and the textbooks are trying their best to be as complicated as possible.

    I'm trying to figure out what the symbols in the following pseudocode might mean. Can any of you help?

    Input: a, f
    Output: the inverse of a

    1. u <- a, v <- f
    2. g1 <- 1, g2 <- 0
    3. while u != 1 do
    3.1 j <- deg(u) - deg(v)
    3.2 if j < 0 then: u <-> v, g1 <-> g2, j <- - j
    3.3 u <- u + (z^j)v
    3.4 g1 <- g1 + (z^j)g2
    4. Return g1

    Right. I'm thinking the following:

    <- means "becomes" as in u becomes a
    deg(u) I have no idea what that means. I know a is a polynomial, so maybe they are talking about the degree of u? I have no idea.
    <-> i don't know
    j <- - j i don't know
    ^ means to the power of

    Anyone seen anything like this before?

    I don't know why these dicks can't just explain things like a normal human

    Thanks.


Comments

  • Moderators, Politics Moderators Posts: 39,827 Mod ✭✭✭✭Seth Brundle


    I presume the deg() function returns the degrees.
    <-> looks to me to be is equal to
    j<- -j looks to be j = -j
    ^ would be to the power of alright

    Looks real & unnecessarily messy alright


  • Closed Accounts Posts: 12,382 ✭✭✭✭AARRRGH


    Thanks for the reply. :)

    I e-mailed the author of the book and he came back to me with the following -
    "<-" is "assignment". It is sometimes used to distinguish a claim of equality "a=b" from assignment of b to a.

    "<->" is admittedly less common. In the book, it means "interchange contents". It could be written as the sequence: t <- a, a <- b, b <- t.

    "deg" is "degree". For polynomials in one variable x, it is the highest power of x that appears. deg(x+x^4+1)=4.

    "j <- -j" means to change the sign of j and then assign the result back to j.


  • Moderators, Politics Moderators Posts: 39,827 Mod ✭✭✭✭Seth Brundle


    So I was pretty much right :D


Advertisement