Documentation ¶
Index ¶
- type LrpCipher
- func (lrp *LrpCipher) BlockSize() int
- func (lrp *LrpCipher) CounterPieces() []int
- func (lrp *LrpCipher) CryptBlocks(dst, src []byte)
- func (lrp *LrpCipher) Decrypt(dst, src []byte)
- func (lrp *LrpCipher) DecryptAll(src []byte, removePadding bool) []byte
- func (lrp *LrpCipher) DecryptBlocks(dst, src []byte)
- func (lrp *LrpCipher) Decrypter() *LrpCipher
- func (lrp *LrpCipher) Encrypt(dst, src []byte)
- func (lrp *LrpCipher) EncryptAll(src []byte, padEvenBlocks bool) []byte
- func (lrp *LrpCipher) EncryptBlocks(dst, src []byte)
- func (lrp *LrpCipher) Encrypter() *LrpCipher
- func (lrp *LrpCipher) EvalLRP(x []int, final bool) []byte
- type LrpForMAC
- type LrpMultiCipher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LrpCipher ¶
type LrpCipher struct { Multi *LrpMultiCipher Key []byte Counter uint64 CounterSize int Encrypting bool }
func (*LrpCipher) CounterPieces ¶
Breaks the block counter into nibbles for the EvalLRP primitive
func (*LrpCipher) CryptBlocks ¶
Standard BlockMode interface functions
func (*LrpCipher) DecryptAll ¶
Decrypt the entire message. removePadding tells whether or not it was originally padded, and, therefore, whether to remove the padding before it is returned.
func (*LrpCipher) DecryptBlocks ¶
Decrypt the given blocks in src to dst. Requires full blocks.
func (*LrpCipher) EncryptAll ¶
Encrypt the entire message. All non-even blocks are padded. Setting padEvenBlocks to true will give you padded blocks no matter what. This is normally what you want, but NXP has a few cases of non-padded encryption.
func (*LrpCipher) EncryptBlocks ¶
Encrypts the given blocks from src to dst. Based on the smaller of src/dst. Requires that src is only full blocks.
type LrpForMAC ¶
type LrpForMAC struct {
LrpCipher
}
type LrpMultiCipher ¶
func NewMultiCipher ¶
func NewMultiCipher(key []byte, nibbleSize int) *LrpMultiCipher
Creates a new multi-cipher with a given nibble size
func NewStandardMultiCipher ¶
func NewStandardMultiCipher(key []byte) *LrpMultiCipher
Create a multi-cipher with the standard nibble size
func (LrpMultiCipher) Cipher ¶
func (lrp LrpMultiCipher) Cipher(idx int) *LrpCipher
Generates a cipher with the specific key number from the multi-cypher.
func (LrpMultiCipher) CipherForMAC ¶
func (lrp LrpMultiCipher) CipherForMAC(idx int) *LrpForMAC
Generates a cipher specifically for use for MAC-ing (uses the LRP primitive rather than the encryption). Note that the “Encrypt” function doesn't actually encrypt/decrypt, but MAC processes utilize that interface.
func (*LrpMultiCipher) Reset ¶
func (lrp *LrpMultiCipher) Reset()
Recalculates all of the shared plaintexts of the multi-cipher