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

Delta Between Two Patch Sets: openpgp/packet/packet.go

Issue 10151043: code review 10151043: go.crypto: revert 7f5a59ff6b43. (Closed)
Left Patch Set: Created 11 years, 9 months ago
Right Patch Set: diff -r 7f5a59ff6b43 https://code.google.com/p/go.crypto Created 11 years, 9 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « openpgp/keys.go ('k') | openpgp/packet/public_key.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 // Copyright 2011 The Go Authors. All rights reserved. 1 // Copyright 2011 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 packet implements parsing and serialization of OpenPGP packets, as 5 // Package packet implements parsing and serialization of OpenPGP packets, as
6 // specified in RFC 4880. 6 // specified in RFC 4880.
7 package packet 7 package packet
8 8
9 import ( 9 import (
10 "code.google.com/p/go.crypto/cast5" 10 "code.google.com/p/go.crypto/cast5"
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 m, err = r.Read(buf[:]) 265 m, err = r.Read(buf[:])
266 n += int64(m) 266 n += int64(m)
267 if err == io.EOF { 267 if err == io.EOF {
268 err = nil 268 err = nil
269 return 269 return
270 } 270 }
271 if err != nil { 271 if err != nil {
272 return 272 return
273 } 273 }
274 } 274 }
275
276 panic("unreachable")
275 } 277 }
276 278
277 // packetType represents the numeric ids of the different OpenPGP packet types. See 279 // packetType represents the numeric ids of the different OpenPGP packet types. See
278 // http://www.iana.org/assignments/pgp-parameters/pgp-parameters.xhtml#pgp-param eters-2 280 // http://www.iana.org/assignments/pgp-parameters/pgp-parameters.xhtml#pgp-param eters-2
279 type packetType uint8 281 type packetType uint8
280 282
281 const ( 283 const (
282 packetTypeEncryptedKey packetType = 1 284 packetTypeEncryptedKey packetType = 1
283 packetTypeSignature packetType = 2 285 packetTypeSignature packetType = 2
284 packetTypeSymmetricKeyEncrypted packetType = 3 286 packetTypeSymmetricKeyEncrypted packetType = 3
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 if err == nil { 481 if err == nil {
480 _, err = w.Write(mpiBytes) 482 _, err = w.Write(mpiBytes)
481 } 483 }
482 return 484 return
483 } 485 }
484 486
485 // writeBig serializes a *big.Int to w. 487 // writeBig serializes a *big.Int to w.
486 func writeBig(w io.Writer, i *big.Int) error { 488 func writeBig(w io.Writer, i *big.Int) error {
487 return writeMPI(w, uint16(i.BitLen()), i.Bytes()) 489 return writeMPI(w, uint16(i.BitLen()), i.Bytes())
488 } 490 }
LEFTRIGHT

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