A whimsical STROBE based encryption protocol
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

NEKO v0.2.1 spec, 192 bit mode, const type asserts #4

open opened by sachy.dev targeting main from nekov0.2.1
Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:usjm3ynnir6y4inkcdovrfei/sh.tangled.repo.pull/3mkzgxag24m22
+16 -12
Interdiff #5 #6
.tangled/workflows/miri.yml

This file has not been changed.

src/handshake.rs

This file has not been changed.

src/lib.rs

This file has not been changed.

wharrgarbl-neko/SPEC.md

This file has not been changed.

wharrgarbl-neko/src/kats.rs

This file has not been changed.

+9 -3
wharrgarbl-neko/src/lib.rs
··· 121 121 122 122 #[inline(always)] 123 123 #[must_use] 124 - pub(crate) fn block(&self) -> usize { 124 + fn block(&self) -> usize { 125 125 let block = usize::from(self.raw_position()).div_ceil(U64_CHUNK); 126 126 debug_assert!(block <= Sec::BLOCK_RATE); 127 127 if block <= Sec::BLOCK_RATE { ··· 146 146 } 147 147 148 148 #[inline(always)] 149 - pub(crate) fn advance_position(&mut self, advance: usize) { 149 + fn advance_position(&mut self, advance: usize) { 150 150 let updated = self.position + advance; 151 151 assert!(updated <= Sec::POS_RATE); 152 152 self.position = updated; 153 - } 153 + } 154 + 155 + #[inline(always)] 156 + #[must_use] 157 + fn should_permute(&self) -> bool { 158 + self.raw_position() == Sec::POS_RATE as u8 159 + } 154 160 155 161 #[inline] 156 162 #[track_caller]
+7 -9
wharrgarbl-neko/src/operators.rs
··· 21 21 }; 22 22 23 23 while !self.data.is_empty() { 24 - let mut block = self.neko.block(); 25 - 26 - if block == S::BLOCK_RATE { 24 + if self.neko.should_permute() { 27 25 self.neko.permutation_p12(ops::CONT); 28 - block = 0; 29 26 } 30 27 28 + let block = self.neko.block(); 29 + 31 30 // Trans the neko 32 31 let transed_bytes = self.neko.state[block..S::BLOCK_RATE].as_mut_bytes(); 33 32 ··· 92 91 }; 93 92 94 93 while !self.data.is_empty() { 95 - let mut block = self.neko.block(); 96 - 97 - if block == S::BLOCK_RATE { 94 + if self.neko.should_permute() { 98 95 self.neko.permutation_p12(ops::CONT); 99 - block = 0; 100 96 } 101 97 98 + let block = self.neko.block(); 99 + 102 100 // Trans the neko 103 101 let transed_bytes = self.neko.state[block..S::BLOCK_RATE].as_mut_bytes(); 104 102 ··· 110 108 111 109 self.data = &self.data[advanced..]; 112 110 113 - self.neko.position += advanced; 111 + self.neko.advance_position(advanced); 114 112 } 115 113 } 116 114
wharrgarbl-neko/src/traits.rs

This file has not been changed.

History

7 rounds 0 comments
sign up or login to add to the discussion
sachy.dev submitted #6
1 commit
expand
NEKO v0.2.1 spec, 192 bit mode, const type asserts
merge conflicts detected
expand
  • src/handshake.rs:36
  • src/lib.rs:2
  • wharrgarbl-neko/SPEC.md:1
  • wharrgarbl-neko/src/kats.rs:1
  • wharrgarbl-neko/src/lib.rs:1
  • wharrgarbl-neko/src/operators.rs:1
  • wharrgarbl-neko/src/traits.rs:1
expand 0 comments
1 commit
expand
NEKO v0.2.1 spec, 192 bit mode, const type asserts
expand 0 comments
1 commit
expand
NEKO v0.2.1 spec, 192 bit mode, const type asserts
expand 0 comments
1 commit
expand
NEKO v0.2.1 spec, 192 bit mode, const type asserts
expand 0 comments
1 commit
expand
NEKO v0.2.1 spec, 192 bit mode, const type asserts
expand 0 comments
1 commit
expand
NEKO v0.2.1 spec, 192 bit mode, const type asserts
expand 0 comments
sachy.dev submitted #0
1 commit
expand
NEKO v0.2.1 spec, 192 bit mode, const type asserts
expand 0 comments