LEFT | RIGHT |
1 // Copyright 2009 The Go Authors. All rights reserved. | 1 // Copyright 2009 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 package rsa | 5 package rsa |
6 | 6 |
7 import ( | 7 import ( |
8 "big" | 8 "big" |
9 "bytes" | 9 "bytes" |
10 "crypto/sha1" | 10 "crypto/sha1" |
11 "encoding/base64" | 11 "encoding/base64" |
12 "encoding/hex" | 12 "encoding/hex" |
13 "os" | 13 "os" |
14 "io" | 14 "io" |
15 "strings" | |
16 "testing" | 15 "testing" |
17 "testing/quick" | 16 "testing/quick" |
18 ) | 17 ) |
19 | 18 |
20 func decodeBase64(in string) []byte { | 19 func decodeBase64(in string) []byte { |
21 out := make([]byte, base64.StdEncoding.DecodedLen(len(in))) | 20 out := make([]byte, base64.StdEncoding.DecodedLen(len(in))) |
22 n, err := base64.StdEncoding.Decode(out, []byte(in)) | 21 n, err := base64.StdEncoding.Decode(out, []byte(in)) |
23 if err != nil { | 22 if err != nil { |
24 return nil | 23 return nil |
25 } | 24 } |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 | 217 |
219 var rsaPrivateKey = &PrivateKey{ | 218 var rsaPrivateKey = &PrivateKey{ |
220 PublicKey: PublicKey{ | 219 PublicKey: PublicKey{ |
221 N: bigFromString("9353930466774385905609975137998169297361893554
14998671685329502257853572497967725295852446635047121036783518748074826886427746
4700638583474144061408845077"), | 220 N: bigFromString("9353930466774385905609975137998169297361893554
14998671685329502257853572497967725295852446635047121036783518748074826886427746
4700638583474144061408845077"), |
222 E: 65537, | 221 E: 65537, |
223 }, | 222 }, |
224 D: bigFromString("726639843132811634405769937974922253227934392381906363
94970490393898993285385430876577337665541558398345195294398516730148002612857577
59040931985506583861"), | 223 D: bigFromString("726639843132811634405769937974922253227934392381906363
94970490393898993285385430876577337665541558398345195294398516730148002612857577
59040931985506583861"), |
225 P: bigFromString("989203665480846436017288690555926508355729509322669674
61790948584315647051443"), | 224 P: bigFromString("989203665480846436017288690555926508355729509322669674
61790948584315647051443"), |
226 Q: bigFromString("945602083088470157474985238840633946716066719049446663
60068158221458669711639"), | 225 Q: bigFromString("945602083088470157474985238840633946716066719049446663
60068158221458669711639"), |
227 } | 226 } |
LEFT | RIGHT |