Commit 7a6f3c8 1 parent cbcba8e commit 7a6f3c8 Copy full SHA for 7a6f3c8
File tree 4 files changed +32
-0
lines changed
4 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -253,6 +253,7 @@ include = [
253
253
" tests/rsa_pss_sign_tests.txt" ,
254
254
" tests/rsa_pss_verify_tests.txt" ,
255
255
" tests/rsa_tests.rs" ,
256
+ " tests/signature_tests.rs" ,
256
257
" third-party/NIST/README.md" ,
257
258
" third-party/NIST/sha256sums.txt" ,
258
259
" third-party/NIST/SHAVS/SHA1LongMsg.rsp" ,
Original file line number Diff line number Diff line change 18
18
use ec;
19
19
20
20
/// A public key signature returned from a signing operation.
21
+ #[ derive( Clone , Copy ) ]
21
22
pub struct Signature {
22
23
value : [ u8 ; MAX_LEN ] ,
23
24
len : usize ,
Original file line number Diff line number Diff line change @@ -126,6 +126,24 @@ use std::string::String;
126
126
use std:: vec:: Vec ;
127
127
use std:: io:: BufRead ;
128
128
129
+
130
+ /// `compile_time_assert_clone::<T>();` fails to compile if `T` doesn't
131
+ /// implement `Clone`.
132
+ pub fn compile_time_assert_clone < T : Clone > ( ) { }
133
+
134
+ /// `compile_time_assert_copy::<T>();` fails to compile if `T` doesn't
135
+ /// implement `Copy`.
136
+ pub fn compile_time_assert_copy < T : Copy > ( ) { }
137
+
138
+ /// `compile_time_assert_send::<T>();` fails to compile if `T` doesn't
139
+ /// implement `Send`.
140
+ pub fn compile_time_assert_send < T : Send > ( ) { }
141
+
142
+ /// `compile_time_assert_sync::<T>();` fails to compile if `T` doesn't
143
+ /// implement `Sync`.
144
+ pub fn compile_time_assert_sync < T : Sync > ( ) { }
145
+
146
+
129
147
/// A test case. A test case consists of a set of named attributes. Every
130
148
/// attribute in the test case must be consumed exactly once; this helps catch
131
149
/// typos and omissions.
Original file line number Diff line number Diff line change
1
+ extern crate ring;
2
+
3
+ use ring:: signature;
4
+ use ring:: test;
5
+
6
+ #[ test]
7
+ fn signature_impl_test ( ) {
8
+ test:: compile_time_assert_clone :: < signature:: Signature > ( ) ;
9
+ test:: compile_time_assert_copy :: < signature:: Signature > ( ) ;
10
+ test:: compile_time_assert_send :: < signature:: Signature > ( ) ;
11
+ test:: compile_time_assert_sync :: < signature:: Signature > ( ) ;
12
+ }
You can’t perform that action at this time.
0 commit comments