def cs_fst

bend-collections-laws-crypto@1.0.0.0 · spec/crypto/curve25519/x25519.bend:78

import bend-collections-laws-crypto@1.0.0.0/spec/crypto/curve25519/x25519.bend as X25519
import Base

78# cswap(swap, a, b), RFC 7748: (a, b) when swap is 0, (b, a) when it is 1;
79# cs_fst and cs_snd are its two components
80def cs_fst(swap: Nat, a: Nat, b: Nat) -> Nat:
81  match swap:
82    case 0n:
83      a
84    case 1n+q:
85      b

Uses (1)

Used by (8)