From a4e3b180d6b73e06c720c11f1058c596d257a3d1 Mon Sep 17 00:00:00 2001 From: Emmanuel Coste Date: Fri, 2 Sep 2022 12:09:43 +0200 Subject: [PATCH] Enable tests on external librairies (java and js) --- .gitlab-ci.yml | 93 ++++++---- CHANGELOG.md | 13 +- Cargo.lock | 278 ++++++++-------------------- Cargo.toml | 6 +- ci/cosmian_java_lib.sh | 13 ++ ci/cosmian_js_lib.sh | 14 ++ ci/detect_breaking_changes.sh | 40 ++++ src/error.rs | 2 +- src/interfaces/ffi/hybrid_cc_aes.rs | 2 +- src/interfaces/statics.rs | 2 +- 10 files changed, 217 insertions(+), 246 deletions(-) create mode 100644 ci/cosmian_java_lib.sh create mode 100644 ci/cosmian_js_lib.sh create mode 100644 ci/detect_breaking_changes.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 034bb423..61318de1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,16 +3,22 @@ image: gitlab.cosmian.com:5000/core/ci-rust:latest variables: CARGO_HOME: ${CI_PROJECT_DIR}/.cargo/ SCCACHE_DIR: ${CI_PROJECT_DIR}/.cache/sccache + COSMIAN_SERVER_URL: http://localhost:9998 + KMS_PUBLIC_PATH: /tmp + KMS_PRIVATE_PATH: /tmp + KMS_SHARED_PATH: /tmp stages: - prebuild - build + - test + - publish rustfmt: stage: prebuild cache: {} script: - - cargo format + - cargo +stable format doc: stage: prebuild @@ -24,23 +30,18 @@ clippy: stage: prebuild cache: {} script: - # no feature activated - - cargo clippy --all-targets -- -D warnings # all features activated + - cargo clippy --all-targets -- -D warnings + # no feature activated - cargo clippy-all # Security check -cargo_audit: +cargo_security_check: stage: prebuild cache: {} script: - - cargo audit - allow_failure: true - only: - refs: - - tags - - main - - develop + - cargo outdated -wR + - cargo audit --deny warnings # # Build base @@ -56,19 +57,14 @@ cargo_audit: before_script: - sccache -s -build_x86_64: +benchmarks: <<: *base_compile script: - - cargo build --verbose --release --features ffi --target x86_64-unknown-linux-gnu - - cargo test --verbose --release --features ffi --target x86_64-unknown-linux-gnu - artifacts: - paths: - - target/x86_64-unknown-linux-gnu/release/*.so - expire_in: 3 mos + - cargo bench --all-features + when: manual -build_centos7: +build_x86_64: <<: *base_compile - image: gitlab.cosmian.com:5000/core/ci-rust-glibc-2.17:latest script: - cargo build --verbose --release --features ffi --target x86_64-unknown-linux-gnu - cargo test --verbose --release --features ffi --target x86_64-unknown-linux-gnu @@ -79,31 +75,20 @@ build_centos7: - target/*.h expire_in: 3 mos -build_wasm32: +build_wasm: <<: *base_compile image: gitlab.cosmian.com:5000/core/ci-npm:latest - stage: build script: - wasm-pack build --release --features wasm_bindgen + - wasm-pack test --node --features wasm_bindgen --lib + - wasm-pack build --target nodejs --release --features wasm_bindgen artifacts: paths: - pkg expire_in: 3 mos -build_python_whl: - <<: *base_compile - stage: build - script: - - maturin build --release --features python - - bash src/interfaces/pyo3/tests/test.sh - artifacts: - paths: - - target/wheels/*.whl - expire_in: 3 mos - build_windows: <<: *base_compile - stage: build script: - cargo build --verbose --release --features ffi --target x86_64-pc-windows-gnu - cbindgen . -c cbindgen.toml | grep -v \#include | uniq >target/${CI_PROJECT_NAME}.h @@ -115,7 +100,6 @@ build_windows: build_osx: <<: *base_compile - stage: build image: gitlab.cosmian.com:5000/core/ci-rust-osx:latest script: - cargo build --verbose --release --features ffi @@ -129,13 +113,46 @@ build_osx: build_android: <<: *base_compile - stage: build image: gitlab.cosmian.com:5000/core/ci-rust-android:latest - before_script: - - rustup target add i686-linux-android x86_64-linux-android armv7-linux-androideabi aarch64-linux-android script: - cargo ndk -t x86 -t x86_64 -t armeabi-v7a -t arm64-v8a -o jniLibs build --release --features ffi --lib artifacts: paths: - jniLibs expire_in: 3 mos + +test_cosmian_java_lib: + image: gitlab.cosmian.com:5000/core/ci-java-8:latest + stage: test + services: + - name: gitlab.cosmian.com:5000/core/kms:2.1.0_ci + alias: kms_ci + script: + - bash ci/cosmian_java_lib.sh + +test_python: + stage: test + script: + - maturin build --release --features python + - bash src/interfaces/pyo3/tests/test.sh + artifacts: + paths: + - target/wheels/*.whl + expire_in: 3 mos + +test_cosmian_js_lib: + image: node:16 + stage: test + script: + - bash ci/cosmian_js_lib.sh + +publish: + image: gitlab.cosmian.com:5000/core/ci-npm:latest + stage: publish + rules: + - if: '$CI_COMMIT_TAG =~ /^v\d+.\d+.\d+$/' + script: + - echo "//registry.npmjs.org/:_authToken=$NPM_ACCESS_TOKEN" > ~/.npmrc + - wasm-pack build --release --features wasm_bindgen + - wasm-pack pack + - wasm-pack publish diff --git a/CHANGELOG.md b/CHANGELOG.md index 441b354d..1333e1a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,17 @@ All notable changes to this project will be documented in this file. +--- +## [6.0.1] - 2022-09-05 +### Added +- Enable tests on `cosmian_js_lib` and `cosmian_java_lib` +- Auto NPM publish on tags +### Changed +### Fixed +- Fix error message on invalid size errors. +### Removed +--- + --- ## [6.0.0] - 2022-08-29 ### Added @@ -32,7 +43,7 @@ All notable changes to this project will be documented in this file. - Remove `Partition`s from `Encapsulation`s: now CoverCrypt returns a vector of symmetric keys when `decaps`. These keys should be tried on real symmetric ciphertexts in order to determine which is the good one. This works because - symmetric ciphertexts are autenticated. + symmetric ciphertexts are authenticated. ### Fixed - bug in public key rotation ### Removed diff --git a/Cargo.lock b/Cargo.lock index 93d3ca8f..dedd0029 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -59,6 +59,12 @@ dependencies = [ "subtle", ] +[[package]] +name = "anes" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" + [[package]] name = "atty" version = "0.2.14" @@ -91,18 +97,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "bstr" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" -dependencies = [ - "lazy_static", - "memchr", - "regex-automata", - "serde", -] - [[package]] name = "bumpalo" version = "3.11.0" @@ -127,6 +121,33 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "ciborium" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c137568cc60b904a7724001b35ce2630fd00d5d84805fbb608ab89509d788f" +dependencies = [ + "ciborium-io", + "ciborium-ll", + "serde", +] + +[[package]] +name = "ciborium-io" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "346de753af073cc87b52b2083a506b38ac176a44cfb05497b622e27be899b369" + +[[package]] +name = "ciborium-ll" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213030a2b5a4e0c0892b6652260cf6ccac84827b83a85a534e178e3906c4cf1b" +dependencies = [ + "ciborium-io", + "half", +] + [[package]] name = "cipher" version = "0.3.0" @@ -148,13 +169,23 @@ dependencies = [ [[package]] name = "clap" -version = "2.34.0" +version = "3.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" +checksum = "23b71c3ce99b7611011217b366d923f1d0a7e07a92bb2dbf1e84508c673ca3bd" dependencies = [ "bitflags", + "clap_lex", + "indexmap", "textwrap", - "unicode-width", +] + +[[package]] +name = "clap_lex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", ] [[package]] @@ -192,7 +223,7 @@ dependencies = [ [[package]] name = "cover_crypt" -version = "6.0.0" +version = "6.0.1" dependencies = [ "abe_policy", "cosmian_crypto_core", @@ -223,23 +254,20 @@ dependencies = [ [[package]] name = "criterion" version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b01d6de93b2b6c65e17c634a26653a29d107b3c98c607c765bf38d041531cd8f" +source = "git+https://github.com/bheisler/criterion.rs?branch=version-0.4#f82ce59d710e8b5cc30b9a9b07a9da3e8e715768" dependencies = [ + "anes", "atty", "cast", + "ciborium", "clap", "criterion-plot", - "csv", "itertools", "lazy_static", "num-traits", "oorandom", - "plotters", - "rayon", "regex", "serde", - "serde_cbor", "serde_derive", "serde_json", "tinytemplate", @@ -249,58 +277,12 @@ dependencies = [ [[package]] name = "criterion-plot" version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2673cc8207403546f45f5fd319a974b1e6983ad1a3ee7e6041650013be041876" +source = "git+https://github.com/bheisler/criterion.rs?branch=version-0.4#f82ce59d710e8b5cc30b9a9b07a9da3e8e715768" dependencies = [ "cast", "itertools", ] -[[package]] -name = "crossbeam-channel" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" -dependencies = [ - "cfg-if", - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "045ebe27666471bb549370b4b0b3e51b07f56325befa4284db65fc89c02511b1" -dependencies = [ - "autocfg", - "cfg-if", - "crossbeam-utils", - "memoffset", - "once_cell", - "scopeguard", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51887d4adc7b564537b15adcfb307936f8075dfcd5f00dde9a9f1d29383682bc" -dependencies = [ - "cfg-if", - "once_cell", -] - [[package]] name = "crypto-common" version = "0.1.6" @@ -311,28 +293,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "csv" -version = "1.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22813a6dc45b335f9bade10bf7271dc477e81113e89eb251a0bc2a8a81c536e1" -dependencies = [ - "bstr", - "csv-core", - "itoa 0.4.8", - "ryu", - "serde", -] - -[[package]] -name = "csv-core" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" -dependencies = [ - "memchr", -] - [[package]] name = "ctr" version = "0.8.0" @@ -432,6 +392,12 @@ version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + [[package]] name = "hermit-abi" version = "0.1.19" @@ -465,6 +431,16 @@ dependencies = [ "digest 0.10.3", ] +[[package]] +name = "indexmap" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" +dependencies = [ + "autocfg", + "hashbrown", +] + [[package]] name = "indoc" version = "1.0.7" @@ -489,12 +465,6 @@ dependencies = [ "either", ] -[[package]] -name = "itoa" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" - [[package]] name = "itoa" version = "1.0.3" @@ -547,21 +517,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "memchr" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" - -[[package]] -name = "memoffset" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" -dependencies = [ - "autocfg", -] - [[package]] name = "num-bigint" version = "0.4.3" @@ -594,16 +549,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "num_cpus" -version = "1.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" -dependencies = [ - "hermit-abi", - "libc", -] - [[package]] name = "once_cell" version = "1.13.1" @@ -622,6 +567,12 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +[[package]] +name = "os_str_bytes" +version = "6.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" + [[package]] name = "parking_lot" version = "0.12.1" @@ -645,34 +596,6 @@ dependencies = [ "windows-sys", ] -[[package]] -name = "plotters" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "716b4eeb6c4a1d3ecc956f75b43ec2e8e8ba80026413e70a3f41fd3313d3492b" -dependencies = [ - "num-traits", - "plotters-backend", - "plotters-svg", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "plotters-backend" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "193228616381fecdc1224c62e96946dfbc73ff4384fba576e052ff8c1bea8142" - -[[package]] -name = "plotters-svg" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a81d2759aae1dae668f783c308bc5c8ebd191ff4184aaa1b37f65a6ae5a56f" -dependencies = [ - "plotters-backend", -] - [[package]] name = "polyval" version = "0.5.3" @@ -816,30 +739,6 @@ dependencies = [ "rand_core 0.6.3", ] -[[package]] -name = "rayon" -version = "1.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd99e5772ead8baa5215278c9b15bf92087709e9c1b2d1f97cdb5a183c933a7d" -dependencies = [ - "autocfg", - "crossbeam-deque", - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "258bcdb5ac6dad48491bb2992db6b7cf74878b0384908af124823d118c99683f" -dependencies = [ - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-utils", - "num_cpus", -] - [[package]] name = "redox_syscall" version = "0.2.16" @@ -858,12 +757,6 @@ dependencies = [ "regex-syntax", ] -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" - [[package]] name = "regex-syntax" version = "0.6.27" @@ -906,16 +799,6 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "serde_cbor" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" -dependencies = [ - "half", - "serde", -] - [[package]] name = "serde_derive" version = "1.0.144" @@ -933,7 +816,7 @@ version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44" dependencies = [ - "itoa 1.0.3", + "itoa", "ryu", "serde", ] @@ -980,12 +863,9 @@ checksum = "c02424087780c9b71cc96799eaeddff35af2bc513278cda5c99fc1f5d026d3c1" [[package]] name = "textwrap" -version = "0.11.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -dependencies = [ - "unicode-width", -] +checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" [[package]] name = "thiserror" @@ -1029,12 +909,6 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" -[[package]] -name = "unicode-width" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" - [[package]] name = "unindent" version = "0.1.10" diff --git a/Cargo.toml b/Cargo.toml index 54a2da0e..9af11e59 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cover_crypt" -version = "6.0.0" +version = "6.0.1" edition = "2021" authors = [ "Théophile Brezot ", @@ -50,4 +50,6 @@ wasm-bindgen = { version = "0.2", features = [ [dev-dependencies] wasm-bindgen-test = { version = "0.3" } -criterion = { version = "0.3", features = ["html_reports"] } +# Criterion used on branch "version-0.4" +# serde_cbor is unmaintained: https://rustsec.org/advisories/RUSTSEC-2021-0127 +criterion = {git = "https://github.com/bheisler/criterion.rs", branch = "version-0.4", features = ["html_reports"], default_features = false} diff --git a/ci/cosmian_java_lib.sh b/ci/cosmian_java_lib.sh new file mode 100644 index 00000000..4686c89c --- /dev/null +++ b/ci/cosmian_java_lib.sh @@ -0,0 +1,13 @@ +#!/bin/sh +set -exu + +# These tests have to be executed if no breaking have been made. +# Otherwise we know in advance that these tests will fail. +source ci/detect_breaking_changes.sh + +if [ "$DO_TEST" = "1" ]; then + git clone https://github.com/Cosmian/cosmian_java_lib.git + cp target/x86_64-unknown-linux-gnu/release/libcover_crypt.so cosmian_java_lib/src/test/resources/linux-x86-64/ + cd cosmian_java_lib + mvn package +fi diff --git a/ci/cosmian_js_lib.sh b/ci/cosmian_js_lib.sh new file mode 100644 index 00000000..ceb69a06 --- /dev/null +++ b/ci/cosmian_js_lib.sh @@ -0,0 +1,14 @@ +#!/bin/sh +set -exu + +# These tests have to be executed if no breaking have been made. +# Otherwise we know in advance that these tests will fail. +source ci/detect_breaking_changes.sh + +if [ "$DO_TEST" = "1" ]; then + git clone https://github.com/Cosmian/cosmian_js_lib.git + cp -r pkg/* cosmian_js_lib/tests/wasm_lib/abe/cover_crypt/ + cd cosmian_js_lib + npm install jest + npm test +fi diff --git a/ci/detect_breaking_changes.sh b/ci/detect_breaking_changes.sh new file mode 100644 index 00000000..0f4b093a --- /dev/null +++ b/ci/detect_breaking_changes.sh @@ -0,0 +1,40 @@ +#!/bin/sh +set -eu + +# Get version from Cargo.toml and CHANGELOG.md +cargo_version=$(grep -m1 "version = " Cargo.toml | cut -d "\"" -f2) +changelog_versions=$(grep -m2 "## \[" CHANGELOG.md | cut -d "[" -f2 | cut -d "]" -f1) + +export DO_TEST=1 + +# Export DO_TEST=1 if no breaking changes, 0 otherwise +compare_versions() { + VERSION_1=$1 + VERSION_2=$2 + [[ ! "$VERSION_1" =~ ^[0-9].[0-9].[0-9]$ ]] && echo "Semantic versioning invalid: $VERSION_1" && exit 1 + [[ ! "$VERSION_2" =~ ^[0-9].[0-9].[0-9]$ ]] && echo "Semantic versioning invalid: $VERSION_2" && exit 1 + + MAJOR_1=${VERSION_1%.*.*} + MAJOR_2=${VERSION_2%.*.*} + MINOR_1=${VERSION_1#*.} + MINOR_1=${MINOR_1%.*} + MINOR_2=${VERSION_2#*.} + MINOR_2=${MINOR_2%.*} + + # 0.X.Y + if [ "$MAJOR_1" = "0" ] && [ "$MINOR_1" != "$MINOR_2" ]; then + export DO_TEST=0 + return; + fi + + # X.Y.Z where X != 0 + if [ "$MAJOR_1" != "$MAJOR_2" ]; then + export DO_TEST=0 + fi +} + +while IFS= read -r changelog_version; do + if [ "$cargo_version" != "$changelog_version" ]; then + compare_versions $cargo_version $changelog_version + fi +done <<<"$changelog_versions" diff --git a/src/error.rs b/src/error.rs index 87482f72..acd2b9c7 100644 --- a/src/error.rs +++ b/src/error.rs @@ -17,7 +17,7 @@ pub enum Error { AttributeNotFound(String), #[error("Combination {0} already exists")] ExistingCombination(String), - #[error("invalid size")] + #[error("invalid size: {0}")] InvalidSize(String), #[error("Empty private key")] EmptyPrivateKey, diff --git a/src/interfaces/ffi/hybrid_cc_aes.rs b/src/interfaces/ffi/hybrid_cc_aes.rs index eefcb2a1..de9acba0 100644 --- a/src/interfaces/ffi/hybrid_cc_aes.rs +++ b/src/interfaces/ffi/hybrid_cc_aes.rs @@ -692,7 +692,7 @@ pub const MAX_CLEAR_TEXT_SIZE: usize = 1 << 30; #[no_mangle] /// /// # Safety -pub const unsafe extern "C" fn h_aes_symmetric_encryption_overhead() -> c_int { +pub unsafe extern "C" fn h_aes_symmetric_encryption_overhead() -> c_int { Block::::ENCRYPTION_OVERHEAD as c_int } diff --git a/src/interfaces/statics.rs b/src/interfaces/statics.rs index a40644cc..fb9470b3 100644 --- a/src/interfaces/statics.rs +++ b/src/interfaces/statics.rs @@ -375,7 +375,7 @@ mod tests { uid: hex::encode(metadata.uid), }; std::fs::write( - "non_regression_vector.json", + "target/non_regression_vector.json", serde_json::to_string(®_vectors).unwrap(), ) .unwrap();