File tree 9 files changed +13
-27
lines changed
9 files changed +13
-27
lines changed Original file line number Diff line number Diff line change @@ -19,8 +19,8 @@ matrix:
19
19
- rust : nightly
20
20
fast_finish : true
21
21
include :
22
- - name : " Rust: 1.36 .0"
23
- rust : 1.36 .0
22
+ - name : " Rust: 1.37 .0"
23
+ rust : 1.37 .0
24
24
env : {} # clear `-D warnings` above; allow warnings
25
25
- name : " Rust: stable (thumbv7em-none-eabihf)"
26
26
rust : stable
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ security reviews.
21
21
| [ XSalsa20Poly1305] ( https://nacl.cr.yp.to/secretbox.html ) | [ ![ crates.io] ( https://img.shields.io/crates/v/xsalsa20poly1305.svg )] ( https://crates.io/crates/xsalsa20poly1305 ) | [ ![ Documentation] ( https://docs.rs/xsalsa20poly1305/badge.svg )] ( https://docs.rs/xsalsa20poly1305 ) |
22
22
23
23
### Minimum Supported Rust Version
24
- All crates in this repository support Rust 1.36 or higher. In future minimum
24
+ All crates in this repository support Rust 1.37 or higher. In future minimum
25
25
supported Rust version can be changed, but it will be done with the minor
26
26
version bump.
27
27
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ dual licensed as above, without any additional terms or conditions.
56
56
[ docs-image ] : https://docs.rs/aes-gcm-siv/badge.svg
57
57
[ docs-link ] : https://docs.rs/aes-gcm-siv/
58
58
[ license-image ] : https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg
59
- [ rustc-image ] : https://img.shields.io/badge/rustc-1.36 +-blue.svg
59
+ [ rustc-image ] : https://img.shields.io/badge/rustc-1.37 +-blue.svg
60
60
[ maintenance-image ] : https://img.shields.io/badge/maintenance-experimental-blue.svg
61
61
[ build-image ] : https://travis-ci.com/RustCrypto/AEADs.svg?branch=master
62
62
[ build-link ] : https://travis-ci.com/RustCrypto/AEADs
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ dual licensed as above, without any additional terms or conditions.
42
42
[ docs-image ] : https://docs.rs/aes-gcm/badge.svg
43
43
[ docs-link ] : https://docs.rs/aes-gcm/
44
44
[ license-image ] : https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg
45
- [ rustc-image ] : https://img.shields.io/badge/rustc-1.36 +-blue.svg
45
+ [ rustc-image ] : https://img.shields.io/badge/rustc-1.37 +-blue.svg
46
46
[ maintenance-image ] : https://img.shields.io/badge/maintenance-experimental-blue.svg
47
47
[ build-image ] : https://travis-ci.com/RustCrypto/AEADs.svg?branch=master
48
48
[ build-link ] : https://travis-ci.com/RustCrypto/AEADs
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ dual licensed as above, without any additional terms or conditions.
43
43
[ docs-image ] : https://docs.rs/aes-siv/badge.svg
44
44
[ docs-link ] : https://docs.rs/aes-siv/
45
45
[ license-image ] : https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg
46
- [ rustc-image ] : https://img.shields.io/badge/rustc-1.36 +-blue.svg
46
+ [ rustc-image ] : https://img.shields.io/badge/rustc-1.37 +-blue.svg
47
47
[ maintenance-image ] : https://img.shields.io/badge/maintenance-experimental-blue.svg
48
48
[ build-image ] : https://travis-ci.com/RustCrypto/AEADs.svg?branch=master
49
49
[ build-link ] : https://travis-ci.com/RustCrypto/AEADs
Original file line number Diff line number Diff line change @@ -127,10 +127,7 @@ where
127
127
buffer. extend_from_slice ( Tag :: default ( ) . as_slice ( ) ) ?;
128
128
129
129
// TODO(tarcieri): add offset param to `encrypt_in_place_detached`
130
- for i in ( 0 ..pt_len) . rev ( ) {
131
- let byte = buffer. as_ref ( ) [ i] ;
132
- buffer. as_mut ( ) [ i + IV_SIZE ] = byte;
133
- }
130
+ buffer. as_mut ( ) . copy_within ( ..pt_len, IV_SIZE ) ;
134
131
135
132
let tag = self . encrypt_in_place_detached ( headers, & mut buffer. as_mut ( ) [ IV_SIZE ..] ) ?;
136
133
buffer. as_mut ( ) [ ..IV_SIZE ] . copy_from_slice ( tag. as_slice ( ) ) ;
@@ -194,11 +191,7 @@ where
194
191
let pt_len = buffer. len ( ) - IV_SIZE ;
195
192
196
193
// TODO(tarcieri): add offset param to `encrypt_in_place_detached`
197
- for i in 0 ..pt_len {
198
- let byte = buffer. as_ref ( ) [ i + IV_SIZE ] ;
199
- buffer. as_mut ( ) [ i] = byte;
200
- }
201
-
194
+ buffer. as_mut ( ) . copy_within ( IV_SIZE .., 0 ) ;
202
195
buffer. truncate ( pt_len) ;
203
196
Ok ( ( ) )
204
197
}
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ dual licensed as above, without any additional terms or conditions.
46
46
[ docs-image ] : https://docs.rs/chacha20poly1305/badge.svg
47
47
[ docs-link ] : https://docs.rs/chacha20poly1305/
48
48
[ license-image ] : https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg
49
- [ rustc-image ] : https://img.shields.io/badge/rustc-1.36 +-blue.svg
49
+ [ rustc-image ] : https://img.shields.io/badge/rustc-1.37 +-blue.svg
50
50
[ maintenance-image ] : https://img.shields.io/badge/maintenance-experimental-blue.svg
51
51
[ build-image ] : https://travis-ci.com/RustCrypto/AEADs.svg?branch=master
52
52
[ build-link ] : https://travis-ci.com/RustCrypto/AEADs
Original file line number Diff line number Diff line change 7
7
![ Maintenance Status: Experimental] [ maintenance-image ]
8
8
[ ![ Build Status] [ build-image ]] [ build-link ]
9
9
10
- ** XSalsa20Poly1305** (a.k.a. NaCl ` crypto_secretbox ` [ 1] ) is an
10
+ ** XSalsa20Poly1305** (a.k.a. NaCl [ ` crypto_secretbox ` ] [ 1 ] ) is an
11
11
[ authenticated encryption] [ 2 ] cipher amenable to fast, constant-time
12
12
implementations in software, based on the [ Salsa20] [ 3 ] stream cipher
13
13
(with [ XSalsa20] [ 4 ] 192-bit nonce extension) and the [ Poly1305] [ 5 ] universal
@@ -49,7 +49,7 @@ dual licensed as above, without any additional terms or conditions.
49
49
[ docs-image ] : https://docs.rs/xsalsa20poly1305/badge.svg
50
50
[ docs-link ] : https://docs.rs/xsalsa20poly1305/
51
51
[ license-image ] : https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg
52
- [ rustc-image ] : https://img.shields.io/badge/rustc-1.36 +-blue.svg
52
+ [ rustc-image ] : https://img.shields.io/badge/rustc-1.37 +-blue.svg
53
53
[ maintenance-image ] : https://img.shields.io/badge/maintenance-experimental-blue.svg
54
54
[ build-image ] : https://travis-ci.com/RustCrypto/AEADs.svg?branch=master
55
55
[ build-link ] : https://travis-ci.com/RustCrypto/AEADs
Original file line number Diff line number Diff line change @@ -134,10 +134,7 @@ impl Aead for XSalsa20Poly1305 {
134
134
buffer. extend_from_slice ( Tag :: default ( ) . as_slice ( ) ) ?;
135
135
136
136
// TODO(tarcieri): add offset param to `encrypt_in_place_detached`
137
- for i in ( 0 ..pt_len) . rev ( ) {
138
- let byte = buffer. as_ref ( ) [ i] ;
139
- buffer. as_mut ( ) [ i + tag_len] = byte;
140
- }
137
+ buffer. as_mut ( ) . copy_within ( ..pt_len, tag_len) ;
141
138
142
139
let tag = self . encrypt_in_place_detached (
143
140
nonce,
@@ -181,11 +178,7 @@ impl Aead for XSalsa20Poly1305 {
181
178
let pt_len = buffer. len ( ) - tag_len;
182
179
183
180
// TODO(tarcieri): add offset param to `encrypt_in_place_detached`
184
- for i in 0 ..pt_len {
185
- let byte = buffer. as_ref ( ) [ i + tag_len] ;
186
- buffer. as_mut ( ) [ i] = byte;
187
- }
188
-
181
+ buffer. as_mut ( ) . copy_within ( tag_len.., 0 ) ;
189
182
buffer. truncate ( pt_len) ;
190
183
Ok ( ( ) )
191
184
}
You can’t perform that action at this time.
0 commit comments