]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/openpgp: s/serialise/serialize/
authorAdam Langley <agl@golang.org>
Thu, 10 Mar 2011 15:36:04 +0000 (10:36 -0500)
committerAdam Langley <agl@golang.org>
Thu, 10 Mar 2011 15:36:04 +0000 (10:36 -0500)
(No code changes, Americanization only.)

R=rsc, bradfitzwork
CC=golang-dev
https://golang.org/cl/4250075

src/pkg/crypto/openpgp/packet/packet.go
src/pkg/crypto/openpgp/packet/packet_test.go
src/pkg/crypto/openpgp/packet/public_key.go
src/pkg/crypto/openpgp/packet/signature.go

index aacbb666ecb08ed69411fe5770543246ddfa9399..832daa64e2b75bc70205cbdcba1d224ce2d1066c 100644 (file)
@@ -166,9 +166,9 @@ func readHeader(r io.Reader) (tag packetType, length int64, contents io.Reader,
        return
 }
 
-// serialiseHeader writes an OpenPGP packet header to w. See RFC 4880, section
+// serializeHeader writes an OpenPGP packet header to w. See RFC 4880, section
 // 4.2.
-func serialiseHeader(w io.Writer, ptype packetType, length int) (err os.Error) {
+func serializeHeader(w io.Writer, ptype packetType, length int) (err os.Error) {
        var buf [6]byte
        var n int
 
@@ -371,7 +371,7 @@ func (cipher CipherFunction) new(key []byte) (block cipher.Block) {
 
 // readMPI reads a big integer from r. The bit length returned is the bit
 // length that was specified in r. This is preserved so that the integer can be
-// reserialised exactly.
+// reserialized exactly.
 func readMPI(r io.Reader) (mpi []byte, bitLength uint16, err os.Error) {
        var buf [2]byte
        _, err = readFull(r, buf[0:])
@@ -385,7 +385,7 @@ func readMPI(r io.Reader) (mpi []byte, bitLength uint16, err os.Error) {
        return
 }
 
-// writeMPI serialises a big integer to r.
+// writeMPI serializes a big integer to r.
 func writeMPI(w io.Writer, bitLength uint16, mpiBytes []byte) (err os.Error) {
        _, err = w.Write([]byte{byte(bitLength >> 8), byte(bitLength)})
        if err == nil {
index 40c6b67d348879f27d55f5bc8866dd9cff5282d8..1a4692cd4f5d1b02607fe15d3c5f38480731f499 100644 (file)
@@ -191,13 +191,13 @@ func TestReadHeader(t *testing.T) {
        }
 }
 
-func TestSerialiseHeader(t *testing.T) {
+func TestSerializeHeader(t *testing.T) {
        tag := packetTypePublicKey
        lengths := []int{0, 1, 2, 64, 192, 193, 8000, 8384, 8385, 10000}
 
        for _, length := range lengths {
                buf := bytes.NewBuffer(nil)
-               serialiseHeader(buf, tag, length)
+               serializeHeader(buf, tag, length)
                tag2, length2, _, err := readHeader(buf)
                if err != nil {
                        t.Errorf("length %d, err: %s", length, err)
index 8866bdaaa9474c280c2fd06bb7703eccd74b2a1d..daf5a1e6643bf28a897d2ddd559765904cba1e8f 100644 (file)
@@ -241,7 +241,7 @@ func (pk *PublicKey) VerifyUserIdSignature(id string, sig *Signature) (err os.Er
 
 // A parsedMPI is used to store the contents of a big integer, along with the
 // bit length that was specified in the original input. This allows the MPI to
-// be reserialised exactly.
+// be reserialized exactly.
 type parsedMPI struct {
        bytes     []byte
        bitLength uint16
index fd2518ab41eaa92a837b5f36ec58b330eda84d10..2d95ba522a53b338c4269abe2f813b70f612120d 100644 (file)
@@ -316,8 +316,8 @@ func subpacketLengthLength(length int) int {
        return 5
 }
 
-// serialiseSubpacketLength marshals the given length into to.
-func serialiseSubpacketLength(to []byte, length int) int {
+// serializeSubpacketLength marshals the given length into to.
+func serializeSubpacketLength(to []byte, length int) int {
        if length < 192 {
                to[0] = byte(length)
                return 1
@@ -336,7 +336,7 @@ func serialiseSubpacketLength(to []byte, length int) int {
        return 5
 }
 
-// subpacketsLength returns the serialised length, in bytes, of the given
+// subpacketsLength returns the serialized length, in bytes, of the given
 // subpackets.
 func subpacketsLength(subpackets []outputSubpacket, hashed bool) (length int) {
        for _, subpacket := range subpackets {
@@ -349,11 +349,11 @@ func subpacketsLength(subpackets []outputSubpacket, hashed bool) (length int) {
        return
 }
 
-// serialiseSubpackets marshals the given subpackets into to.
-func serialiseSubpackets(to []byte, subpackets []outputSubpacket, hashed bool) {
+// serializeSubpackets marshals the given subpackets into to.
+func serializeSubpackets(to []byte, subpackets []outputSubpacket, hashed bool) {
        for _, subpacket := range subpackets {
                if subpacket.hashed == hashed {
-                       n := serialiseSubpacketLength(to, len(subpacket.contents)+1)
+                       n := serializeSubpacketLength(to, len(subpacket.contents)+1)
                        to[n] = byte(subpacket.subpacketType)
                        to = to[1+n:]
                        n = copy(to, subpacket.contents)
@@ -381,7 +381,7 @@ func (sig *Signature) buildHashSuffix() (err os.Error) {
        }
        sig.HashSuffix[4] = byte(hashedSubpacketsLen >> 8)
        sig.HashSuffix[5] = byte(hashedSubpacketsLen)
-       serialiseSubpackets(sig.HashSuffix[6:l], sig.outSubpackets, true)
+       serializeSubpackets(sig.HashSuffix[6:l], sig.outSubpackets, true)
        trailer := sig.HashSuffix[l:]
        trailer[0] = 4
        trailer[1] = 0xff
@@ -417,7 +417,7 @@ func (sig *Signature) Serialize(w io.Writer) (err os.Error) {
        length := len(sig.HashSuffix) - 6 /* trailer not included */ +
                2 /* length of unhashed subpackets */ + unhashedSubpacketsLen +
                2 /* hash tag */ + 2 /* length of signature MPI */ + len(sig.Signature)
-       err = serialiseHeader(w, packetTypeSignature, length)
+       err = serializeHeader(w, packetTypeSignature, length)
        if err != nil {
                return
        }
@@ -430,7 +430,7 @@ func (sig *Signature) Serialize(w io.Writer) (err os.Error) {
        unhashedSubpackets := make([]byte, 2+unhashedSubpacketsLen)
        unhashedSubpackets[0] = byte(unhashedSubpacketsLen >> 8)
        unhashedSubpackets[1] = byte(unhashedSubpacketsLen)
-       serialiseSubpackets(unhashedSubpackets[2:], sig.outSubpackets, false)
+       serializeSubpackets(unhashedSubpackets[2:], sig.outSubpackets, false)
 
        _, err = w.Write(unhashedSubpackets)
        if err != nil {