22// SPDX-License-Identifier: Apache-2.0
33
44mod test_hash_sequence {
5- use crate :: common:: create_ctx_without_session ;
5+ use crate :: common:: create_ctx_with_session ;
66 use std:: convert:: TryFrom ;
77 use tss_esapi:: {
88 interface_types:: { algorithm:: HashingAlgorithm , reserved_handles:: Hierarchy } ,
@@ -11,7 +11,7 @@ mod test_hash_sequence {
1111
1212 #[ test]
1313 fn test_hash_sequence_with_sha_256 ( ) {
14- let mut context = create_ctx_without_session ( ) ;
14+ let mut context = create_ctx_with_session ( ) ;
1515
1616 let data = "There is no spoon" ;
1717 let expected_hashed_data: [ u8 ; 32 ] = [
@@ -53,18 +53,15 @@ mod test_hash_sequence {
5353
5454 #[ test]
5555 fn test_hash_sequence_long ( ) {
56- let mut context = create_ctx_without_session ( ) ;
56+ let mut context = create_ctx_with_session ( ) ;
5757
58- let data = [ 0xEE ; 5000 ] ;
58+ let data = [ 0xEE ; 2 * 1025 ] ;
5959 let expected_hashed_data: [ u8 ; 32 ] = [
60- 32 , 190 , 228 , 96 , 206 , 94 , 17 , 15 , 13 , 7 , 50 , 27 , 254 , 139 , 228 , 145 , 230 , 210 , 2 , 119 ,
61- 69 , 16 , 252 , 245 , 236 , 126 , 214 , 6 , 171 , 196 , 33 , 212 ,
60+ 85 , 49 , 213 , 201 , 29 , 99 , 203 , 43 , 17 , 142 , 166 , 204 , 103 , 133 , 234 , 67 , 160 , 165 , 94 , 246 , 210 , 34 , 63 , 150 , 131 , 32 , 20 , 120 , 122 , 125 , 176 , 31
6261 ] ;
6362 let expected_hierarchy = Hierarchy :: Owner ;
6463 let expected_ticked_digest: [ u8 ; 48 ] = [
65- 68 , 142 , 177 , 202 , 238 , 232 , 144 , 173 , 86 , 148 , 226 , 71 , 166 , 84 , 27 , 61 , 119 , 133 ,
66- 122 , 230 , 74 , 81 , 149 , 43 , 193 , 102 , 99 , 147 , 2 , 173 , 120 , 64 , 69 , 76 , 62 , 12 , 231 , 6 ,
67- 98 , 78 , 169 , 120 , 132 , 199 , 37 , 190 , 157 , 156 ,
64+ 151 , 194 , 112 , 114 , 26 , 225 , 60 , 219 , 72 , 28 , 234 , 75 , 164 , 187 , 234 , 94 , 19 , 63 , 169 , 135 , 194 , 112 , 164 , 79 , 177 , 81 , 133 , 176 , 58 , 208 , 238 , 57 , 125 , 238 , 41 , 120 , 1 , 94 , 49 , 40 , 242 , 35 , 57 , 69 , 183 , 61 , 63 , 101
6865 ] ;
6966
7067 let handle = context
@@ -96,7 +93,7 @@ mod test_hash_sequence {
9693}
9794
9895mod test_hmac_sequence {
99- use crate :: common:: create_ctx_without_session ;
96+ use crate :: common:: create_ctx_with_session ;
10097 use tss_esapi:: {
10198 attributes:: ObjectAttributesBuilder ,
10299 interface_types:: {
@@ -110,7 +107,7 @@ mod test_hmac_sequence {
110107
111108 #[ test]
112109 fn test_hmac ( ) {
113- let mut context = create_ctx_without_session ( ) ;
110+ let mut context = create_ctx_with_session ( ) ;
114111
115112 let object_attributes = ObjectAttributesBuilder :: new ( )
116113 . with_sign_encrypt ( true )
0 commit comments