FROST Core TypeScript Library - v0.2.2-alpha.3
    Preparing search index...

    Function computeNonAdjacentForm

    • Computes a width-(w) "Non-Adjacent Form" of a scalar.

      Thanks to curve25519-dalek for the original implementation that informed this one.

      Safety

      The full scalar field MUST fit in 256 bits in this implementation.

      Type Parameters

      Parameters

      • ciphersuite: C

        The ciphersuite providing field operations

      • scalar: Scalar<C>

        The scalar to convert

      • w: number

        The window width (must be >= 2 and <= 8)

      Returns Int8Array

      The NAF representation as an array of signed bytes