smaead

package module
v0.0.0-...-f517b99 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: BSD-3-Clause Imports: 5 Imported by: 0

README

Student Main's broken AEAD

These AEAD implementation is used to decrypt cipher text without verify tag. It's purpose is provided a preview to long cipher text. DO NOT USE it's output as final result, use a real AEAD implementation to verify its result.

Documentation

Overview

Copyright 2016 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Index

Constants

View Source
const (
	// KeySize is the size of the key used by this AEAD, in bytes.
	KeySize = 32

	// NonceSize is the size of the nonce used with the standard variant of this
	// AEAD, in bytes.
	//
	// Note that this is too short to be safely generated at random if the same
	// key is reused more than 2³² times.
	NonceSize = 12

	// NonceSizeX is the size of the nonce used with the XChaCha20-Poly1305
	// variant of this AEAD, in bytes.
	NonceSizeX = 24
)

Variables

This section is empty.

Functions

func XORBytes

func XORBytes(dst, a, b []byte) int

Types

type Chacha20poly1305

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

func NewPartialChacha20Poly1305

func NewPartialChacha20Poly1305(key []byte) (*Chacha20poly1305, error)

New returns a ChaCha20-Poly1305 AEAD that uses the given 256-bit key.

func (*Chacha20poly1305) OpenWithoutCheck

func (c *Chacha20poly1305) OpenWithoutCheck(dst, nonce, ciphertext []byte) []byte

type Gcm

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

Gcm represents a Galois Counter Mode with a specific key. See https://csrc.nist.gov/groups/ST/toolkit/BCM/documents/proposedmodes/gcm/gcm-revised-spec.pdf

func NewPartialGCM

func NewPartialGCM(cipher cipher.Block) (*Gcm, error)

func (*Gcm) OpenWithoutCheck

func (g *Gcm) OpenWithoutCheck(dst, nonce, ciphertext []byte) []byte

type PartialAEAD

type PartialAEAD interface {
	OpenWithoutCheck(dst, nonce, ciphertext []byte) []byte
}

Jump to

Keyboard shortcuts

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