Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(100)

Issue 154141: crypto/rsa: handle the case of non-coprime blinds. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
15 years, 8 months ago by agl1
Modified:
15 years, 8 months ago
Reviewers:
rsc
CC:
golang-dev
Visibility:
Public.

Description

crypto/rsa: handle the case of non-coprime blinds. We are dealing with the multiplicative group ℤ/pqℤ. Multiples of either p or q are not members of the group since they cannot have an inverse. (Such numbers are 0 in the subgroup ℤ/pℤ.) With p and q of typical size (> 512 bits), the probability of a random blind [1..pq-1] being a multiple of p or q is negligible. However, in the unit tests, much smaller sizes are used and the event could occur. This change checks the result of the ext GCD and deals with this case. It also increases the size of p and q in the unit test as a large number of the keys selected were p, q = 227,169.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+26 lines, -11 lines) Patch
M src/pkg/crypto/rsa/rsa.go View 2 chunks +25 lines, -10 lines 0 comments Download
M src/pkg/crypto/rsa/rsa_test.go View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 3
agl1
The tests in crypto/rsa use actual random numbers (/dev/urandom), rather than pseudo random numbers that ...
15 years, 8 months ago (2009-11-15 00:50:13 UTC) #1
rsc
LGTM Is it possible to turn down the number of iterations? On the 386, crypto/rsa ...
15 years, 8 months ago (2009-11-15 00:55:14 UTC) #2
rsc
15 years, 8 months ago (2009-11-15 04:38:03 UTC) #3
*** Submitted as http://code.google.com/p/go/source/detail?r=ada0b695b728 ***

crypto/rsa: handle the case of non-coprime blinds.

We are dealing with the multiplicative group ℤ/pqℤ. Multiples of
either p or q are not members of the group since they cannot have an
inverse. (Such numbers are 0 in the subgroup ℤ/pℤ.)

With p and q of typical size (> 512 bits), the probability of a random
blind [1..pq-1] being a multiple of p or q is negligible. However, in
the unit tests, much smaller sizes are used and the event could occur.

This change checks the result of the ext GCD and deals with this case.

It also increases the size of p and q in the unit test as a large
number of the keys selected were p, q = 227,169.

R=rsc
CC=golang-dev
http://codereview.appspot.com/154141

Committer: Russ Cox <rsc@golang.org>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b