keywrap

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2020 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package keywrap is an implementation of the RFC 3394 AES key wrapping algorithm. This is used in OpenPGP with elliptic curve keys.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrWrapPlaintext is returned if the plaintext is not a multiple
	// of 64 bits.
	ErrWrapPlaintext = errors.New("keywrap: plainText must be a multiple of 64 bits")

	// ErrUnwrapCiphertext is returned if the ciphertext is not a
	// multiple of 64 bits.
	ErrUnwrapCiphertext = errors.New("keywrap: cipherText must by a multiple of 64 bits")

	// ErrUnwrapFailed is returned if unwrapping a key fails.
	ErrUnwrapFailed = errors.New("keywrap: failed to unwrap key")

	// ErrInvalidKey is returned when the AES key is invalid.
	ErrInvalidKey = errors.New("keywrap: invalid AES key")
)

Functions

func Unwrap

func Unwrap(key, cipherText []byte) ([]byte, error)

Unwrap a key using the RFC 3394 AES Key Wrap Algorithm.

func Wrap

func Wrap(key, plainText []byte) ([]byte, error)

Wrap a key using the RFC 3394 AES Key Wrap Algorithm.

Types

This section is empty.

Jump to

Keyboard shortcuts

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