Introduce enum structs to replicate TLS message format

This PR favors native coercions of enums to numerical types to help ser/de operations.
Small rearrangement of the serialization module.
This commit is contained in:
François Garillot
2020-11-02 20:15:02 -05:00
parent 344e8ad8d1
commit 9c06c98ad6
10 changed files with 432 additions and 387 deletions
+5 -8
View File
@@ -7,15 +7,12 @@
//! Field arithmetic modulo \\(p = 2\^{255} - 19\\), using \\(64\\)-bit
//! limbs with \\(128\\)-bit products.
use core::fmt::Debug;
use core::ops::Neg;
use core::ops::{Add, AddAssign};
use core::ops::{Mul, MulAssign};
use core::{
fmt::Debug,
ops::{Add, AddAssign, Mul, MulAssign, Neg},
};
use subtle::Choice;
use subtle::ConditionallyNegatable;
use subtle::ConditionallySelectable;
use subtle::ConstantTimeEq;
use subtle::{Choice, ConditionallyNegatable, ConditionallySelectable, ConstantTimeEq};
use zeroize::Zeroize;