local expect = require "cc.expect".expect local fp = require "ccryptolib.internal.fp" local fq = require "ccryptolib.internal.fq" local x25519 = require "ccryptolib.internal.x25519" local random = require "ccryptolib.random" local ORDER = 4 --- The inverse of 8 modulo q (in montgomery form). local INV8Q = { 5110253, 3039345, 2503500, 11779568, 15416472, 16766550, 16777215, 16777215, 16777215, 16777215, 4095, } local function fqRandom() return fq.decodeWide(random.random(64)) end local function fqDecodeStd(str) -- Decode. local words = {("