xiao

package
v0.0.0-...-b7fcb3c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2016 License: BSD-3-Clause Imports: 8 Imported by: 3

Documentation

Overview

Package xiao implements the Xiao-Lai white-box AES construction. There is an attack on this construction implemented in the cryptanalysis/xiao package.

The interface here is very similar to the one presented in the constructions/chow package. Chow's construction is based exclusively on representing encryption with randomized lookup tables. Xiao-Lai's construction interleaves randomized lookup tables and large linear transformations.

"A Secure Implementation of White-Box AES" by Yaying Xiao and Xuejia Lai, http://ieeexplore.ieee.org/xpl/login.jsp?arnumber=5404239

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Construction

type Construction struct {
	ShiftRows  [10]matrix.Matrix
	TBoxMixCol [10][8]table.DoubleToWord

	FinalMask matrix.Matrix
}

func GenerateDecryptionKeys

func GenerateDecryptionKeys(key, seed []byte, opts common.KeyGenerationOpts) (out Construction, inputMask, outputMask matrix.Matrix)

GenerateDecryptionKeys creates a white-boxed version of the AES key `key` for decryption, with any non-determinism generated by `seed`.

func GenerateEncryptionKeys

func GenerateEncryptionKeys(key, seed []byte, opts common.KeyGenerationOpts) (out Construction, inputMask, outputMask matrix.Matrix)

GenerateEncryptionKeys creates a white-boxed version of the AES key `key` for encryption, with any non-determinism generated by `seed`.

func Parse

func Parse(in []byte) (constr Construction, err error)

Parse parses a byte array into a white-box construction. It returns an error if the byte array isn't long enough.

func (Construction) BlockSize

func (constr Construction) BlockSize() int

BlockSize returns the block size of AES. (Necessary to implement cipher.Block.)

func (Construction) Decrypt

func (constr Construction) Decrypt(dst, src []byte)

Decrypt decrypts the first block in src into dst. Dst and src may point at the same memory.

func (Construction) Encrypt

func (constr Construction) Encrypt(dst, src []byte)

Encrypt encrypts the first block in src into dst. Dst and src may point at the same memory.

func (*Construction) ExpandWord

func (constr *Construction) ExpandWord(tmc []table.DoubleToWord, word []byte) [2][4]byte

func (*Construction) Serialize

func (constr *Construction) Serialize() []byte

Serialize serializes a white-box construction into a byte slice.

func (*Construction) SquashWords

func (constr *Construction) SquashWords(words [2][4]byte, dst []byte)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL