package
0.0.0-20180221002947-fd3dc7f68e37
Repository: https://github.com/stormentt/zpass-lib.git
Documentation: pkg.go.dev

# Functions

AuthPairFromBytes creates an AuthPair from a byte slice b must be either AuthFullSize or AuthHalfSize in length If len(b) is AuthFullSize, the AuthPair will be able to sign & verify messages If len(b) is AuthHalfSize, the AuthPair will only be able to verify messages.
CryptoProviderFromBytes creates a CryptoProvider from a byte slice b must be EncKeySize+IntKeySize+AuthFullSize in length.
HashFile uses the hasher to calculate a hash for a file.
HashReader uses the hasher to calculate a hash for a reader.
NewAuthPair generates a new public/private key pair.
NewCryptoProvider generates a new CryptoProvider with random keys.
NewEncryptionKey generates a new random encryption key.
NewIntegrityKey generates a new random integrity key.
NewSalsaReader creates a new SalsaReader which will read from backing This function validates the backing's MAC and will block until the validation is finished.
NewSalsaWriter creates a new SalsaWriter that will write to backing This function leaves a IntHashSize byte block at the start of the backing stream, to hold the position of the MAC once its been calculated.

# Constants

AuthFullSize is the size of a keypair with both public & private keys.
AuthHalfSize is the size of a keypair with a single key.
AuthSigSize is the size of a signature We use ed25519 for signing, so this is 64 bytes (512 bits).
EncBlockSize is the size of our encryption blocks.
EncKeySize is the size of an encryption key.
EncNonceSize is the size of our encryption nonce.
FileChunkSize is the size of chunk we use when reading in files.
4 bytes for the int32 extraByte count.
IntHashSize is the size of an integrity hash.
IntKeySize is the size of an integrity key.
MsgOverhead is the overhead on a standard message (ie not a file) Every message needs a new nonce and an integrity hash.

# Structs

AuthPair provides authentication via public/private keys.
AuthPairBadSizeError is returned if an invalid sized byte slice is used as an AuthPair.
CryptoProvider provides encryption, integrity, and authentication using symmetric keys for encryption and public/private keys for authentication.
CryptoProviderBadSizeError is returned if an invalid sized byte slice is used as an CryptoProvider.
EncKeyBadSizeError is returned if an invalid sized byte slice is used as an EncryptionKey.
EncNonceBadSizeError is returned if an invalid sized byte slice is used as a SalsaNonce.
IntKeyBadSizeError is returned if an invalid sized byte slice is used as an IntegrityKey.
InvalidSignatureError is returned if a decryption is attempted on a tampered message.
MACMismatchError is returned if the calculated MAC of a ciphertext does not match the provided MAC.
MsgTooShortError is returned if the ciphertext is too short to be valid.
NoPrivKeyError is returned if an AuthPair attempts to do something that requires a private key (such as signing) and it does not have one.
SalsaReader decrypts an io.ReadSeeker.
SalsaWriter encrypts data and writes it to an io.WriteSeeker.
SalsaWriterClosedError is returned if a write is attempted to a closed salsa writer.
SoughtBehindError is returned if a seek is attempted behind the start of a SalsaReader's actual data.
UnintegrousReadError is returned if a read or seek is attempted on a tampered SalsaReader.

# Type aliases

EncryptionKey must be EncKeySize bytes long.
IntegrityKey must be IntKeySize bytes long.
SalsaNonce is a helper type for keeping track of an XSalsa20 nonce's counter.