elligator2 0.1.0

Elligator2 for Curve25519: encode X25519 public keys as uniform random bit strings and back. Built on fiat-crypto's formally verified field arithmetic, differentially tested, no_std.
Documentation
name: CI

on:
  push:
    branches: [main]
  pull_request:

env:
  CARGO_TERM_COLOR: always

jobs:
  test:
    name: test (${{ matrix.os }})
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, windows-latest, macos-latest]
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      - name: Test (all features)
        run: cargo test --all-features
      - name: Test (default features)
        run: cargo test
      - name: Build (no features)
        run: cargo build --no-default-features

  lint:
    name: fmt + clippy
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt, clippy
      - uses: Swatinem/rust-cache@v2
      - run: cargo fmt --all --check
      - run: cargo clippy --all-features --all-targets -- -D warnings

  # The README claims `no_std`. This is what makes that a checked claim rather
  # than a hopeful one: `thumbv7em-none-eabi` has no `std` to accidentally link.
  no_std:
    name: no_std (thumbv7em-none-eabi)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          targets: thumbv7em-none-eabi
      - uses: Swatinem/rust-cache@v2
      - run: cargo build --no-default-features --target thumbv7em-none-eabi
      - run: cargo build --no-default-features --features keygen --target thumbv7em-none-eabi

  publish-dry-run:
    name: cargo publish --dry-run
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      - run: cargo publish --dry-run