From 88942b9c40a4c9d203b82b3731787b672d6e809b Mon Sep 17 00:00:00 2001 From: Mark Rushakoff Date: Wed, 21 Mar 2018 23:38:19 +0000 Subject: [PATCH] xtea: comment cleanup Change-Id: Ibd61a57fbbaa2775adb370a7e91b6dc0f8ca8782 GitHub-Last-Rev: f0111f4a5f941067661fee89e37a95e3503ebdda GitHub-Pull-Request: golang/crypto#36 Reviewed-on: https://go-review.googlesource.com/102035 Reviewed-by: Brad Fitzpatrick --- xtea/block.go | 2 +- xtea/cipher.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/xtea/block.go b/xtea/block.go index bf5d245992..fcb4e4d000 100644 --- a/xtea/block.go +++ b/xtea/block.go @@ -50,7 +50,7 @@ func encryptBlock(c *Cipher, dst, src []byte) { uint32ToBlock(v0, v1, dst) } -// decryptBlock decrypt a single 8 byte block using XTEA. +// decryptBlock decrypts a single 8 byte block using XTEA. func decryptBlock(c *Cipher, dst, src []byte) { v0, v1 := blockToUint32(src) diff --git a/xtea/cipher.go b/xtea/cipher.go index 66ea0df165..1661cbea80 100644 --- a/xtea/cipher.go +++ b/xtea/cipher.go @@ -14,8 +14,8 @@ import "strconv" const BlockSize = 8 // A Cipher is an instance of an XTEA cipher using a particular key. -// table contains a series of precalculated values that are used each round. type Cipher struct { + // table contains a series of precalculated values that are used each round. table [64]uint32 } @@ -54,7 +54,7 @@ func (c *Cipher) BlockSize() int { return BlockSize } // instead, use an encryption mode like CBC (see crypto/cipher/cbc.go). func (c *Cipher) Encrypt(dst, src []byte) { encryptBlock(c, dst, src) } -// Decrypt decrypts the 8 byte buffer src using the key k and stores the result in dst. +// Decrypt decrypts the 8 byte buffer src using the key and stores the result in dst. func (c *Cipher) Decrypt(dst, src []byte) { decryptBlock(c, dst, src) } // initCipher initializes the cipher context by creating a look up table