Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Missing return check in `ModInverse`

Open Beginner friendly
#22 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
64/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
go
Domain
cryptography

Research direction

Start at the InvModP implementation and inspect how it uses math/big.ModInverse, focusing on the nil result described in the issue. Reproduce the non-relatively-prime case and verify that the completed change handles the missing inverse without silently continuing.

Written by the indexing model from the issue text.

Description

ModInverse from the package math/big is used to implement InvModP. However the implementation of InvModP does not check the return value, which could be nil in case the arguments are not relatively prime, in which case the multiplicative inverse does not exist.

Dominant language
Go
Stars
5
Forks
12
Avg merge
12d 28m
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from IBM/mathlib

All issues in IBM/mathlib

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.