package
0.0.0-20241226145920-483c662f7ff1
Repository: https://github.com/pingooio/stdx.git
Documentation: pkg.go.dev
# Packages
No description provided by the author
Package blake3 implements the BLAKE3 cryptographic hash function.
Package chacha implements some low-level functions of the ChaCha cipher family.
Package chacha20 implements the ChaCha20 / XChaCha20 stream chipher.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Functions
ConstantTimeCompare returns true if the 2 buffer are equals and false otherwise.
DecryptWithNonce is an helper function to symetrically decrypt a piece of data using AES-256-GCM The nonce should be at the begining of the ciphertext.
DecryptWithNonce is an helper function to symetrically decrypt a piece of data using AES-256-GCM taking the nonce as a separate piece of input.
DeriveKeyFromKey derives a key from a high entropy key using the blake2b function.
DeriveKeyFromPassword derives a key from a human provided password using the argon2id Key Derivation Function.
Encrypt is an helper function to symetrically encrypt a piece of data using AES-256-GCM the nonce is prepended to the ciphertext in the returned buffer.
Encrypt is an helper function to symetrically encrypt a piece of data using AES-256-GCM returning the nonce separatly.
GenerateCurve25519KeyPair generates a public/private Curve25519 key pair.
GenerateEd25519KeyPair generates a public/private Ed25519 key pair.
HashPassword returns a Argon2id hash of a plain-text password using the provided algorithm parameters.
Mac use the blake2b funciton in MAC mode.
NewAEAD returns a AES-256-GCM AEAD that uses the given 256-bit key.
NewAEADKey generates a new random secret key.
NewAEADNonce generates a new random nonce.
No description provided by the author
NewEd25519PrivateKeyFromSeed calculates a private key from a seed.
No description provided by the author
No description provided by the author
RandBytes returns securely generated random bytes.
RandInt64Between returns a uniform random value in [min, max).
VerifyPasswordHash performs a constant-time comparison between a plain-text password and Argon2id hash, using the parameters and salt contained in the hash.
Zeroize set all bytes of buffer to 0.
# Constants
AEADKeySize is the size of the key used by this AEAD, in bytes.
AEADNonceSize is the size of the nonce used with the AES-256-GCM variant of this AEAD, in bytes.
Curve25519PrivateKeySize is the size, in bytes, of private keys as used in this package.
Curve25519PublicKeySize is the size, in bytes, of public keys as used in this package.
Ed25519PrivateKeySize is the size, in bytes, of private keys as used in this package.
Ed25519PublicKeySize is the size, in bytes, of public keys as used in this package.
Ed25519SeedSize is the size, in bytes, of private key seeds.
Ed25519SignatureSize is the size, in bytes, of signatures generated and verified by this package.
Ed25519SignerOpts must be used for `PrivateKey.Sign`.
HashSize256 is the size in bytes of a 256 bits hash.
HashSize384 is the size in bytes of a 384 bits hash.
HashSize512 is the size in bytes of a 512 bits hash.
KeySize1024 is the size in bytes of a 1024 bits key.
KeySize128 is the size in bytes of a 128 bits key.
KeySize2048 is the size in bytes of a 2048 bits key.
KeySize256 is the size in bytes of a 256 bits key.
KeySize384 is the size in bytes of a 384 bits key.
KeySize4096 is the size in bytes of a 4096 bits key.
KeySize512 is the size in bytes of a 512 bits key.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
X25519SharedSecretSize is the size, in bytes of the shared secret of a x25519 key exchange.
# Variables
DefaultDeriveKeyFromPasswordParams provides some sane default parameters for deriving keys passwords.
DefaultHashPasswordParams provides some sane default parameters for hashing passwords.
ErrIncompatiblePasswordHashVersion in returned by ComparePasswordAndHash if the provided hash was created using a different version of Argon2.
ErrInvalidPasswordHash in returned by ComparePasswordAndHash if the provided hash isn't in the expected format.
# Structs
DeriveKeyFromPasswordParams describes the input parameters used by the Argon2id algorithm.
HashPasswordParams describes the input parameters used by the Argon2id algorithm.
No description provided by the author
# Type aliases
Curve25519PrivateKey is the type of Curve25519 private keys.
Curve25519PublicKey is the type of Curve25519 public keys.
Ed25519PrivateKey is the type of Ed25519 private keys.
Ed25519PublicKey is the type of Ed25519 public keys.
HashSize is the size of a hash, in bytes.