bend-collections
Releases (1)
-
1.0.0.0 indexed
Definitions (4,483)
spec/crypto/secp256k1/schnorr.bend
- def verify_rsR = s G - e P with e = int(hash_challenge(r || pk || m)) mod n
- def verify_ok
- def verify_pfail if r >= p or s >= n
- def verify_len
- def verifyVerify(pk, m, sig): pk 32 bytes, sig 64 bytes, m any length
- def secret_okd' = int(sk), 1 <= d' <= n - 1
- def pub_of
- def pubkey_ok
- def pubkeyPubKey(sk) = bytes(d' G)
- def sign_ifsig = bytes(R) || bytes((k + e d) mod n); if Verify(bytes(P), m, sig) fails, abort
- def sign_fin
- def sign_rR = k' G; k = k' if has_even_y(R), otherwise n - k'; e = int(hash_challenge(bytes(R) || bytes(P) || m)) mod n
- def sign_kzk' = int(rand) mod n; fail if k' = 0
- def sign_k
- def sign_pP = d' G; d = d' if has_even_y(P), otherwise n - d'; t = bytes(d) xor hash_aux(a); rand = hash_nonce(t || bytes(P) || m)
- def sign_ok
- def signSign(sk, m, a): sk and a 32 bytes, m any length
spec/crypto/sha.bend
- def initial
- def rotateFIPS 4.1.2: ROR_n(x) = SHR_n(x) OR SHL_(32-n)(x).
- def sigma0
- def sigma1
- def sum0
- def sum1
- def ch
- def maj
- def octetsA base-256 representation, most significant digit first, of fixed width.
- def length_field8*n = 256*(n/32) + 8*(n mod 32); avoids overflowing runtime Nat.
- def zero_count_ifFIPS padding: a remainder of 0..55 leaves room in this block; a remainder of 56..63 needs another block.
- def zero_count
- def padding_suffix
- def pad
- def decode
- def words
- def nthIn reverse history, index j denotes W[t-1-j].
- def previousThe FIPS recurrence names prior words by lags 2, 7, 15 and 16.
- def recurrence
- def extension
- def scheduleStandard SHA-256 instantiates extra=48, extending the initial 16 to 64.
- def schedules
- def prepare
- def step
- def rounds
- def feedforward
- def compress
- def blocks
- def digest
- def hash
- def constantsFIPS 180-4 section 4.2.2, transcribed separately from the implementation.
- def sha256
- def word_octetsFIPS digest serialization: most significant octet of each word first.
- def digest_octets
- def sha256_bytes
spec/crypto/sha/packed.bend
- def len_hiPacked-format reference: logical input byte j is the big-endian byte j%4 of array word floor(j/4).
- def len_lo
- def partial
- def pad_choose
- def pad_word
- def length_word
- def padded_word
- def padded_words
- def prepare
- def compress
- def gather
- def final_extra
- def blocks
- def take_state
- def hash_unchecked
- def checked
- def sized
- def hash
- def digest_result
- def sha256
spec/crypto/subtle.bend
- def equal
spec/lib/common.bend
- def pow22^k as a natural number.
- def shiftWidths without powers: x * 2^k, n div 2^k and n mod 2^k by k doublings or halvings, and "n fits k bits".
- def halfn div 2 and n mod 2, structurally
- def bit
- def high
- def low
- def fitsn < 2^k
- def length
- def nthElement i, if any.
- def updateReplace element i (no change when i is out of range).
- def snoc
- def last
- def init
- def head
- def tail
- def append
- def reverse
- def replicate
- def take
- def drop
- def memnmembership of a natural number in a list of them