Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add contributting.json #88

Merged
merged 7 commits into from
Sep 4, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
machine:
pre:
- curl https://sh.rustup.rs -sSf | sh -s -- -y
environment:
PATH: $HOME/.cargo/bin:$PATH

test:
override:
- make all TASK=test
38 changes: 38 additions & 0 deletions contributting.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"commit": {
"cannot_be_fixup": true,

"subject_cannot_be_empty": true,
"subject_must_be_longer_than": 4,
"subject_must_be_shorter_than": 72,
"subject_must_be_single_line": true,
"subject_must_be_in_tense": "imperative",
"subject_must_start_with_case": "lower",
"subject_must_end_with_dot": false,
"subject_must_include_prefix": {
"prefixes": [
"feat", "fix", "docs", "style", "refactor", "perf", "test", "chore"
],
"require_after_prefix": "(*): "
},

"body_lines_must_be_shorter_than": 72
},

"pull_request": {
"subject_cannot_be_empty": true,
"subject_must_start_with_case": "upper",
"subject_must_not_end_with_dot": false,

"body_cannot_be_empty": true,
"body_must_close_github_issue": true
},

"issue": {
"subject_cannot_be_empty": true,
"subject_must_start_with_case": "upper",
"subject_must_not_end_with_dot": false,

"body_cannot_be_empty": true
}
}
4 changes: 2 additions & 2 deletions crypto/src/asymmetric/utils/primes/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub trait PrimeTest {

fn test_loop(&mut self, num: &BigUint, times: usize) -> Type {
for _ in 0..times {
if self.test(&num).is_composite() {
if self.test(num).is_composite() {
return Type::Composite;
}
}
Expand Down Expand Up @@ -88,7 +88,7 @@ impl<'a, T: Rng + 'a> MillerRabin<'a, T> {
impl<'a, T: Rng + 'a> PrimeTest for MillerRabin<'a, T> {
fn test(&mut self, num: &BigUint) -> Type {
let a = self.0.next_u64().to_biguint().unwrap();
let (s, d) = Self::greatest_2_divisor(&num);
let (s, d) = Self::greatest_2_divisor(num);

Self::witness(num, a, &d, s)
}
Expand Down
2 changes: 2 additions & 0 deletions crypto/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
#![doc(html_logo_url = "https://raw.githubusercontent.com/libOctavo/octavo/master/docs/logo.png",
html_root_url = "http://libOctavo.github.io/")]

#![allow(many_single_char_names)]

extern crate byteorder;
extern crate generic_array;
extern crate num_bigint as bigint;
Expand Down
10 changes: 5 additions & 5 deletions crypto/src/stream/chacha20.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ struct State([u32; STATE_WORDS]);

macro_rules! quarter_round {
($a:expr, $b:expr, $c:expr, $d:expr) => {{
$a = $a.wrapping_add($b); $d = $d ^ $a; $d = $d.rotate_left(16);
$c = $c.wrapping_add($d); $b = $b ^ $c; $b = $b.rotate_left(12);
$a = $a.wrapping_add($b); $d = $d ^ $a; $d = $d.rotate_left( 8);
$c = $c.wrapping_add($d); $b = $b ^ $c; $b = $b.rotate_left( 7);
$a = $a.wrapping_add($b); $d ^= $a; $d = $d.rotate_left(16);
$c = $c.wrapping_add($d); $b ^= $c; $b = $b.rotate_left(12);
$a = $a.wrapping_add($b); $d ^= $a; $d = $d.rotate_left( 8);
$c = $c.wrapping_add($d); $b ^= $c; $b = $b.rotate_left( 7);
}}
}

Expand Down Expand Up @@ -68,7 +68,7 @@ impl State {
output[i] = self.0[i].wrapping_add(state[i]);
}

self.0[12] = self.0[12] + 1;
self.0[12] += 1;
}
}

Expand Down