diff --git a/wharrgarbl-neko/src/lib.rs b/wharrgarbl-neko/src/lib.rs --- a/wharrgarbl-neko/src/lib.rs +++ b/wharrgarbl-neko/src/lib.rs @@ -258,7 +258,7 @@ /// /// **This is a PERMUTING operation** pub fn prf(&mut self, data: &mut [u8]) { - self.permutation_p12(ops::RST); + self.permutation_p12(ops::RESET); self.begin_op(ops::PRF); @@ -270,7 +270,7 @@ /// /// **This is a PERMUTING operation** pub fn create_mac(&mut self) -> NekoTag { - self.permutation_p12(ops::RST); + self.permutation_p12(ops::RESET); self.begin_op(ops::MAC); @@ -287,7 +287,7 @@ /// /// **This is a PERMUTING operation** pub fn verify_mac(&mut self, data: &NekoTag) -> aead::Result<()> { - self.permutation_p12(ops::RST); + self.permutation_p12(ops::RESET); self.begin_op(ops::MAC); @@ -311,9 +311,9 @@ /// /// **This is a PERMUTING operation** pub fn encrypt(&mut self, data: &mut [u8]) { - self.permutation_p12(ops::RST); + self.permutation_p12(ops::RESET); - self.begin_op(ops::ENC); + self.begin_op(ops::ENCRYPT); NekoOperateMut::absorb_and_set(self, data); } @@ -322,9 +322,9 @@ /// /// **This is a PERMUTING operation** pub fn decrypt(&mut self, data: &mut [u8]) { - self.permutation_p12(ops::RST); + self.permutation_p12(ops::RESET); - self.begin_op(ops::ENC); + self.begin_op(ops::ENCRYPT); NekoOperateMut::exchange(self, data); } @@ -335,7 +335,7 @@ /// /// **This is a NON-PERMUTING operation**. pub fn cleartext(&mut self, data: &[u8]) { - self.begin_op(ops::CLR); + self.begin_op(ops::CLEARTEXT); NekoOperate::absorb(self, data); } @@ -345,7 +345,7 @@ /// /// **This is a PERMUTING operation** pub fn ratchet(&mut self) { - self.permutation_p12(ops::RST); + self.permutation_p12(ops::RESET); self.begin_op(ops::RATCHET); diff --git a/wharrgarbl-neko/src/operators.rs b/wharrgarbl-neko/src/operators.rs --- a/wharrgarbl-neko/src/operators.rs +++ b/wharrgarbl-neko/src/operators.rs @@ -22,7 +22,7 @@ while !self.data.is_empty() { if self.neko.should_permute() { - self.neko.permutation_p12(ops::CONT); + self.neko.permutation_p12(ops::CONTINUE); } let block = self.neko.block(); @@ -92,7 +92,7 @@ while !self.data.is_empty() { if self.neko.should_permute() { - self.neko.permutation_p12(ops::CONT); + self.neko.permutation_p12(ops::CONTINUE); } let block = self.neko.block(); diff --git a/wharrgarbl-neko/src/ops.rs b/wharrgarbl-neko/src/ops.rs --- a/wharrgarbl-neko/src/ops.rs +++ b/wharrgarbl-neko/src/ops.rs @@ -4,8 +4,8 @@ // Internal State machine flags. These only get used during internal ops, and are // not invoked directly via user ops. -pub const RST: OpFlags = OpFlags::EMPTY; -pub const CONT: OpFlags = OpFlags::new(TRANSPORT.bits()); +pub const RESET: OpFlags = OpFlags::EMPTY; +pub const CONTINUE: OpFlags = OpFlags::new(TRANSPORT.bits()); // All User operations are defined below. All valid combinations must have either // two flags or three flags. 0, 1 or 4 flags toggled are INVALID for User operations @@ -14,9 +14,9 @@ // and should NEVER be used. If these are added, it will be for a new spec revision. // Message related ops, either for encrypting, MAC, or ingesting cleartext -pub const CLR: OpFlags = OpFlags::new(APP.bits() | TRANSPORT.bits()); +pub const CLEARTEXT: OpFlags = OpFlags::new(APP.bits() | TRANSPORT.bits()); pub const MAC: OpFlags = OpFlags::new(CIPHER.bits() | TRANSPORT.bits()); -pub const ENC: OpFlags = OpFlags::new(APP.bits() | CIPHER.bits() | TRANSPORT.bits()); +pub const ENCRYPT: OpFlags = OpFlags::new(APP.bits() | CIPHER.bits() | TRANSPORT.bits()); // Cipher related ops, either for init/loading keys/nonces/associated data, or for // cryptographic operations like ratchet for forward secrecy, or prf for expanding