Commit d1dbfe58 authored by Dmitry Chestnykh's avatar Dmitry Chestnykh Committed by Adam Langley

crypto: replace "crypto/block" with "crypto/cipher" in comments

Documentation mentioned the obsolete package "crypto/block",
which has been replaced with "crypto/cipher".

R=golang-dev, agl
CC=golang-dev
https://golang.org/cl/4654064
parent da19831c
...@@ -45,14 +45,14 @@ func NewCipher(key []byte) (*Cipher, os.Error) { ...@@ -45,14 +45,14 @@ func NewCipher(key []byte) (*Cipher, os.Error) {
// BlockSize returns the AES block size, 16 bytes. // BlockSize returns the AES block size, 16 bytes.
// It is necessary to satisfy the Cipher interface in the // It is necessary to satisfy the Cipher interface in the
// package "crypto/block". // package "crypto/cipher".
func (c *Cipher) BlockSize() int { return BlockSize } func (c *Cipher) BlockSize() int { return BlockSize }
// Encrypt encrypts the 16-byte buffer src using the key k // Encrypt encrypts the 16-byte buffer src using the key k
// and stores the result in dst. // and stores the result in dst.
// Note that for amounts of data larger than a block, // Note that for amounts of data larger than a block,
// it is not safe to just call Encrypt on successive blocks; // it is not safe to just call Encrypt on successive blocks;
// instead, use an encryption mode like CBC (see crypto/block/cbc.go). // instead, use an encryption mode like CBC (see crypto/cipher/cbc.go).
func (c *Cipher) Encrypt(dst, src []byte) { encryptBlock(c.enc, dst, src) } func (c *Cipher) Encrypt(dst, src []byte) { encryptBlock(c.enc, dst, src) }
// Decrypt decrypts the 16-byte buffer src using the key k // Decrypt decrypts the 16-byte buffer src using the key k
......
...@@ -42,14 +42,14 @@ func NewCipher(key []byte) (*Cipher, os.Error) { ...@@ -42,14 +42,14 @@ func NewCipher(key []byte) (*Cipher, os.Error) {
// BlockSize returns the Blowfish block size, 8 bytes. // BlockSize returns the Blowfish block size, 8 bytes.
// It is necessary to satisfy the Cipher interface in the // It is necessary to satisfy the Cipher interface in the
// package "crypto/block". // package "crypto/cipher".
func (c *Cipher) BlockSize() int { return BlockSize } func (c *Cipher) BlockSize() int { return BlockSize }
// Encrypt encrypts the 8-byte buffer src using the key k // Encrypt encrypts the 8-byte buffer src using the key k
// and stores the result in dst. // and stores the result in dst.
// Note that for amounts of data larger than a block, // Note that for amounts of data larger than a block,
// it is not safe to just call Encrypt on successive blocks; // it is not safe to just call Encrypt on successive blocks;
// instead, use an encryption mode like CBC (see crypto/block/cbc.go). // instead, use an encryption mode like CBC (see crypto/cipher/cbc.go).
func (c *Cipher) Encrypt(dst, src []byte) { func (c *Cipher) Encrypt(dst, src []byte) {
l := uint32(src[0])<<24 | uint32(src[1])<<16 | uint32(src[2])<<8 | uint32(src[3]) l := uint32(src[0])<<24 | uint32(src[1])<<16 | uint32(src[2])<<8 | uint32(src[3])
r := uint32(src[4])<<24 | uint32(src[5])<<16 | uint32(src[6])<<8 | uint32(src[7]) r := uint32(src[4])<<24 | uint32(src[5])<<16 | uint32(src[6])<<8 | uint32(src[7])
......
...@@ -269,7 +269,7 @@ func h(in, key []byte, offset int) uint32 { ...@@ -269,7 +269,7 @@ func h(in, key []byte, offset int) uint32 {
// Encrypt encrypts a 16-byte block from src to dst, which may overlap. // Encrypt encrypts a 16-byte block from src to dst, which may overlap.
// Note that for amounts of data larger than a block, // Note that for amounts of data larger than a block,
// it is not safe to just call Encrypt on successive blocks; // it is not safe to just call Encrypt on successive blocks;
// instead, use an encryption mode like CBC (see crypto/block/cbc.go). // instead, use an encryption mode like CBC (see crypto/cipher/cbc.go).
func (c *Cipher) Encrypt(dst, src []byte) { func (c *Cipher) Encrypt(dst, src []byte) {
S1 := c.s[0] S1 := c.s[0]
S2 := c.s[1] S2 := c.s[1]
......
...@@ -48,13 +48,13 @@ func NewCipher(key []byte) (*Cipher, os.Error) { ...@@ -48,13 +48,13 @@ func NewCipher(key []byte) (*Cipher, os.Error) {
// BlockSize returns the XTEA block size, 8 bytes. // BlockSize returns the XTEA block size, 8 bytes.
// It is necessary to satisfy the Cipher interface in the // It is necessary to satisfy the Cipher interface in the
// package "crypto/block". // package "crypto/cipher".
func (c *Cipher) BlockSize() int { return BlockSize } func (c *Cipher) BlockSize() int { return BlockSize }
// Encrypt encrypts the 8 byte buffer src using the key and stores the result in dst. // Encrypt encrypts the 8 byte buffer src using the key and stores the result in dst.
// Note that for amounts of data larger than a block, // Note that for amounts of data larger than a block,
// it is not safe to just call Encrypt on successive blocks; // it is not safe to just call Encrypt on successive blocks;
// instead, use an encryption mode like CBC (see crypto/block/cbc.go). // instead, use an encryption mode like CBC (see crypto/cipher/cbc.go).
func (c *Cipher) Encrypt(dst, src []byte) { encryptBlock(c, dst, src) } 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 k and stores the result in dst.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment