~/bend-docscommunity

src/crypto/ed25519/ed25519.bend checks

raw source on the hub · import 0xd9a2fae439ac7ff9e21e0853948f94fe/src/crypto/ed25519/ed25519.bend as Ed25519

6 imports
import Base
import ../hash.bend as H
import ../curve25519/field.bend as F
import ../curve25519/x25519.bend as X
import ./scalar.bend as SC
import ./point.bend as PT

Definitions

def cat source · line 13 · raw

@xs:List<&2, U32> -> @ys:List<&2, U32> -> List<&2, U32>

def hram source · line 21 · raw

@rb:List<&2, U32> -> @+a:List<&2, U32> -> @+msg:List<&2, U32> -> List<&2, U32>

k = SHA-512(R || A || M) mod L

def secret source · line 29 · raw

@+h:List<&2, U32> -> List<&2, U32>

the secret scalar s (pruned lower half of SHA-512(seed)) and the prefix

def prefix source · line 32 · raw

@+h:List<&2, U32> -> List<&2, U32>

def public_of source · line 37 · raw

@+c:0xd9a2fae439ac7ff9e21e0853948f94fe/src/crypto/ed25519/point.Cs -> @+xs:List<&2, U32> -> @+h:List<&2, U32> -> List<&2, U32>

xs: an input (the seed or the public key), which keeps the proof checker from computing the curve constants (see PT.lit)

def public_key source · line 41 · raw

@+seed:List<&2, U32> -> List<&2, U32>

A = [s]B, encoded

def sign_with source · line 44 · raw

@+c:0xd9a2fae439ac7ff9e21e0853948f94fe/src/crypto/ed25519/point.Cs -> @+xs:List<&2, U32> -> @+h:List<&2, U32> -> @+msg:List<&2, U32> -> List<&2, U32>

def sign_raw source · line 52 · raw

@+seed:List<&2, U32> -> @+msg:List<&2, U32> -> List<&2, U32>

def check source · line 55 · raw

@+c:0xd9a2fae439ac7ff9e21e0853948f94fe/src/crypto/ed25519/point.Cs -> @+sb:List<&2, U32> -> @+rb:List<&2, U32> -> @+pk:List<&2, U32> -> @+msg:List<&2, U32> -> @ra:Maybe<&2, 0xd9a2fae439ac7ff9e21e0853948f94fe/src/crypto/ed25519/point.Pt> -> @aa:Maybe<&2, 0xd9a2fae439ac7ff9e21e0853948f94fe/src/crypto/ed25519/point.Pt> -> Bool

def verify_with source · line 64 · raw

@+c:0xd9a2fae439ac7ff9e21e0853948f94fe/src/crypto/ed25519/point.Cs -> @+pk:List<&2, U32> -> @+msg:List<&2, U32> -> @+rb:List<&2, U32> -> @+sb:List<&2, U32> -> @s_ok:Bool -> Bool

def verify_raw source · line 71 · raw

@+pk:List<&2, U32> -> @+msg:List<&2, U32> -> @+sig:List<&2, U32> -> Bool