hkex

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2018 License: MIT Imports: 4 Imported by: 1

README

HerraduraKEx - an experimental Key Encapsulation Mechanism

Documentation

Overview

Package hkex - an experimental key exchange algorithm by Omar Alejandro Herrera Reyna.

(https://github.com/Caume/HerraduraKEx)

The core HerraduraKEx algorithm is dual-licensed by the author (Omar Alejandro Herrera Reyna) under GPL3 and MIT licenses. See LICENSE.gpl and LICENSE.mit in this distribution

Go implementation Copyright (c) 2017-2018 Russell Magee (rmagee_at_gmail_com) Licensed under the terms of the MIT license See LICENSE.mit in this distribution

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HerraduraKEx

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

HerraduraKEx holds the session state for a key exchange.

func New

func New(i int, p int) (h *HerraduraKEx)

New returns a HerraduraKEx struct.

i - internal (private) random nonce
p - public (exchanged) random nonce (typically 1/4 bitsize of i)

If i or p are passed as zero, they will default to 256 and 64,
respectively.

func (*HerraduraKEx) ComputeFA

func (h *HerraduraKEx) ComputeFA()

ComputeFA computes the FA value, which must be sent to peer for KEx.

func (HerraduraKEx) D

func (h HerraduraKEx) D() *big.Int

D returns the D (FSCX Revolved) value, input to generate FA (the value for peer KEx)

func (HerraduraKEx) FA

func (h HerraduraKEx) FA() *big.Int

FA returns the computed FA value

func (HerraduraKEx) PeerD

func (h HerraduraKEx) PeerD() *big.Int

PeerD returns the peer D value

func (*HerraduraKEx) SetPeerD

func (h *HerraduraKEx) SetPeerD(pd *big.Int)

SetPeerD stores the received peer's D value (contents, not ptr)

func (*HerraduraKEx) String

func (h *HerraduraKEx) String() string

Output HerraduraKEx type value as a string. Implements Stringer interface.

Jump to

Keyboard shortcuts

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