Skip to content

Commit

Permalink
rust: Include documentation comments for type alias.
Browse files Browse the repository at this point in the history
Includes doc comments for auxiliary type alias
created for one-byte variables.

Extracted rust files are updated.
  • Loading branch information
armfazh authored and JasonGross committed Nov 13, 2023
1 parent d376b55 commit 445fd71
Show file tree
Hide file tree
Showing 27 changed files with 110 additions and 3 deletions.
4 changes: 4 additions & 0 deletions fiat-rust/src/curve25519_32.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions fiat-rust/src/curve25519_64.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions fiat-rust/src/curve25519_scalar_32.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions fiat-rust/src/curve25519_scalar_64.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions fiat-rust/src/curve25519_solinas_64.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions fiat-rust/src/p224_32.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions fiat-rust/src/p224_64.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions fiat-rust/src/p256_32.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions fiat-rust/src/p256_64.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions fiat-rust/src/p256_scalar_32.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions fiat-rust/src/p256_scalar_64.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions fiat-rust/src/p384_32.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions fiat-rust/src/p384_64.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions fiat-rust/src/p384_scalar_32.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions fiat-rust/src/p384_scalar_64.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions fiat-rust/src/p434_64.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions fiat-rust/src/p448_solinas_32.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions fiat-rust/src/p448_solinas_64.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions fiat-rust/src/p521_32.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions fiat-rust/src/p521_64.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions fiat-rust/src/poly1305_32.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions fiat-rust/src/poly1305_64.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions fiat-rust/src/secp256k1_montgomery_32.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions fiat-rust/src/secp256k1_montgomery_64.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions fiat-rust/src/secp256k1_montgomery_scalar_32.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions fiat-rust/src/secp256k1_montgomery_scalar_64.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions src/Stringification/Rust.v
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,12 @@ Module Rust.
""]%string
++ (List.flat_map
(fun bw
=> (if IntSet.mem (int.of_bitwidth false bw) bitwidths_used || IntSet.mem (int.of_bitwidth true bw) bitwidths_used
then [type_prefix ++ int_type_to_string internal_private prefix (int.of_bitwidth false bw) ++ " = u8;"; (* C: typedef unsigned char prefix_uint1 *)
type_prefix ++ int_type_to_string internal_private prefix (int.of_bitwidth true bw) ++ " = i8;" ]%string (* C: typedef signed char prefix_int1 *)
=> let type_suffix (b : bool) := (int.of_bitwidth b bw) in
let typedef_name (b : bool) := int_type_to_string internal_private prefix (type_suffix b) in
let type_comment (name : string) := String.concat String.NewLine (comment_block [( name ++ " represents values of " ++ show bw ++ " bits, stored in one byte.")%string]) in
(if IntSet.mem (type_suffix false) bitwidths_used || IntSet.mem (type_suffix true) bitwidths_used
then [type_comment (typedef_name false) ++ String.NewLine ++ type_prefix ++ (typedef_name false) ++ " = u8;"; (* C: typedef unsigned char prefix_uint1 *)
type_comment (typedef_name true ) ++ String.NewLine ++ type_prefix ++ (typedef_name true) ++ " = i8;"]%string (* C: typedef signed char prefix_int1 *)
else []))
[1; 2])
++ (if skip_typedefs
Expand Down

0 comments on commit 445fd71

Please sign in to comment.