From de4a706aa95639d4b30b5b1a68cd679a0e9e4357 Mon Sep 17 00:00:00 2001 From: Adam Langley Date: Fri, 22 Apr 2011 15:33:41 -0400 Subject: [PATCH] crypto/rsa: support > 3 primes. With full multi-prime support we can support version 1 PKCS#1 private keys. This means exporting all the members of rsa.PrivateKey, thus making the API a little messy. However there has already been another request to export this so it seems to be something that's needed. Over time, rsa.GenerateMultiPrimeKey will replace rsa.GenerateKey, but I need to work on the prime balance first because we're no longer generating primes which are a multiples of 8 bits. Fixes #987. R=rsc CC=golang-dev https://golang.org/cl/4378046 --- handshake_server_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/handshake_server_test.go b/handshake_server_test.go index 6beb6a9..5a1e754 100644 --- a/handshake_server_test.go +++ b/handshake_server_test.go @@ -188,8 +188,10 @@ var testPrivateKey = &rsa.PrivateKey{ E: 65537, }, D: bigFromString("29354450337804273969007277378287027274721892607543397931919078829901848876371746653677097639302788129485893852488285045793268732234230875671682624082413996177431586734171663258657462237320300610850244186316880055243099640544518318093544057213190320837094958164973959123058337475052510833916491060913053867729"), - P: bigFromString("11969277782311800166562047708379380720136961987713178380670422671426759650127150688426177829077494755200794297055316163155755835813760102405344560929062149"), - Q: bigFromString("10998999429884441391899182616418192492905073053684657075974935218461686523870125521822756579792315215543092255516093840728890783887287417039645833477273829"), + Primes: []*big.Int{ + bigFromString("11969277782311800166562047708379380720136961987713178380670422671426759650127150688426177829077494755200794297055316163155755835813760102405344560929062149"), + bigFromString("10998999429884441391899182616418192492905073053684657075974935218461686523870125521822756579792315215543092255516093840728890783887287417039645833477273829"), + }, } // Script of interaction with gnutls implementation.