sike

package
v0.0.0-...-d2f0f90 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2019 License: BSD-3-Clause, MIT Imports: 5 Imported by: 10

Documentation

Overview

[SIKE] http://www.sike.org/files/SIDH-spec.pdf [REF] https://github.com/Microsoft/PQCrypto-SIDH

Index

Constants

This section is empty.

Variables

View Source
var F = []byte{0x02, 0x00}
View Source
var G = []byte{0x00, 0x00}

Constants used for cSHAKE customization Those values are different than in [SIKE] - they are encoded on 16bits. This is done in order for implementation to be compatible with [REF] and test vectors.

View Source
var H = []byte{0x01, 0x00}

Functions

func Decapsulate

func Decapsulate(prv *PrivateKey, pub *PublicKey, ctext []byte) ([]byte, error)

Decapsulate given the keypair and ciphertext as inputs, Decapsulate outputs a shared secret if plaintext verifies correctly, otherwise function outputs random value. Decapsulation may fail in case input is wrongly formated. Constant time for properly initialized input.

func Decrypt

func Decrypt(prv *PrivateKey, ctext []byte) ([]byte, error)

Uses SIKE private key to decrypt ciphertext. Returns plaintext in case decryption succeeds or error in case unexptected input was provided. Constant time

func Encapsulate

func Encapsulate(rng io.Reader, pub *PublicKey) (ctext []byte, secret []byte, err error)

Encapsulation receives the public key and generates SIKE ciphertext and shared secret. The generated ciphertext is used for authentication. The rng must be cryptographically secure PRNG. Error is returned in case PRNG fails or wrongly formated input was provided.

func Encrypt

func Encrypt(rng io.Reader, pub *PublicKey, ptext []byte) ([]byte, error)

Uses SIKE public key to encrypt plaintext. Requires cryptographically secure PRNG Returns ciphertext in case encryption succeeds. Returns error in case PRNG fails or wrongly formated input was provided.

Types

This section is empty.

Jump to

Keyboard shortcuts

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