Skip to content

Serialization with no_std #66

@KyleKotowick

Description

@KyleKotowick

When the serialization feature is enabled, pqcrypto will include the serde crate. The serde crate includes std as a default feature. This means that it's not possible to use pqcrypto with serialization in a no_std environment.

Would it be possible disable standard features in the serde dependency? i.e. serde = { version = "1.0", default-features = false, features = ["derive"] }?

Edit: I tried this with a fork and it's throwing a number of errors. Looking for any alternative on how to achieve serialization/deserialization in a no_std environment.

Compilation error with
serde = { version = "1.0", default-features = false, features = ["derive", "alloc"], optional = true }

The following warnings were emitted during compilation:

warning: ar: '/home/.../target/debug/build/pqcrypto-dilithium-918f739615645239/out/libdilithium2_clean.a': No such file

error: failed to run custom build command for `pqcrypto-dilithium v0.5.0 (/home/.../pqcrypto/pqcrypto-dilithium)`

Caused by:
  process didn't exit successfully: `/home/.../target/debug/build/pqcrypto-dilithium-192d2ee7428ca425/build-script-build` (exit status: 1)
  --- stdout
  OUT_DIR = Some(/home/.../target/debug/build/pqcrypto-dilithium-918f739615645239/out)
  TARGET = Some(x86_64-unknown-linux-gnu)
  HOST = Some(x86_64-unknown-linux-gnu)
  cargo:rerun-if-env-changed=AR_x86_64-unknown-linux-gnu
  AR_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=AR_x86_64_unknown_linux_gnu
  AR_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_AR
  HOST_AR = None
  cargo:rerun-if-env-changed=AR
  AR = None
  cargo:rerun-if-env-changed=ARFLAGS_x86_64-unknown-linux-gnu
  ARFLAGS_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=ARFLAGS_x86_64_unknown_linux_gnu
  ARFLAGS_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_ARFLAGS
  HOST_ARFLAGS = None
  cargo:rerun-if-env-changed=ARFLAGS
  ARFLAGS = None
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:warning=ar: '/home/.../target/debug/build/pqcrypto-dilithium-918f739615645239/out/libdilithium2_clean.a': No such file

  --- stderr


  error occurred: Command "ar" "s" "/home/.../target/debug/build/pqcrypto-dilithium-918f739615645239/out/libdilithium2_clean.a" with args ar did not execute successfully (status code exit status: 1).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions