Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 669315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:08:16+00:00 2026-05-14T00:08:16+00:00

I’m looking for an algorithm (or code) to help me compute the inverse a

  • 0

I’m looking for an algorithm (or code) to help me compute the inverse a polynomial, I need it for implementing NTRUEncrypt. An algorithm that is easily understandable is what I prefer, there are pseudo-codes for doing this, but they are confusing and difficult to implement, furthermore I can not really understand the procedure from pseudo-code alone.

Any algorithms for computing the inverse of a polynomial with respect to a ring of truncated polynomials?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T00:08:16+00:00Added an answer on May 14, 2026 at 12:08 am

    I work for Security Innovation, which owns NTRU, so I’m glad to see this interest.

    The IEEE standard 1363.1-2008 specifies how to implement NTRUEncrypt with the most current parameter sets. It gives the following specifications to invert polynomials:

    Division:

    Inputs are a and b, two polynomials, where b is of degree N-1 and b_N is the leading coefficient of b. Outputs are q and r such that a = q*b + r and deg(r) < deg(b). r_d denotes the coefficient of r of degree d, i.e. the leading coefficient of r.

    a)  Set r := a and q := 0
    b)  Set u := (b_N)^–1 mod p
    c)  While deg r >= N do
      1)    Set d := deg r(X)
      2)    Set v := u × r_d × X^(d–N)
      3)    Set r := r – v × b
      4)    Set q := q + v
    d)  Return q, r
    

    Here, r_d is the coefficient of r of degree d.

    Extended Euclidean Algorithm:

    a)  If b = 0 then return (1, 0, a)
    b)  Set u := 1
    c)  Set d := a 
    d)  Set v1 := 0
    e)  Set v3 := b
    f)  While v3 ≠ 0 do
      1)    Use the division algorithm (6.3.3.1) to write d = v3 × q + t3 with deg t3 < deg v3
      2)    Set t1 := u – q × v1
      3)    Set u := v1
      4)    Set d := v3
      5)    Set v1 := t1
      6)    Set v3 := t3
    g)  Set v := (d – a × u)/b  [This division is exact, i.e., the remainder is 0]
    h)  Return (u, v, d)
    

    Inverse in Z_p, p a prime:

    a)  Run the Extended Euclidean Algorithm with input a and (X^N – 1).  Let (u, v, d) be the output, such that a × u + (X^N – 1) × v = d = GCD(a, (X^N – 1)).
    b)  If deg d = 0, return b = d^–1 (mod p) × u
    c)  Else return FALSE
    

    Inverse in Z_p^e / (M(X), p a prime, M(X) a suitable polynomial such as X^N-1

    a)  Use the Inversion Algorithmto compute a polynomial b(X) ε R[X] that gives an inverse of a(X) in (R/pR)[X]/(M(X)). Return FALSE if the inverse does not exist. [The Inversion Algorithm may be applied here because R/pR is a field, and so (R/pR)[X] is a Euclidean ring.]
    b)  Set n = p
    c)  While n <= e do
      1)    b(X) = p × b(X) – a(X) × b(X)^2   (mod M(X)), with coefficients computed modulo p^n
      2)    Set n = p × n
    d)  Return b(X) mod M(X) with coefficients computed modulo p^e.
    

    If you’re doing a full implementation of NTRU you should see if you can get your institution to buy 1363.1, as raw NTRU encryption isn’t secure against an active attacker and 1363.1 describes message processing techniques to fix that.

    (Update 2013-04-18: Thanks to Sonel Sharam for spotting some errors in the previous version)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 374k
  • Answers 374k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer AFAIK, WiFi is independent from APN settings, i.e., if you… May 14, 2026 at 7:59 pm
  • Editorial Team
    Editorial Team added an answer Rewrite your code like this: uri = URI.parse(url) result =… May 14, 2026 at 7:59 pm
  • Editorial Team
    Editorial Team added an answer I believe you need to set the [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]… May 14, 2026 at 7:59 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.