Documentation
¶
Index ¶
- Variables
- func BlockAlgorithmExists(algorithmId uint8) bool
- func DecryptAES(key, data []byte) []byte
- func DecryptData(key, data []byte) []byte
- func EncryptAES(key, data []byte) []byte
- func EncryptData(key, data []byte) []byte
- type AlgorithmSupporter
- type CryptoLayer
- type CryptoLayerKind
- type KeyCollection
- type KeyLayerCollection
- func (c KeyLayerCollection) Contains(layer *CryptoLayer) bool
- func (c KeyLayerCollection) ContainsKind(kind CryptoLayerKind) bool
- func (c KeyLayerCollection) GetKeyLength() int
- func (c KeyLayerCollection) GetLayerByIndex(index int) *CryptoLayer
- func (c KeyLayerCollection) GetLayerLengthByKind(kind CryptoLayerKind) *LayerLengthContainer
- func (c KeyLayerCollection) IsValid() bool
- type KeysContainer
- type LayerBlock
- type LayerLengthContainer
- type PasswordContainer256
- type PasswordContainer512
- type WotoAlgorithm
- type WotoKey
- type WotoLayerLength
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidKey = errors.New("invalid key") ErrInvalidCryptoLayer = errors.New("invalid crypto layer") )
Functions ¶
func BlockAlgorithmExists ¶
func DecryptAES ¶
func DecryptData ¶
func EncryptAES ¶
func EncryptData ¶
Types ¶
type AlgorithmSupporter ¶
type AlgorithmSupporter interface {
SetAlgorithm(algorithm WotoAlgorithm) bool
HasEqualAlgorithm(algorithm WotoAlgorithm) bool
GetAlgorithm() WotoAlgorithm
GetHashCount() int
}
type CryptoLayer ¶
type CryptoLayer struct {
Kind CryptoLayerKind `json:"kind"`
Hash string `json:"hash"`
// contains filtered or unexported fields
}
func (*CryptoLayer) Equal ¶
func (l *CryptoLayer) Equal(layer *CryptoLayer) bool
func (*CryptoLayer) GetLayerLength ¶
func (l *CryptoLayer) GetLayerLength() *LayerLengthContainer
func (*CryptoLayer) IsValid ¶
func (l *CryptoLayer) IsValid() bool
func (*CryptoLayer) ToBytes ¶
func (l *CryptoLayer) ToBytes() ([]byte, error)
type CryptoLayerKind ¶
type CryptoLayerKind uint8
const ( CryptoLayerKindO27 CryptoLayerKind = 27 << iota CryptoLayerKindO54 CryptoLayerKindO108 CryptoLayerKindO216 )
type KeyCollection ¶
type KeyLayerCollection ¶
type KeyLayerCollection []CryptoLayer
func (KeyLayerCollection) Contains ¶
func (c KeyLayerCollection) Contains(layer *CryptoLayer) bool
func (KeyLayerCollection) ContainsKind ¶
func (c KeyLayerCollection) ContainsKind(kind CryptoLayerKind) bool
func (KeyLayerCollection) GetKeyLength ¶
func (c KeyLayerCollection) GetKeyLength() int
func (KeyLayerCollection) GetLayerByIndex ¶
func (c KeyLayerCollection) GetLayerByIndex(index int) *CryptoLayer
func (KeyLayerCollection) GetLayerLengthByKind ¶
func (c KeyLayerCollection) GetLayerLengthByKind(kind CryptoLayerKind) *LayerLengthContainer
func (KeyLayerCollection) IsValid ¶
func (c KeyLayerCollection) IsValid() bool
type KeysContainer ¶
type KeysContainer interface {
SetAsKeys(value KeyCollection)
}
type LayerBlock ¶
type LayerBlock interface {
ContainsLayerKind(kind CryptoLayerKind) bool
ContainsLayer(layer *CryptoLayer) bool
AppendLayer(layer *CryptoLayer) bool
RemoveLayer(layer *CryptoLayer) bool
RemoveLayers(layers ...*CryptoLayer)
GetLayerLengthByKind(kind CryptoLayerKind) *LayerLengthContainer
GetLayerLengthByIndex(index int) *LayerLengthContainer
GetKeyLayersCount() int
}
type LayerLengthContainer ¶
type LayerLengthContainer struct {
Length WotoLayerLength
LayerKind CryptoLayerKind
}
func (*LayerLengthContainer) IsValid ¶
func (c *LayerLengthContainer) IsValid() bool
type PasswordContainer256 ¶
type PasswordContainer256 = passContainer.PasswordContainer256
type PasswordContainer512 ¶
type PasswordContainer512 = passContainer.PasswordContainer256
type WotoAlgorithm ¶
type WotoAlgorithm uint16
const ( // See https://www.jstatsoft.org/article/view/v008i14/xorshift.pdf WotoAlgorithmM250 WotoAlgorithm = 2 << ^uint8(250) WotoAlgorithmM251 WotoAlgorithm = 3 << ^uint8(251) WotoAlgorithmM252 WotoAlgorithm = 5 << ^uint8(252) WotoAlgorithmM253 WotoAlgorithm = 8 << ^uint8(253) )
type WotoKey ¶
type WotoKey interface {
fmt.Stringer
ws.Validator
ws.SignatureContainer
ws.Serializer
AlgorithmSupporter
LayerBlock
IsFuture() bool
IsPast() bool
IsPresent() bool
IsEmpty() bool
CanBecomeFuture() bool
CanBecomePresent() bool
CanBecomePast() bool
Decrypt(data []byte) []byte
Encrypt(data []byte) []byte
HasEqualKind(key WotoKey) bool
HasEqualSignature(key WotoKey) bool
GetKeyLength() int
GetSignatureRealLength() int
IsRealLengthInvalid() bool
// Deprecated: you can't convert any WotoKey to a FutureKey anymore.
// Please use GenerateFutureKey helper function.
ToFutureKey() WotoKey
ToPresentKey() WotoKey
ToPastKey() WotoKey
Clone() WotoKey
// contains filtered or unexported methods
}
func GenerateFutureKey ¶
GenerateFutureKey is supposed to generate a new future key by using the specified paskey's algorithm.
func GeneratePresentKey ¶
func GeneratePresentKey(algo WotoAlgorithm) WotoKey
type WotoLayerLength ¶
type WotoLayerLength uint32
Click to show internal directories.
Click to hide internal directories.