oqs

package
v0.0.0-...-15ab7cc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 21, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

README

Ideally, the code in this folder would live in /usr/local/.../libexec/crypto/ (src/bin). Instead, we'll make this directory for it.

Follow the installation instructions for liboqs here: https://github.com/open-quantum-safe/liboqs. Add the location of the installed liboqs.so file to $PATH.

Note to self: Where should this go? Should we separate the OQSSig interface from the library functions?

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildAltPublicKeyExtensions

func BuildAltPublicKeyExtensions(quantumKey interface{}, classicalKey interface{}, qSigner crypto.Signer) ([]pkix.Extension, error)

func GetRandomBytes

func GetRandomBytes(nbytes int) (randombytes []byte, err error)

func IsSigEnabled

func IsSigEnabled(algName SigType) bool

func KeyPair

func KeyPair(algName SigType) (publicKey PublicKey, secretKey SecretKey, err error)

func MarshalPKIXPrivateKey

func MarshalPKIXPrivateKey(pub interface{}) ([]byte, error)

func MarshalPKIXPublicKey

func MarshalPKIXPublicKey(pub interface{}) ([]byte, error)

func MaxNumberSigs

func MaxNumberSigs() int

func ParsePKIXPrivateKey

func ParsePKIXPrivateKey(derBytes []byte) (interface{}, error)

func ParsePKIXPublicKey

func ParsePKIXPublicKey(derBytes []byte) (interface{}, error)

func Sign

func Sign(secretKey SecretKey, message []byte) (signature []byte, err error)

func Validate

func Validate(validationChain []*x509.Certificate) error

func Verify

func Verify(publicKey PublicKey, signature []byte, message []byte) (assert bool, err error)

Types

type AlgType

type AlgType string
const (
	AlgNistKat AlgType = "NIST-KAT"
)

type Algorithm

type Algorithm = SigType

type KeyMaterial

type KeyMaterial struct {
	ClassicalBytes asn1.BitString
	QuantumBytes   asn1.BitString
}

type OQSLib

type OQSLib struct {
	// contains filtered or unexported fields
}

func GetLib

func GetLib() (*OQSLib, error)

func (*OQSLib) EnabledSigs

func (l *OQSLib) EnabledSigs() []SigType

func (*OQSLib) GetAlgorithmFromOID

func (l *OQSLib) GetAlgorithmFromOID(oid asn1.ObjectIdentifier) Algorithm

func (*OQSLib) GetAlgorithmIdentifier

func (l *OQSLib) GetAlgorithmIdentifier(alg SigType) (ai pkix.AlgorithmIdentifier, err error)

func (*OQSLib) GetSig

func (l *OQSLib) GetSig(sigType SigType) (*OQSSig, error)

type OQSSig

type OQSSig struct {
	// contains filtered or unexported fields
}

type OQSSigInfo

type OQSSigInfo struct {
	Algorithm SigType
}

type PublicKey

type PublicKey struct {
	Pk  []byte
	Sig OQSSigInfo
}

func ParseSubjectAltPublicKeyInfoExtension

func ParseSubjectAltPublicKeyInfoExtension(extensions []pkix.Extension) (*PublicKey, error)

type SecretKey

type SecretKey struct {
	Sk []byte
	PublicKey
}

type SigType

type SigType string
const UnknownKeyAlgorithm SigType = "UnknownKeyAlgorithm"

func SigName

func SigName(algID int) (SigType, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL