Skip to content

Commit

Permalink
Merge pull request #18 from franziskuskiefer/0.0.6
Browse files Browse the repository at this point in the history
0.0.6
  • Loading branch information
franziskuskiefer authored Dec 18, 2020
2 parents 79fffa7 + 6c731aa commit 8fccc70
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 14 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Deploy Docs

on:
push:
branches:
- master

jobs:
rustdoc:
runs-on: ubuntu-latest
steps:
- uses: hecrj/setup-rust-action@master
- uses: actions/checkout@v2
with:
submodules: true
- name: Build docs
run: |
cargo doc --all-features --no-deps
touch target/doc/.nojekyll
cat > target/doc/index.html <<EOF
<!doctype html>
<html><head>
<meta http-equiv="refresh" content="0; URL='evercrypt/index.html'" />
</head></html>
EOF
- name: Deploy to Github Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: target/doc
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ This workspace holds the [evercrypt-sys](evercrypt-sys/) and high-level [evercry

## Crates

| Name | Crates.io | Docs |
| :------------ | :-------------------------------------------------------------------------------------------------------- | :---: |
| evercrypt-sys | [![crates.io](https://img.shields.io/crates/v/evercrypt-sys.svg)](https://crates.io/crates/evercrypt-sys) | |
| evercrypt | [![crates.io](https://img.shields.io/crates/v/evercrypt.svg)](https://crates.io/crates/evercrypt) | |
| Name | Crates.io | Docs |
| :------------ | :-------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------: |
| evercrypt-sys | [![crates.io](https://img.shields.io/crates/v/evercrypt-sys.svg)](https://crates.io/crates/evercrypt-sys) | [![Docs](https://img.shields.io/badge/docs-master-blue.svg)](https://www.franziskuskiefer.de/evercrypt-rust/evercrypt_sys/index.html) |
| evercrypt | [![crates.io](https://img.shields.io/crates/v/evercrypt.svg)](https://crates.io/crates/evercrypt) | [![Docs](https://img.shields.io/badge/docs-master-blue.svg)](https://www.franziskuskiefer.de/evercrypt-rust/evercrypt/index.html) |

## Features
By default the Evercrypt crate includes the `random` feature that allows generating random values (keys, nonces, etc.).
Expand Down
6 changes: 3 additions & 3 deletions evercrypt-rs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "evercrypt"
version = "0.0.5"
version = "0.0.6"
authors = ["Franziskus Kiefer <[email protected]>"]
edition = "2018"
license = "MPL-2.0"
documentation = "https://docs.rs/evercrypt"
documentation = "https://www.franziskuskiefer.de/evercrypt"
description = "Crypto library using formally verified code from HACL/Evercrypt"
readme = "README.md"
repository = "https://github.com/franziskuskiefer/evercrypt-rust/"
Expand All @@ -22,7 +22,7 @@ random = ["rand", "rand_core"]
serialization = ["serde", "serde_json"]

[dependencies]
evercrypt-sys = { version = "0.0.5" }
evercrypt-sys = { version = "0.0.6" }
aes-gcm = { version = "0.8", optional = true }
rand = { version = "0.7", optional = true }
rand_core = { version = "0.5", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion evercrypt-rs/src/ecdh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ use crate::x25519;
pub enum Error {
InvalidPoint,
InvalidScalar,
UnkownAlgorithm,
UnknownAlgorithm,
}

/// ECDH algorithm.
Expand Down
2 changes: 1 addition & 1 deletion evercrypt-rs/src/signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::p256;
#[derive(Debug, PartialEq)]
pub enum Error {
InvalidPoint,
UnkownAlgorithm,
UnknownAlgorithm,
NonceMissing,
HashAlgorithmMissing,
InvalidSignature,
Expand Down
4 changes: 2 additions & 2 deletions evercrypt-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[package]
name = "evercrypt-sys"
version = "0.0.5"
version = "0.0.6"
authors = ["Franziskus Kiefer <[email protected]>"]
edition = "2018"
build = "build.rs"
categories = ["cryptography", "api-bindings"]
links = "evercrypt"
license = "MPL-2.0"
documentation = "https://docs.rs/evercrypt-sys"
documentation = "https://www.franziskuskiefer.de/evercrypt"
description = "FFI binding to HACL/Evercrypt"
readme = "README.md"
repository = "https://github.com/franziskuskiefer/evercrypt-rust/"
Expand Down
8 changes: 8 additions & 0 deletions evercrypt-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use std::{

#[cfg(windows)]
fn build_hacl(lib_dir: &Path, build_config: &BuildConfig) {
println!("Compiling hacl-star in {:?} with {:?}", lib_dir, build_config);
let mut build_status = Command::new("cmd");
build_status
.args(&["/C", lib_dir.join("hacl-build.bat").to_str().unwrap()])
Expand Down Expand Up @@ -80,6 +81,7 @@ fn copy_hacl_to_out(out_dir: &Path, hacl_src_dir: &Path) {
if !cp_status.success() {
panic!("Failed to copy hacl-star to out_dir.")
}
println!("Copied hacl-star to {:?}", out_dir);
let cp_status = Command::new("cp")
.arg("hacl-build.bat")
.arg(hacl_src_dir)
Expand All @@ -88,8 +90,10 @@ fn copy_hacl_to_out(out_dir: &Path, hacl_src_dir: &Path) {
if !cp_status.success() {
panic!("Failed to copy hacl-build.bat to out_dir.")
}
println!("Copied hacl-build.bat to {:?}", hacl_src_dir);
}

#[derive(Debug)]
struct BuildConfig {
hacl_src_dir: &'static str,
cross: bool,
Expand Down Expand Up @@ -299,6 +303,10 @@ fn main() {
let hacl_src_path = hacl_dir.join("dist").join(build_config.hacl_src_dir);
let hacl_src_path_str = hacl_src_path.to_str().unwrap();

println!("build_config: {:?}", build_config);
println!("out_path: {:?}", out_path);
println!("hacl_src_path: {:?}", hacl_src_path);

// Build hacl/evercrypt
// Always rebuild on windows for now. TODO: fix rebuild check on Windows.
if build_config.windows || rebuild(home_dir, &out_path) {
Expand Down
9 changes: 6 additions & 3 deletions evercrypt-sys/hacl-build.bat
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
echo off
@REM echo off
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -host_arch=amd64 -arch=amd64
@REM call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -test
cd %~dp0
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -test
ls
cd /d %~dp0
echo "pwd: " %~dp0
ls
cl *.c /I ../kremlin/include /I . /I ../kremlin/kremlib/dist/minimal /c || goto :error
for /F %%i in ('dir /b *-x86_64-msvc.asm') do (
ml64 /c %%i || goto :error
Expand Down

0 comments on commit 8fccc70

Please sign in to comment.