crypto: golang.org/x/crypto/xtea Index | Files

package xtea

import "golang.org/x/crypto/xtea"

Package xtea implements XTEA encryption, as defined in Needham and Wheeler's 1997 technical report, "Tea extensions."

Index

Package Files

block.go cipher.go

Constants

const BlockSize = 8

The XTEA block size in bytes.

type Cipher Uses

type Cipher struct {
    // contains filtered or unexported fields
}

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.

func NewCipher Uses

func NewCipher(key []byte) (*Cipher, error)

NewCipher creates and returns a new Cipher. The key argument should be the XTEA key. XTEA only supports 128 bit (16 byte) keys.

func (*Cipher) BlockSize Uses

func (c *Cipher) BlockSize() int

BlockSize returns the XTEA block size, 8 bytes. It is necessary to satisfy the Block interface in the package "crypto/cipher".

func (*Cipher) Decrypt Uses

func (c *Cipher) Decrypt(dst, src []byte)

Decrypt decrypts the 8 byte buffer src using the key k and stores the result in dst.

func (*Cipher) Encrypt Uses

func (c *Cipher) Encrypt(dst, src []byte)

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, it is not safe to just call Encrypt on successive blocks; instead, use an encryption mode like CBC (see crypto/cipher/cbc.go).

type KeySizeError Uses

type KeySizeError int

func (KeySizeError) Error Uses

func (k KeySizeError) Error() string

Package xtea imports 1 packages (graph) and is imported by 4 packages. Updated 2017-04-26. Refresh now. Tools for package owners.