Documentation ¶
Overview ¶
nntpchan crypto package wraps all external crypro libs
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Hash = blake256.New
common hash function is blake2
View Source
var RandBytes = nacl.RandBytes
generate random bytes
Functions ¶
Types ¶
type SigDecoder ¶
type SigDecoder interface { // decode signature from io.Reader // reads all data until io.EOF // returns singaure or error if an error occured while reading Decode(r io.Reader) (Signature, error) // decode a signature from string // returns signature or error if an error ocurred while decoding DecodeString(str string) (Signature, error) }
a decoder of signatures
type SigEncoder ¶
type Signer ¶
type Signer interface { io.Writer // generate detached Signature from previously fed body via Write() Sign() Signature }
provides generic signing interface for producing detached signatures call Write() to feed data to be signed, call Sign() to generate a detached signature
type Verifer ¶
type Verifer interface { io.Writer // verify detached signature from body previously fed via Write() // return true if the detached signature is valid given the body Verify(sig Signature) bool }
provides generic signature call Write() to feed in message body once the entire body has been fed in via Write() call Verify() with detached signature to verify the detached signature against the previously fed body
func CreateVerifier ¶
create a standard verifier given a public key
Click to show internal directories.
Click to hide internal directories.