Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConstantTimeCompare ¶
ConstantTimeCompare checks if two slices are equal and returns true if they are, false otherwise. It uses constant-time comparison. It's not contant time when len(d1) != len(d2)
Types ¶
type NonceCounter ¶
type NonceCounter []uint8
NonceCounter is preallocated slice of specified size, which can be efficiently incremented by one in order to produce unique nonces for data encryption.
NOTE: NocneCounter IS NOT CONSTANT TIME!!! Be aware that this counter leaks(or may leak) count of chunks encrypted already. Usually this is not problem, since attacker knows anyway how many chunks were encrypted.
func NonceCounterForAEAD ¶
func NonceCounterForAEAD(aead cipher.AEAD) NonceCounter
NonceCounterForAEAD creates nonce counter appropriate for specified AEAD cipher.
func (NonceCounter) Increment ¶
func (nonce NonceCounter) Increment() (err error)
Increment assigns next unique value to this nonce counter. If it's not possible without overflowing or changing nonce size then error is returned.
func (NonceCounter) Len ¶
func (nonce NonceCounter) Len() int
Len retuns size of nonce generated by this nonce counter.