Skip to content

Commit

Permalink
update to HACL* ae5d839c2e1fa95055b618cda60aeb1c486c720c
Browse files Browse the repository at this point in the history
  • Loading branch information
pnmadelaine committed Nov 17, 2023
1 parent 205f216 commit 4ae3551
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 37 deletions.
8 changes: 4 additions & 4 deletions include/Hacl_Hash_SHA2.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ extern "C" {
#include "Hacl_Streaming_Types.h"
#include "Hacl_Krmllib.h"

typedef Hacl_Streaming_MD_state_32 Hacl_Hash_SHA2_state_sha2_224;
typedef Hacl_Streaming_MD_state_32 Hacl_Hash_SHA2_state_t_224;

typedef Hacl_Streaming_MD_state_32 Hacl_Hash_SHA2_state_sha2_256;
typedef Hacl_Streaming_MD_state_32 Hacl_Hash_SHA2_state_t_256;

typedef Hacl_Streaming_MD_state_64 Hacl_Hash_SHA2_state_sha2_384;
typedef Hacl_Streaming_MD_state_64 Hacl_Hash_SHA2_state_t_384;

typedef Hacl_Streaming_MD_state_64 Hacl_Hash_SHA2_state_sha2_512;
typedef Hacl_Streaming_MD_state_64 Hacl_Hash_SHA2_state_t_512;

/**
Allocate initial state for the SHA2_256 hash. The state is to be freed by
Expand Down
8 changes: 4 additions & 4 deletions include/msvc/Hacl_Hash_SHA2.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ extern "C" {
#include "Hacl_Streaming_Types.h"
#include "Hacl_Krmllib.h"

typedef Hacl_Streaming_MD_state_32 Hacl_Hash_SHA2_state_sha2_224;
typedef Hacl_Streaming_MD_state_32 Hacl_Hash_SHA2_state_t_224;

typedef Hacl_Streaming_MD_state_32 Hacl_Hash_SHA2_state_sha2_256;
typedef Hacl_Streaming_MD_state_32 Hacl_Hash_SHA2_state_t_256;

typedef Hacl_Streaming_MD_state_64 Hacl_Hash_SHA2_state_sha2_384;
typedef Hacl_Streaming_MD_state_64 Hacl_Hash_SHA2_state_t_384;

typedef Hacl_Streaming_MD_state_64 Hacl_Hash_SHA2_state_sha2_512;
typedef Hacl_Streaming_MD_state_64 Hacl_Hash_SHA2_state_t_512;

/**
Allocate initial state for the SHA2_256 hash. The state is to be freed by
Expand Down
4 changes: 2 additions & 2 deletions info.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
The code was generated with the following toolchain.
F* version: f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f
F* version: 6e23042e74555544267731295b7d382c86edc574
Karamel version: a7be2a7c43eca637ceb57fe8f3ffd16fc6627ebd
HACL* version: 2706a814a711b62e5b0e271b2c3c8696a6239663
HACL* version: ae5d839c2e1fa95055b618cda60aeb1c486c720c
Vale version: 0.3.19
24 changes: 12 additions & 12 deletions ocaml/lib/Hacl_Hash_SHA2_bindings.ml
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,18 @@ module Bindings(F:Cstubs.FOREIGN) =
let hacl_Hash_SHA2_sha384_finish =
foreign "Hacl_Hash_SHA2_sha384_finish"
((ptr uint64_t) @-> (ocaml_bytes @-> (returning void)))
type hacl_Hash_SHA2_state_sha2_224 = hacl_Streaming_MD_state_32
let hacl_Hash_SHA2_state_sha2_224 =
typedef hacl_Streaming_MD_state_32 "Hacl_Hash_SHA2_state_sha2_224"
type hacl_Hash_SHA2_state_sha2_256 = hacl_Streaming_MD_state_32
let hacl_Hash_SHA2_state_sha2_256 =
typedef hacl_Streaming_MD_state_32 "Hacl_Hash_SHA2_state_sha2_256"
type hacl_Hash_SHA2_state_sha2_384 = hacl_Streaming_MD_state_64
let hacl_Hash_SHA2_state_sha2_384 =
typedef hacl_Streaming_MD_state_64 "Hacl_Hash_SHA2_state_sha2_384"
type hacl_Hash_SHA2_state_sha2_512 = hacl_Streaming_MD_state_64
let hacl_Hash_SHA2_state_sha2_512 =
typedef hacl_Streaming_MD_state_64 "Hacl_Hash_SHA2_state_sha2_512"
type hacl_Hash_SHA2_state_t_224 = hacl_Streaming_MD_state_32
let hacl_Hash_SHA2_state_t_224 =
typedef hacl_Streaming_MD_state_32 "Hacl_Hash_SHA2_state_t_224"
type hacl_Hash_SHA2_state_t_256 = hacl_Streaming_MD_state_32
let hacl_Hash_SHA2_state_t_256 =
typedef hacl_Streaming_MD_state_32 "Hacl_Hash_SHA2_state_t_256"
type hacl_Hash_SHA2_state_t_384 = hacl_Streaming_MD_state_64
let hacl_Hash_SHA2_state_t_384 =
typedef hacl_Streaming_MD_state_64 "Hacl_Hash_SHA2_state_t_384"
type hacl_Hash_SHA2_state_t_512 = hacl_Streaming_MD_state_64
let hacl_Hash_SHA2_state_t_512 =
typedef hacl_Streaming_MD_state_64 "Hacl_Hash_SHA2_state_t_512"
let hacl_Hash_SHA2_malloc_256 =
foreign "Hacl_Hash_SHA2_malloc_256"
(void @-> (returning (ptr hacl_Streaming_MD_state_32)))
Expand Down
8 changes: 4 additions & 4 deletions rust/hacl-sys/src/bindings/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,10 +460,10 @@ pub struct Hacl_Streaming_MD_state_64_s {
pub total_len: u64,
}
pub type Hacl_Streaming_MD_state_64 = Hacl_Streaming_MD_state_64_s;
pub type Hacl_Hash_SHA2_state_sha2_224 = Hacl_Streaming_MD_state_32;
pub type Hacl_Hash_SHA2_state_sha2_256 = Hacl_Streaming_MD_state_32;
pub type Hacl_Hash_SHA2_state_sha2_384 = Hacl_Streaming_MD_state_64;
pub type Hacl_Hash_SHA2_state_sha2_512 = Hacl_Streaming_MD_state_64;
pub type Hacl_Hash_SHA2_state_t_224 = Hacl_Streaming_MD_state_32;
pub type Hacl_Hash_SHA2_state_t_256 = Hacl_Streaming_MD_state_32;
pub type Hacl_Hash_SHA2_state_t_384 = Hacl_Streaming_MD_state_64;
pub type Hacl_Hash_SHA2_state_t_512 = Hacl_Streaming_MD_state_64;
extern "C" {
#[doc = "Allocate initial state for the SHA2_256 hash. The state is to be freed by\ncalling `free_256`."]
pub fn Hacl_Hash_SHA2_malloc_256() -> *mut Hacl_Streaming_MD_state_32;
Expand Down
10 changes: 5 additions & 5 deletions rust/src/hazmat/sha2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pub mod streaming {
Hacl_Hash_SHA2_free_384, Hacl_Hash_SHA2_free_512, Hacl_Hash_SHA2_malloc_224,
Hacl_Hash_SHA2_malloc_256, Hacl_Hash_SHA2_malloc_384, Hacl_Hash_SHA2_malloc_512,
Hacl_Hash_SHA2_reset_224, Hacl_Hash_SHA2_reset_256, Hacl_Hash_SHA2_reset_384,
Hacl_Hash_SHA2_reset_512, Hacl_Hash_SHA2_state_sha2_224, Hacl_Hash_SHA2_state_sha2_384,
Hacl_Hash_SHA2_reset_512, Hacl_Hash_SHA2_state_t_224, Hacl_Hash_SHA2_state_t_384,
Hacl_Hash_SHA2_update_224, Hacl_Hash_SHA2_update_256, Hacl_Hash_SHA2_update_384,
Hacl_Hash_SHA2_update_512,
};
Expand Down Expand Up @@ -126,7 +126,7 @@ pub mod streaming {
impl_streaming!(
Sha224,
28,
Hacl_Hash_SHA2_state_sha2_224,
Hacl_Hash_SHA2_state_t_224,
Hacl_Hash_SHA2_malloc_224,
Hacl_Hash_SHA2_reset_224,
Hacl_Hash_SHA2_update_224,
Expand All @@ -137,7 +137,7 @@ pub mod streaming {
impl_streaming!(
Sha256,
32,
Hacl_Hash_SHA2_state_sha2_224,
Hacl_Hash_SHA2_state_t_224,
Hacl_Hash_SHA2_malloc_256,
Hacl_Hash_SHA2_reset_256,
Hacl_Hash_SHA2_update_256,
Expand All @@ -148,7 +148,7 @@ pub mod streaming {
impl_streaming!(
Sha384,
48,
Hacl_Hash_SHA2_state_sha2_384,
Hacl_Hash_SHA2_state_t_384,
Hacl_Hash_SHA2_malloc_384,
Hacl_Hash_SHA2_reset_384,
Hacl_Hash_SHA2_update_384,
Expand All @@ -159,7 +159,7 @@ pub mod streaming {
impl_streaming!(
Sha512,
64,
Hacl_Hash_SHA2_state_sha2_384,
Hacl_Hash_SHA2_state_t_384,
Hacl_Hash_SHA2_malloc_512,
Hacl_Hash_SHA2_reset_512,
Hacl_Hash_SHA2_update_512,
Expand Down
2 changes: 1 addition & 1 deletion src/wasm/INFO.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This code was generated with the following toolchain.
F* version: f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f
F* version: 6e23042e74555544267731295b7d382c86edc574
Karamel version: a7be2a7c43eca637ceb57fe8f3ffd16fc6627ebd
Vale version: 0.3.19
10 changes: 5 additions & 5 deletions tests/sha2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ TEST(ApiSuite, ApiTest)
uint8_t digest_2[HACL_HASH_SHA2_256_DIGEST_LENGTH];

// Init
Hacl_Hash_SHA2_state_sha2_256* state =
Hacl_Hash_SHA2_state_t_256* state =
Hacl_Hash_SHA2_malloc_256();

// 1/2 Include `Hello, ` into the hash calculation and
Expand Down Expand Up @@ -175,7 +175,7 @@ TEST_P(Sha2KAT, TryKAT)

if (test.md.size() == 224 / 8) {
// Init
Hacl_Hash_SHA2_state_sha2_224* state =
Hacl_Hash_SHA2_state_t_224* state =
Hacl_Hash_SHA2_malloc_224();
Hacl_Hash_SHA2_reset_224(state);

Expand All @@ -189,7 +189,7 @@ TEST_P(Sha2KAT, TryKAT)
Hacl_Hash_SHA2_free_224(state);
} else if (test.md.size() == 256 / 8) {
// Init
Hacl_Hash_SHA2_state_sha2_224* state =
Hacl_Hash_SHA2_state_t_224* state =
Hacl_Hash_SHA2_malloc_256();
Hacl_Hash_SHA2_reset_256(state);

Expand All @@ -203,7 +203,7 @@ TEST_P(Sha2KAT, TryKAT)
Hacl_Hash_SHA2_free_256(state);
} else if (test.md.size() == 384 / 8) {
// Init
Hacl_Hash_SHA2_state_sha2_384* state =
Hacl_Hash_SHA2_state_t_384* state =
Hacl_Hash_SHA2_malloc_384();
Hacl_Hash_SHA2_reset_384(state);

Expand All @@ -217,7 +217,7 @@ TEST_P(Sha2KAT, TryKAT)
Hacl_Hash_SHA2_free_384(state);
} else if (test.md.size() == 512 / 8) {
// Init
Hacl_Hash_SHA2_state_sha2_512* state =
Hacl_Hash_SHA2_state_t_512* state =
Hacl_Hash_SHA2_malloc_512();
Hacl_Hash_SHA2_reset_512(state);

Expand Down

0 comments on commit 4ae3551

Please sign in to comment.