1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
pub const YH_CONTEXT_LEN : :: std :: os :: raw :: c_uint = 16 ; pub const YH_HOST_CHAL_LEN : :: std :: os :: raw :: c_uint = 8 ; pub const YH_MSG_BUF_SIZE : :: std :: os :: raw :: c_uint = 2048 ; pub const YH_KEY_LEN : :: std :: os :: raw :: c_uint = 16 ; pub const YH_VID : :: std :: os :: raw :: c_uint = 4176 ; pub const YH_PID : :: std :: os :: raw :: c_uint = 48 ; pub const YH_CMD_RESP_FLAG : :: std :: os :: raw :: c_uint = 128 ; pub const YH_MAX_ITEMS_COUNT : :: std :: os :: raw :: c_uint = 256 ; pub const YH_MAX_SESSIONS : :: std :: os :: raw :: c_uint = 16 ; pub const YH_DEFAULT_ENC_KEY : [ u8 ; 17usize ] = [ 9u8 , 11u8 , 71u8 , 219u8 , 237u8 , 89u8 , 86u8 , 84u8 , 144u8 , 29u8 , 238u8 , 28u8 , 198u8 , 85u8 , 228u8 , 32u8 , 0u8 ] ; pub const YH_DEFAULT_MAC_KEY : [ u8 ; 17usize ] = [ 89u8 , 47u8 , 212u8 , 131u8 , 247u8 , 89u8 , 226u8 , 153u8 , 9u8 , 160u8 , 76u8 , 69u8 , 5u8 , 210u8 , 206u8 , 10u8 , 0u8 ] ; pub const YH_DEFAULT_PASSWORD : & 'static [ u8 ; 9usize ] = b"password\0" ; pub const YH_DEFAULT_SALT : & 'static [ u8 ; 7usize ] = b"Yubico\0" ; pub const YH_DEFAULT_ITERS : :: std :: os :: raw :: c_uint = 10000 ; pub const YH_CAPABILITIES_LEN : :: std :: os :: raw :: c_uint = 8 ; pub const YH_MAX_LOG_ENTRIES : :: std :: os :: raw :: c_uint = 64 ; pub const YH_OBJ_LABEL_LEN : :: std :: os :: raw :: c_uint = 40 ; pub const YH_MAX_DOMAINS : :: std :: os :: raw :: c_uint = 16 ; pub const YH_VERB_QUIET : :: std :: os :: raw :: c_uint = 0 ; pub const YH_VERB_INTERMEDIATE : :: std :: os :: raw :: c_uint = 1 ; pub const YH_VERB_CRYPTO : :: std :: os :: raw :: c_uint = 2 ; pub const YH_VERB_RAW : :: std :: os :: raw :: c_uint = 4 ; pub const YH_VERB_INFO : :: std :: os :: raw :: c_uint = 8 ; pub const YH_VERB_ERR : :: std :: os :: raw :: c_uint = 16 ; pub const YH_VERB_ALL : :: std :: os :: raw :: c_uint = 255 ; pub const YH_CCM_WRAP_OVERHEAD : :: std :: os :: raw :: c_uint = 30 ; pub const YH_MAX_ALGORITHM_COUNT : :: std :: os :: raw :: c_uint = 255 ; pub const YH_LOG_DIGEST_SIZE : :: std :: os :: raw :: c_uint = 16 ; pub const YH_ORIGIN_GENERATED : :: std :: os :: raw :: c_uint = 1 ; pub const YH_ORIGIN_IMPORTED : :: std :: os :: raw :: c_uint = 2 ; pub const YH_ORIGIN_IMPORTED_WRAPPED : :: std :: os :: raw :: c_uint = 16 ; pub type __off_t = :: std :: os :: raw :: c_long ; pub type __off64_t = :: std :: os :: raw :: c_long ; pub type FILE = _IO_FILE ; pub type _IO_lock_t = :: std :: os :: raw :: c_void ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct _IO_marker { pub _next : * mut _IO_marker , pub _sbuf : * mut _IO_FILE , pub _pos : :: std :: os :: raw :: c_int , } # [ test ] fn bindgen_test_layout__IO_marker ( ) { assert_eq ! ( :: std :: mem :: size_of :: < _IO_marker > ( ) , 24usize , concat ! ( "Size of: " , stringify ! ( _IO_marker ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < _IO_marker > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( _IO_marker ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < _IO_marker > ( ) ) ) . _next as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( _IO_marker ) , "::" , stringify ! ( _next ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < _IO_marker > ( ) ) ) . _sbuf as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( _IO_marker ) , "::" , stringify ! ( _sbuf ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < _IO_marker > ( ) ) ) . _pos as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( _IO_marker ) , "::" , stringify ! ( _pos ) ) ) ; } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct _IO_FILE { pub _flags : :: std :: os :: raw :: c_int , pub _IO_read_ptr : * mut :: std :: os :: raw :: c_char , pub _IO_read_end : * mut :: std :: os :: raw :: c_char , pub _IO_read_base : * mut :: std :: os :: raw :: c_char , pub _IO_write_base : * mut :: std :: os :: raw :: c_char , pub _IO_write_ptr : * mut :: std :: os :: raw :: c_char , pub _IO_write_end : * mut :: std :: os :: raw :: c_char , pub _IO_buf_base : * mut :: std :: os :: raw :: c_char , pub _IO_buf_end : * mut :: std :: os :: raw :: c_char , pub _IO_save_base : * mut :: std :: os :: raw :: c_char , pub _IO_backup_base : * mut :: std :: os :: raw :: c_char , pub _IO_save_end : * mut :: std :: os :: raw :: c_char , pub _markers : * mut _IO_marker , pub _chain : * mut _IO_FILE , pub _fileno : :: std :: os :: raw :: c_int , pub _flags2 : :: std :: os :: raw :: c_int , pub _old_offset : __off_t , pub _cur_column : :: std :: os :: raw :: c_ushort , pub _vtable_offset : :: std :: os :: raw :: c_schar , pub _shortbuf : [ :: std :: os :: raw :: c_char ; 1usize ] , pub _lock : * mut _IO_lock_t , pub _offset : __off64_t , pub __pad1 : * mut :: std :: os :: raw :: c_void , pub __pad2 : * mut :: std :: os :: raw :: c_void , pub __pad3 : * mut :: std :: os :: raw :: c_void , pub __pad4 : * mut :: std :: os :: raw :: c_void , pub __pad5 : usize , pub _mode : :: std :: os :: raw :: c_int , pub _unused2 : [ :: std :: os :: raw :: c_char ; 20usize ] , } # [ test ] fn bindgen_test_layout__IO_FILE ( ) { assert_eq ! ( :: std :: mem :: size_of :: < _IO_FILE > ( ) , 208usize , concat ! ( "Size of: " , stringify ! ( _IO_FILE ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < _IO_FILE > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( _IO_FILE ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < _IO_FILE > ( ) ) ) . _flags as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( _IO_FILE ) , "::" , stringify ! ( _flags ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < _IO_FILE > ( ) ) ) . _IO_read_ptr as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( _IO_FILE ) , "::" , stringify ! ( _IO_read_ptr ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < _IO_FILE > ( ) ) ) . _IO_read_end as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( _IO_FILE ) , "::" , stringify ! ( _IO_read_end ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < _IO_FILE > ( ) ) ) . _IO_read_base as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( _IO_FILE ) , "::" , stringify ! ( _IO_read_base ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < _IO_FILE > ( ) ) ) . _IO_write_base as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( _IO_FILE ) , "::" , stringify ! ( _IO_write_base ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < _IO_FILE > ( ) ) ) . _IO_write_ptr as * const _ as usize } , 40usize , concat ! ( "Offset of field: " , stringify ! ( _IO_FILE ) , "::" , stringify ! ( _IO_write_ptr ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < _IO_FILE > ( ) ) ) . _IO_write_end as * const _ as usize } , 48usize , concat ! ( "Offset of field: " , stringify ! ( _IO_FILE ) , "::" , stringify ! ( _IO_write_end ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < _IO_FILE > ( ) ) ) . _IO_buf_base as * const _ as usize } , 56usize , concat ! ( "Offset of field: " , stringify ! ( _IO_FILE ) , "::" , stringify ! ( _IO_buf_base ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < _IO_FILE > ( ) ) ) . _IO_buf_end as * const _ as usize } , 64usize , concat ! ( "Offset of field: " , stringify ! ( _IO_FILE ) , "::" , stringify ! ( _IO_buf_end ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < _IO_FILE > ( ) ) ) . _IO_save_base as * const _ as usize } , 72usize , concat ! ( "Offset of field: " , stringify ! ( _IO_FILE ) , "::" , stringify ! ( _IO_save_base ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < _IO_FILE > ( ) ) ) . _IO_backup_base as * const _ as usize } , 80usize , concat ! ( "Offset of field: " , stringify ! ( _IO_FILE ) , "::" , stringify ! ( _IO_backup_base ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < _IO_FILE > ( ) ) ) . _IO_save_end as * const _ as usize } , 88usize , concat ! ( "Offset of field: " , stringify ! ( _IO_FILE ) , "::" , stringify ! ( _IO_save_end ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < _IO_FILE > ( ) ) ) . _markers as * const _ as usize } , 96usize , concat ! ( "Offset of field: " , stringify ! ( _IO_FILE ) , "::" , stringify ! ( _markers ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < _IO_FILE > ( ) ) ) . _chain as * const _ as usize } , 104usize , concat ! ( "Offset of field: " , stringify ! ( _IO_FILE ) , "::" , stringify ! ( _chain ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < _IO_FILE > ( ) ) ) . _fileno as * const _ as usize } , 112usize , concat ! ( "Offset of field: " , stringify ! ( _IO_FILE ) , "::" , stringify ! ( _fileno ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < _IO_FILE > ( ) ) ) . _flags2 as * const _ as usize } , 116usize , concat ! ( "Offset of field: " , stringify ! ( _IO_FILE ) , "::" , stringify ! ( _flags2 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < _IO_FILE > ( ) ) ) . _old_offset as * const _ as usize } , 120usize , concat ! ( "Offset of field: " , stringify ! ( _IO_FILE ) , "::" , stringify ! ( _old_offset ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < _IO_FILE > ( ) ) ) . _cur_column as * const _ as usize } , 124usize , concat ! ( "Offset of field: " , stringify ! ( _IO_FILE ) , "::" , stringify ! ( _cur_column ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < _IO_FILE > ( ) ) ) . _vtable_offset as * const _ as usize } , 126usize , concat ! ( "Offset of field: " , stringify ! ( _IO_FILE ) , "::" , stringify ! ( _vtable_offset ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < _IO_FILE > ( ) ) ) . _shortbuf as * const _ as usize } , 127usize , concat ! ( "Offset of field: " , stringify ! ( _IO_FILE ) , "::" , stringify ! ( _shortbuf ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < _IO_FILE > ( ) ) ) . _lock as * const _ as usize } , 128usize , concat ! ( "Offset of field: " , stringify ! ( _IO_FILE ) , "::" , stringify ! ( _lock ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < _IO_FILE > ( ) ) ) . _offset as * const _ as usize } , 136usize , concat ! ( "Offset of field: " , stringify ! ( _IO_FILE ) , "::" , stringify ! ( _offset ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < _IO_FILE > ( ) ) ) . __pad1 as * const _ as usize } , 144usize , concat ! ( "Offset of field: " , stringify ! ( _IO_FILE ) , "::" , stringify ! ( __pad1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < _IO_FILE > ( ) ) ) . __pad2 as * const _ as usize } , 152usize , concat ! ( "Offset of field: " , stringify ! ( _IO_FILE ) , "::" , stringify ! ( __pad2 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < _IO_FILE > ( ) ) ) . __pad3 as * const _ as usize } , 160usize , concat ! ( "Offset of field: " , stringify ! ( _IO_FILE ) , "::" , stringify ! ( __pad3 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < _IO_FILE > ( ) ) ) . __pad4 as * const _ as usize } , 168usize , concat ! ( "Offset of field: " , stringify ! ( _IO_FILE ) , "::" , stringify ! ( __pad4 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < _IO_FILE > ( ) ) ) . __pad5 as * const _ as usize } , 176usize , concat ! ( "Offset of field: " , stringify ! ( _IO_FILE ) , "::" , stringify ! ( __pad5 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < _IO_FILE > ( ) ) ) . _mode as * const _ as usize } , 184usize , concat ! ( "Offset of field: " , stringify ! ( _IO_FILE ) , "::" , stringify ! ( _mode ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < _IO_FILE > ( ) ) ) . _unused2 as * const _ as usize } , 188usize , concat ! ( "Offset of field: " , stringify ! ( _IO_FILE ) , "::" , stringify ! ( _unused2 ) ) ) ; } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct yh_connector { _unused : [ u8 ; 0 ] } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct yh_session { _unused : [ u8 ; 0 ] }
# [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct yh_capabilities {
pub capabilities : [ u8 ; 8usize ] , } # [ test ] fn bindgen_test_layout_yh_capabilities ( ) { assert_eq ! ( :: std :: mem :: size_of :: < yh_capabilities > ( ) , 8usize , concat ! ( "Size of: " , stringify ! ( yh_capabilities ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < yh_capabilities > ( ) , 1usize , concat ! ( "Alignment of " , stringify ! ( yh_capabilities ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < yh_capabilities > ( ) ) ) . capabilities as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( yh_capabilities ) , "::" , stringify ! ( capabilities ) ) ) ; } pub const yh_rc_YHR_SUCCESS : yh_rc = 0 ; pub const yh_rc_YHR_MEMORY : yh_rc = -1 ; pub const yh_rc_YHR_INIT_ERROR : yh_rc = -2 ; pub const yh_rc_YHR_NET_ERROR : yh_rc = -3 ; pub const yh_rc_YHR_CONNECTOR_NOT_FOUND : yh_rc = -4 ; pub const yh_rc_YHR_INVALID_PARAMS : yh_rc = -5 ; pub const yh_rc_YHR_WRONG_LENGTH : yh_rc = -6 ; pub const yh_rc_YHR_BUFFER_TOO_SMALL : yh_rc = -7 ; pub const yh_rc_YHR_CRYPTOGRAM_MISMATCH : yh_rc = -8 ; pub const yh_rc_YHR_AUTH_SESSION_ERROR : yh_rc = -9 ; pub const yh_rc_YHR_MAC_MISMATCH : yh_rc = -10 ; pub const yh_rc_YHR_DEVICE_OK : yh_rc = -11 ; pub const yh_rc_YHR_DEVICE_INV_COMMAND : yh_rc = -12 ; pub const yh_rc_YHR_DEVICE_INV_DATA : yh_rc = -13 ; pub const yh_rc_YHR_DEVICE_INV_SESSION : yh_rc = -14 ; pub const yh_rc_YHR_DEVICE_AUTH_FAIL : yh_rc = -15 ; pub const yh_rc_YHR_DEVICE_SESSIONS_FULL : yh_rc = -16 ; pub const yh_rc_YHR_DEVICE_SESSION_FAILED : yh_rc = -17 ; pub const yh_rc_YHR_DEVICE_STORAGE_FAILED : yh_rc = -18 ; pub const yh_rc_YHR_DEVICE_WRONG_LENGTH : yh_rc = -19 ; pub const yh_rc_YHR_DEVICE_INV_PERMISSION : yh_rc = -20 ; pub const yh_rc_YHR_DEVICE_LOG_FULL : yh_rc = -21 ; pub const yh_rc_YHR_DEVICE_OBJ_NOT_FOUND : yh_rc = -22 ; pub const yh_rc_YHR_DEVICE_ID_ILLEGAL : yh_rc = -23 ; pub const yh_rc_YHR_DEVICE_INVALID_OTP : yh_rc = -24 ; pub const yh_rc_YHR_DEVICE_DEMO_MODE : yh_rc = -25 ; pub const yh_rc_YHR_DEVICE_CMD_UNEXECUTED : yh_rc = -26 ; pub const yh_rc_YHR_GENERIC_ERROR : yh_rc = -27 ; pub const yh_rc_YHR_DEVICE_OBJECT_EXISTS : yh_rc = -28 ; pub const yh_rc_YHR_CONNECTOR_ERROR : yh_rc = -29 ; pub type yh_rc = i32 ; pub const yh_cmd_YHC_ECHO : yh_cmd = 1 ; pub const yh_cmd_YHC_ECHO_R : yh_cmd = 129 ; pub const yh_cmd_YHC_CREATE_SES : yh_cmd = 3 ; pub const yh_cmd_YHC_CREATE_SES_R : yh_cmd = 131 ; pub const yh_cmd_YHC_AUTH_SES : yh_cmd = 4 ; pub const yh_cmd_YHC_AUTH_SES_R : yh_cmd = 132 ; pub const yh_cmd_YHC_SES_MSG : yh_cmd = 5 ; pub const yh_cmd_YHC_SES_MSG_R : yh_cmd = 133 ; pub const yh_cmd_YHC_GET_DEVICE_INFO : yh_cmd = 6 ; pub const yh_cmd_YHC_GET_DEVICE_INFO_R : yh_cmd = 134 ; pub const yh_cmd_YHC_BSL : yh_cmd = 7 ; pub const yh_cmd_YHC_BSL_R : yh_cmd = 135 ; pub const yh_cmd_YHC_RESET : yh_cmd = 8 ; pub const yh_cmd_YHC_RESET_R : yh_cmd = 136 ; pub const yh_cmd_YHC_CLOSE_SES : yh_cmd = 64 ; pub const yh_cmd_YHC_CLOSE_SES_R : yh_cmd = 192 ; pub const yh_cmd_YHC_STATS : yh_cmd = 65 ; pub const yh_cmd_YHC_STATS_R : yh_cmd = 193 ; pub const yh_cmd_YHC_PUT_OPAQUE : yh_cmd = 66 ; pub const yh_cmd_YHC_PUT_OPAQUE_R : yh_cmd = 194 ; pub const yh_cmd_YHC_GET_OPAQUE : yh_cmd = 67 ; pub const yh_cmd_YHC_GET_OPAQUE_R : yh_cmd = 195 ; pub const yh_cmd_YHC_PUT_AUTHKEY : yh_cmd = 68 ; pub const yh_cmd_YHC_PUT_AUTHKEY_R : yh_cmd = 196 ; pub const yh_cmd_YHC_PUT_ASYMMETRIC_KEY : yh_cmd = 69 ; pub const yh_cmd_YHC_PUT_ASYMMETRIC_KEY_R : yh_cmd = 197 ; pub const yh_cmd_YHC_GEN_ASYMMETRIC_KEY : yh_cmd = 70 ; pub const yh_cmd_YHC_GEN_ASYMMETRIC_KEY_R : yh_cmd = 198 ; pub const yh_cmd_YHC_SIGN_DATA_PKCS1 : yh_cmd = 71 ; pub const yh_cmd_YHC_SIGN_DATA_PKCS1_R : yh_cmd = 199 ; pub const yh_cmd_YHC_LIST : yh_cmd = 72 ; pub const yh_cmd_YHC_LIST_R : yh_cmd = 200 ; pub const yh_cmd_YHC_DECRYPT_PKCS1 : yh_cmd = 73 ; pub const yh_cmd_YHC_DECRYPT_PKCS1_R : yh_cmd = 201 ; pub const yh_cmd_YHC_EXPORT_WRAPPED : yh_cmd = 74 ; pub const yh_cmd_YHC_EXPORT_WRAPPED_R : yh_cmd = 202 ; pub const yh_cmd_YHC_IMPORT_WRAPPED : yh_cmd = 75 ; pub const yh_cmd_YHC_IMPORT_WRAPPED_R : yh_cmd = 203 ; pub const yh_cmd_YHC_PUT_WRAP_KEY : yh_cmd = 76 ; pub const yh_cmd_YHC_PUT_WRAP_KEY_R : yh_cmd = 204 ; pub const yh_cmd_YHC_GET_LOGS : yh_cmd = 77 ; pub const yh_cmd_YHC_GET_LOGS_R : yh_cmd = 205 ; pub const yh_cmd_YHC_GET_OBJECT_INFO : yh_cmd = 78 ; pub const yh_cmd_YHC_GET_OBJECT_INFO_R : yh_cmd = 206 ; pub const yh_cmd_YHC_PUT_OPTION : yh_cmd = 79 ; pub const yh_cmd_YHC_PUT_OPTION_R : yh_cmd = 207 ; pub const yh_cmd_YHC_GET_OPTION : yh_cmd = 80 ; pub const yh_cmd_YHC_GET_OPTION_R : yh_cmd = 208 ; pub const yh_cmd_YHC_GET_PSEUDO_RANDOM : yh_cmd = 81 ; pub const yh_cmd_YHC_GET_PSEUDO_RANDOM_R : yh_cmd = 209 ; pub const yh_cmd_YHC_PUT_HMAC_KEY : yh_cmd = 82 ; pub const yh_cmd_YHC_PUT_HMAC_KEY_R : yh_cmd = 210 ; pub const yh_cmd_YHC_HMAC_DATA : yh_cmd = 83 ; pub const yh_cmd_YHC_HMAC_DATA_R : yh_cmd = 211 ; pub const yh_cmd_YHC_GET_PUBKEY : yh_cmd = 84 ; pub const yh_cmd_YHC_GET_PUBKEY_R : yh_cmd = 212 ; pub const yh_cmd_YHC_SIGN_DATA_PSS : yh_cmd = 85 ; pub const yh_cmd_YHC_SIGN_DATA_PSS_R : yh_cmd = 213 ; pub const yh_cmd_YHC_SIGN_DATA_ECDSA : yh_cmd = 86 ; pub const yh_cmd_YHC_SIGN_DATA_ECDSA_R : yh_cmd = 214 ; pub const yh_cmd_YHC_DECRYPT_ECDH : yh_cmd = 87 ; pub const yh_cmd_YHC_DECRYPT_ECDH_R : yh_cmd = 215 ; pub const yh_cmd_YHC_DELETE_OBJECT : yh_cmd = 88 ; pub const yh_cmd_YHC_DELETE_OBJECT_R : yh_cmd = 216 ; pub const yh_cmd_YHC_DECRYPT_OAEP : yh_cmd = 89 ; pub const yh_cmd_YHC_DECRYPT_OAEP_R : yh_cmd = 217 ; pub const yh_cmd_YHC_GENERATE_HMAC_KEY : yh_cmd = 90 ; pub const yh_cmd_YHC_GENERATE_HMAC_KEY_R : yh_cmd = 218 ; pub const yh_cmd_YHC_GENERATE_WRAP_KEY : yh_cmd = 91 ; pub const yh_cmd_YHC_GENERATE_WRAP_KEY_R : yh_cmd = 219 ; pub const yh_cmd_YHC_VERIFY_HMAC : yh_cmd = 92 ; pub const yh_cmd_YHC_VERIFY_HMAC_R : yh_cmd = 220 ; pub const yh_cmd_YHC_SSH_CERTIFY : yh_cmd = 93 ; pub const yh_cmd_YHC_SSH_CERTIFY_R : yh_cmd = 221 ; pub const yh_cmd_YHC_PUT_TEMPLATE : yh_cmd = 94 ; pub const yh_cmd_YHC_PUT_TEMPLATE_R : yh_cmd = 222 ; pub const yh_cmd_YHC_GET_TEMPLATE : yh_cmd = 95 ; pub const yh_cmd_YHC_GET_TEMPLATE_R : yh_cmd = 223 ; pub const yh_cmd_YHC_OTP_DECRYPT : yh_cmd = 96 ; pub const yh_cmd_YHC_OTP_DECRYPT_R : yh_cmd = 224 ; pub const yh_cmd_YHC_OTP_AEAD_CREATE : yh_cmd = 97 ; pub const yh_cmd_YHC_OTP_AEAD_CREATE_R : yh_cmd = 225 ; pub const yh_cmd_YHC_OTP_AEAD_RANDOM : yh_cmd = 98 ; pub const yh_cmd_YHC_OTP_AEAD_RANDOM_R : yh_cmd = 226 ; pub const yh_cmd_YHC_OTP_AEAD_REWRAP : yh_cmd = 99 ; pub const yh_cmd_YHC_OTP_AEAD_REWRAP_R : yh_cmd = 227 ; pub const yh_cmd_YHC_ATTEST_ASYMMETRIC : yh_cmd = 100 ; pub const yh_cmd_YHC_ATTEST_ASYMMETRIC_R : yh_cmd = 228 ; pub const yh_cmd_YHC_PUT_OTP_AEAD_KEY : yh_cmd = 101 ; pub const yh_cmd_YHC_PUT_OTP_AEAD_KEY_R : yh_cmd = 229 ; pub const yh_cmd_YHC_GENERATE_OTP_AEAD_KEY : yh_cmd = 102 ; pub const yh_cmd_YHC_GENERATE_OTP_AEAD_KEY_R : yh_cmd = 230 ; pub const yh_cmd_YHC_SET_LOG_INDEX : yh_cmd = 103 ; pub const yh_cmd_YHC_SET_LOG_INDEX_R : yh_cmd = 231 ; pub const yh_cmd_YHC_WRAP_DATA : yh_cmd = 104 ; pub const yh_cmd_YHC_WRAP_DATA_R : yh_cmd = 232 ; pub const yh_cmd_YHC_UNWRAP_DATA : yh_cmd = 105 ; pub const yh_cmd_YHC_UNWRAP_DATA_R : yh_cmd = 233 ; pub const yh_cmd_YHC_SIGN_DATA_EDDSA : yh_cmd = 106 ; pub const yh_cmd_YHC_SIGN_DATA_EDDSA_R : yh_cmd = 234 ; pub const yh_cmd_YHC_BLINK : yh_cmd = 107 ; pub const yh_cmd_YHC_BLINK_R : yh_cmd = 235 ; pub const yh_cmd_YHC_ERROR : yh_cmd = 127 ; pub type yh_cmd = i32 ; pub const yh_object_type_YH_OPAQUE : yh_object_type = 1 ; pub const yh_object_type_YH_AUTHKEY : yh_object_type = 2 ; pub const yh_object_type_YH_ASYMMETRIC : yh_object_type = 3 ; pub const yh_object_type_YH_WRAPKEY : yh_object_type = 4 ; pub const yh_object_type_YH_HMACKEY : yh_object_type = 5 ; pub const yh_object_type_YH_TEMPLATE : yh_object_type = 6 ; pub const yh_object_type_YH_OTP_AEAD_KEY : yh_object_type = 7 ; pub const yh_object_type_YH_PUBLIC : yh_object_type = 131 ; pub type yh_object_type = i32 ; pub const yh_algorithm_YH_ALGO_RSA_PKCS1_SHA1 : yh_algorithm = 1 ; pub const yh_algorithm_YH_ALGO_RSA_PKCS1_SHA256 : yh_algorithm = 2 ; pub const yh_algorithm_YH_ALGO_RSA_PKCS1_SHA384 : yh_algorithm = 3 ; pub const yh_algorithm_YH_ALGO_RSA_PKCS1_SHA512 : yh_algorithm = 4 ; pub const yh_algorithm_YH_ALGO_RSA_PSS_SHA1 : yh_algorithm = 5 ; pub const yh_algorithm_YH_ALGO_RSA_PSS_SHA256 : yh_algorithm = 6 ; pub const yh_algorithm_YH_ALGO_RSA_PSS_SHA384 : yh_algorithm = 7 ; pub const yh_algorithm_YH_ALGO_RSA_PSS_SHA512 : yh_algorithm = 8 ; pub const yh_algorithm_YH_ALGO_RSA_2048 : yh_algorithm = 9 ; pub const yh_algorithm_YH_ALGO_RSA_3072 : yh_algorithm = 10 ; pub const yh_algorithm_YH_ALGO_RSA_4096 : yh_algorithm = 11 ; pub const yh_algorithm_YH_ALGO_EC_P256 : yh_algorithm = 12 ; pub const yh_algorithm_YH_ALGO_EC_P384 : yh_algorithm = 13 ; pub const yh_algorithm_YH_ALGO_EC_P521 : yh_algorithm = 14 ; pub const yh_algorithm_YH_ALGO_EC_K256 : yh_algorithm = 15 ; pub const yh_algorithm_YH_ALGO_EC_BP256 : yh_algorithm = 16 ; pub const yh_algorithm_YH_ALGO_EC_BP384 : yh_algorithm = 17 ; pub const yh_algorithm_YH_ALGO_EC_BP512 : yh_algorithm = 18 ; pub const yh_algorithm_YH_ALGO_HMAC_SHA1 : yh_algorithm = 19 ; pub const yh_algorithm_YH_ALGO_HMAC_SHA256 : yh_algorithm = 20 ; pub const yh_algorithm_YH_ALGO_HMAC_SHA384 : yh_algorithm = 21 ; pub const yh_algorithm_YH_ALGO_HMAC_SHA512 : yh_algorithm = 22 ; pub const yh_algorithm_YH_ALGO_EC_ECDSA_SHA1 : yh_algorithm = 23 ; pub const yh_algorithm_YH_ALGO_EC_ECDH : yh_algorithm = 24 ; pub const yh_algorithm_YH_ALGO_RSA_OAEP_SHA1 : yh_algorithm = 25 ; pub const yh_algorithm_YH_ALGO_RSA_OAEP_SHA256 : yh_algorithm = 26 ; pub const yh_algorithm_YH_ALGO_RSA_OAEP_SHA384 : yh_algorithm = 27 ; pub const yh_algorithm_YH_ALGO_RSA_OAEP_SHA512 : yh_algorithm = 28 ; pub const yh_algorithm_YH_ALGO_AES128_CCM_WRAP : yh_algorithm = 29 ; pub const yh_algorithm_YH_ALGO_OPAQUE_DATA : yh_algorithm = 30 ; pub const yh_algorithm_YH_ALGO_OPAQUE_X509_CERT : yh_algorithm = 31 ; pub const yh_algorithm_YH_ALGO_MGF1_SHA1 : yh_algorithm = 32 ; pub const yh_algorithm_YH_ALGO_MGF1_SHA256 : yh_algorithm = 33 ; pub const yh_algorithm_YH_ALGO_MGF1_SHA384 : yh_algorithm = 34 ; pub const yh_algorithm_YH_ALGO_MGF1_SHA512 : yh_algorithm = 35 ; pub const yh_algorithm_YH_ALGO_TEMPL_SSH : yh_algorithm = 36 ; pub const yh_algorithm_YH_ALGO_YUBICO_OTP_AES128 : yh_algorithm = 37 ; pub const yh_algorithm_YH_ALGO_YUBICO_AES_AUTH : yh_algorithm = 38 ; pub const yh_algorithm_YH_ALGO_YUBICO_OTP_AES192 : yh_algorithm = 39 ; pub const yh_algorithm_YH_ALGO_YUBICO_OTP_AES256 : yh_algorithm = 40 ; pub const yh_algorithm_YH_ALGO_AES192_CCM_WRAP : yh_algorithm = 41 ; pub const yh_algorithm_YH_ALGO_AES256_CCM_WRAP : yh_algorithm = 42 ; pub const yh_algorithm_YH_ALGO_EC_ECDSA_SHA256 : yh_algorithm = 43 ; pub const yh_algorithm_YH_ALGO_EC_ECDSA_SHA384 : yh_algorithm = 44 ; pub const yh_algorithm_YH_ALGO_EC_ECDSA_SHA512 : yh_algorithm = 45 ; pub const yh_algorithm_YH_ALGO_EC_ED25519 : yh_algorithm = 46 ; pub const yh_algorithm_YH_ALGO_EC_P224 : yh_algorithm = 47 ; pub type yh_algorithm = i32 ; pub const yh_option_YH_OPTION_FORCE_AUDIT : yh_option = 1 ; pub const yh_option_YH_OPTION_COMMAND_AUDIT : yh_option = 3 ; pub type yh_option = i32 ; pub const yh_connector_option_YH_CONNECTOR_HTTPS_CA : yh_connector_option = 1 ; pub const yh_connector_option_YH_CONNECTOR_PROXY_SERVER : yh_connector_option = 2 ; pub type yh_connector_option = i32 ;
# [ repr ( C , packed ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct yh_log_entry {
pub number : u16 ,
pub command : u8 ,
pub length : u16 ,
pub session_key : u16 ,
pub target_key : u16 ,
pub second_key : u16 ,
pub result : u8 ,
pub systick : u32 ,
pub digest : [ u8 ; 16usize ] , } # [ test ] fn bindgen_test_layout_yh_log_entry ( ) { assert_eq ! ( :: std :: mem :: size_of :: < yh_log_entry > ( ) , 32usize , concat ! ( "Size of: " , stringify ! ( yh_log_entry ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < yh_log_entry > ( ) , 1usize , concat ! ( "Alignment of " , stringify ! ( yh_log_entry ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < yh_log_entry > ( ) ) ) . number as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( yh_log_entry ) , "::" , stringify ! ( number ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < yh_log_entry > ( ) ) ) . command as * const _ as usize } , 2usize , concat ! ( "Offset of field: " , stringify ! ( yh_log_entry ) , "::" , stringify ! ( command ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < yh_log_entry > ( ) ) ) . length as * const _ as usize } , 3usize , concat ! ( "Offset of field: " , stringify ! ( yh_log_entry ) , "::" , stringify ! ( length ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < yh_log_entry > ( ) ) ) . session_key as * const _ as usize } , 5usize , concat ! ( "Offset of field: " , stringify ! ( yh_log_entry ) , "::" , stringify ! ( session_key ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < yh_log_entry > ( ) ) ) . target_key as * const _ as usize } , 7usize , concat ! ( "Offset of field: " , stringify ! ( yh_log_entry ) , "::" , stringify ! ( target_key ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < yh_log_entry > ( ) ) ) . second_key as * const _ as usize } , 9usize , concat ! ( "Offset of field: " , stringify ! ( yh_log_entry ) , "::" , stringify ! ( second_key ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < yh_log_entry > ( ) ) ) . result as * const _ as usize } , 11usize , concat ! ( "Offset of field: " , stringify ! ( yh_log_entry ) , "::" , stringify ! ( result ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < yh_log_entry > ( ) ) ) . systick as * const _ as usize } , 12usize , concat ! ( "Offset of field: " , stringify ! ( yh_log_entry ) , "::" , stringify ! ( systick ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < yh_log_entry > ( ) ) ) . digest as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( yh_log_entry ) , "::" , stringify ! ( digest ) ) ) ; }
# [ repr ( C , packed ) ] # [ derive ( Copy , Clone ) ] pub struct yh_object_descriptor {
pub capabilities : yh_capabilities ,
pub id : u16 ,
pub len : u16 ,
pub domains : u16 ,
pub type_ : yh_object_type ,
pub algorithm : yh_algorithm ,
pub sequence : u8 ,
pub origin : u8 ,
pub label : [ :: std :: os :: raw :: c_char ; 41usize ] ,
pub delegated_capabilities : yh_capabilities , } # [ test ] fn bindgen_test_layout_yh_object_descriptor ( ) { assert_eq ! ( :: std :: mem :: size_of :: < yh_object_descriptor > ( ) , 73usize , concat ! ( "Size of: " , stringify ! ( yh_object_descriptor ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < yh_object_descriptor > ( ) , 1usize , concat ! ( "Alignment of " , stringify ! ( yh_object_descriptor ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < yh_object_descriptor > ( ) ) ) . capabilities as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( yh_object_descriptor ) , "::" , stringify ! ( capabilities ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < yh_object_descriptor > ( ) ) ) . id as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( yh_object_descriptor ) , "::" , stringify ! ( id ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < yh_object_descriptor > ( ) ) ) . len as * const _ as usize } , 10usize , concat ! ( "Offset of field: " , stringify ! ( yh_object_descriptor ) , "::" , stringify ! ( len ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < yh_object_descriptor > ( ) ) ) . domains as * const _ as usize } , 12usize , concat ! ( "Offset of field: " , stringify ! ( yh_object_descriptor ) , "::" , stringify ! ( domains ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < yh_object_descriptor > ( ) ) ) . type_ as * const _ as usize } , 14usize , concat ! ( "Offset of field: " , stringify ! ( yh_object_descriptor ) , "::" , stringify ! ( type_ ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < yh_object_descriptor > ( ) ) ) . algorithm as * const _ as usize } , 18usize , concat ! ( "Offset of field: " , stringify ! ( yh_object_descriptor ) , "::" , stringify ! ( algorithm ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < yh_object_descriptor > ( ) ) ) . sequence as * const _ as usize } , 22usize , concat ! ( "Offset of field: " , stringify ! ( yh_object_descriptor ) , "::" , stringify ! ( sequence ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < yh_object_descriptor > ( ) ) ) . origin as * const _ as usize } , 23usize , concat ! ( "Offset of field: " , stringify ! ( yh_object_descriptor ) , "::" , stringify ! ( origin ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < yh_object_descriptor > ( ) ) ) . label as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( yh_object_descriptor ) , "::" , stringify ! ( label ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < yh_object_descriptor > ( ) ) ) . delegated_capabilities as * const _ as usize } , 65usize , concat ! ( "Offset of field: " , stringify ! ( yh_object_descriptor ) , "::" , stringify ! ( delegated_capabilities ) ) ) ; } extern "C" {
pub fn yh_strerror ( err : yh_rc ) -> * const :: std :: os :: raw :: c_char ; } extern "C" {
pub fn yh_set_verbosity ( verbosity : u8 ) -> yh_rc ; } extern "C" {
pub fn yh_get_verbosity ( verbosity : * mut u8 ) -> yh_rc ; } extern "C" {
pub fn yh_set_debug_output ( output : * mut FILE ) ; } extern "C" {
pub fn yh_init ( ) -> yh_rc ; } extern "C" {
pub fn yh_exit ( ) -> yh_rc ; } extern "C" {
pub fn yh_init_connector ( url : * const :: std :: os :: raw :: c_char , connector : * mut * mut yh_connector ) -> yh_rc ; } extern "C" {
pub fn yh_set_connector_option ( connector : * mut yh_connector , opt : yh_connector_option , val : * const :: std :: os :: raw :: c_void ) -> yh_rc ; } extern "C" {
pub fn yh_connect_all ( connectors : * mut * mut yh_connector , n_connectors : * mut usize , timeout : :: std :: os :: raw :: c_int ) -> yh_rc ; } extern "C" {
pub fn yh_connect_best ( connectors : * mut * mut yh_connector , n_connectors : usize , idx : * mut :: std :: os :: raw :: c_int ) -> yh_rc ; } extern "C" {
pub fn yh_disconnect ( connector : * mut yh_connector ) -> yh_rc ; } extern "C" {
pub fn yh_send_plain_msg ( connector : * mut yh_connector , cmd : yh_cmd , data : * const u8 , data_len : usize , response_cmd : * mut yh_cmd , response : * mut u8 , response_len : * mut usize ) -> yh_rc ; } extern "C" {
pub fn yh_send_secure_msg ( session : * mut yh_session , cmd : yh_cmd , data : * const u8 , data_len : usize , response_cmd : * mut yh_cmd , response : * mut u8 , response_len : * mut usize ) -> yh_rc ; } extern "C" {
pub fn yh_create_session_derived ( connector : * mut yh_connector , auth_keyset_id : u16 , password : * const u8 , password_len : usize , recreate_session : bool , context : * mut u8 , context_len : usize , session : * mut * mut yh_session ) -> yh_rc ; } extern "C" {
pub fn yh_create_session ( connector : * mut yh_connector , auth_keyset_id : u16 , key_enc : * const u8 , key_enc_len : usize , key_mac : * const u8 , key_mac_len : usize , recreate_session : bool , context : * mut u8 , context_len : usize , session : * mut * mut yh_session ) -> yh_rc ; } extern "C" {
pub fn yh_begin_create_session_ext ( connector : * mut yh_connector , auth_keyset_id : u16 , context : * mut u8 , context_len : usize , card_cryptogram : * mut u8 , card_cryptogram_len : usize , session : * mut * mut yh_session ) -> yh_rc ; } extern "C" {
pub fn yh_finish_create_session_ext ( connector : * mut yh_connector , session : * mut yh_session , key_senc : * const u8 , key_senc_len : usize , key_smac : * const u8 , key_smac_len : usize , key_srmac : * const u8 , key_srmac_len : usize , context : * mut u8 , context_len : usize , card_cryptogram : * mut u8 , card_cryptogram_len : usize ) -> yh_rc ; } extern "C" {
pub fn yh_destroy_session ( session : * mut * mut yh_session ) -> yh_rc ; } extern "C" {
pub fn yh_authenticate_session ( session : * mut yh_session , context : * mut u8 , context_len : usize ) -> yh_rc ; } extern "C" {
pub fn yh_util_get_device_info ( connector : * mut yh_connector , major : * mut u8 , minor : * mut u8 , patch : * mut u8 , serial : * mut u32 , log_total : * mut u8 , log_used : * mut u8 , algorithms : * mut yh_algorithm , n_algorithms : * mut usize ) -> yh_rc ; } extern "C" {
pub fn yh_util_list_objects ( session : * mut yh_session , id : u16 , type_ : yh_object_type , domains : u16 , capabilities : * const yh_capabilities , algorithm : yh_algorithm , label : * const :: std :: os :: raw :: c_char , objects : * mut yh_object_descriptor , n_objects : * mut usize ) -> yh_rc ; } extern "C" {
pub fn yh_util_get_object_info ( session : * mut yh_session , id : u16 , type_ : yh_object_type , object : * mut yh_object_descriptor ) -> yh_rc ; } extern "C" {
pub fn yh_util_get_pubkey ( session : * mut yh_session , id : u16 , data : * mut u8 , datalen : * mut usize , algorithm : * mut yh_algorithm ) -> yh_rc ; } extern "C" {
pub fn yh_util_close_session ( session : * mut yh_session ) -> yh_rc ; } extern "C" {
pub fn yh_util_sign_pkcs1v1_5 ( session : * mut yh_session , key_id : u16 , hashed : bool , in_ : * const u8 , in_len : usize , out : * mut u8 , out_len : * mut usize ) -> yh_rc ; } extern "C" {
pub fn yh_util_sign_pss ( session : * mut yh_session , key_id : u16 , in_ : * const u8 , in_len : usize , out : * mut u8 , out_len : * mut usize , salt_len : usize , mgf1Algo : yh_algorithm ) -> yh_rc ; } extern "C" {
pub fn yh_util_sign_ecdsa ( session : * mut yh_session , key_id : u16 , in_ : * const u8 , in_len : usize , out : * mut u8 , out_len : * mut usize ) -> yh_rc ; } extern "C" {
pub fn yh_util_sign_eddsa ( session : * mut yh_session , key_id : u16 , in_ : * const u8 , in_len : usize , out : * mut u8 , out_len : * mut usize ) -> yh_rc ; } extern "C" {
pub fn yh_util_hmac ( session : * mut yh_session , key_id : u16 , in_ : * const u8 , in_len : usize , out : * mut u8 , out_len : * mut usize ) -> yh_rc ; } extern "C" {
pub fn yh_util_get_random ( session : * mut yh_session , len : usize , out : * mut u8 , out_len : * mut usize ) -> yh_rc ; } extern "C" {
pub fn yh_util_import_key_rsa ( session : * mut yh_session , key_id : * mut u16 , label : * const :: std :: os :: raw :: c_char , domains : u16 , capabilities : * const yh_capabilities , algorithm : yh_algorithm , p : * const u8 , q : * const u8 ) -> yh_rc ; } extern "C" {
pub fn yh_util_import_key_ec ( session : * mut yh_session , key_id : * mut u16 , label : * const :: std :: os :: raw :: c_char , domains : u16 , capabilities : * const yh_capabilities , algorithm : yh_algorithm , s : * const u8 ) -> yh_rc ; } extern "C" {
pub fn yh_util_import_key_ed ( session : * mut yh_session , key_id : * mut u16 , label : * const :: std :: os :: raw :: c_char , domains : u16 , capabilities : * const yh_capabilities , algorithm : yh_algorithm , k : * const u8 ) -> yh_rc ; } extern "C" {
pub fn yh_util_import_key_hmac ( session : * mut yh_session , key_id : * mut u16 , label : * const :: std :: os :: raw :: c_char , domains : u16 , capabilities : * const yh_capabilities , algorithm : yh_algorithm , key : * const u8 , key_len : usize ) -> yh_rc ; } extern "C" {
pub fn yh_util_generate_key_rsa ( session : * mut yh_session , key_id : * mut u16 , label : * const :: std :: os :: raw :: c_char , domains : u16 , capabilities : * const yh_capabilities , algorithm : yh_algorithm ) -> yh_rc ; } extern "C" {
pub fn yh_util_generate_key_ec ( session : * mut yh_session , key_id : * mut u16 , label : * const :: std :: os :: raw :: c_char , domains : u16 , capabilities : * const yh_capabilities , algorithm : yh_algorithm ) -> yh_rc ; } extern "C" {
pub fn yh_util_generate_key_ed ( session : * mut yh_session , key_id : * mut u16 , label : * const :: std :: os :: raw :: c_char , domains : u16 , capabilities : * const yh_capabilities , algorithm : yh_algorithm ) -> yh_rc ; } extern "C" {
pub fn yh_util_hmac_verify ( session : * mut yh_session , key_id : u16 , signature : * const u8 , signature_len : usize , data : * const u8 , data_len : usize , verified : * mut bool ) -> yh_rc ; } extern "C" {
pub fn yh_util_generate_key_hmac ( session : * mut yh_session , key_id : * mut u16 , label : * const :: std :: os :: raw :: c_char , domains : u16 , capabilities : * const yh_capabilities , algorithm : yh_algorithm ) -> yh_rc ; } extern "C" {
pub fn yh_util_decrypt_pkcs1v1_5 ( session : * mut yh_session , key_id : u16 , in_ : * const u8 , in_len : usize , out : * mut u8 , out_len : * mut usize ) -> yh_rc ; } extern "C" {
pub fn yh_util_decrypt_oaep ( session : * mut yh_session , key_id : u16 , in_ : * const u8 , in_len : usize , out : * mut u8 , out_len : * mut usize , label : * const u8 , label_len : usize , mgf1Algo : yh_algorithm ) -> yh_rc ; } extern "C" {
pub fn yh_util_decrypt_ecdh ( session : * mut yh_session , key_id : u16 , in_ : * const u8 , in_len : usize , out : * mut u8 , out_len : * mut usize ) -> yh_rc ; } extern "C" {
pub fn yh_util_delete_object ( session : * mut yh_session , id : u16 , type_ : yh_object_type ) -> yh_rc ; } extern "C" {
pub fn yh_util_export_wrapped ( session : * mut yh_session , wrapping_key_id : u16 , target_type : yh_object_type , target_id : u16 , out : * mut u8 , out_len : * mut usize ) -> yh_rc ; } extern "C" {
pub fn yh_util_import_wrapped ( session : * mut yh_session , wrapping_key_id : u16 , in_ : * const u8 , in_len : usize , target_type : * mut yh_object_type , target_id : * mut u16 ) -> yh_rc ; } extern "C" {
pub fn yh_util_import_key_wrap ( session : * mut yh_session , key_id : * mut u16 , label : * const :: std :: os :: raw :: c_char , domains : u16 , capabilities : * const yh_capabilities , algorithm : yh_algorithm , delegated_capabilities : * const yh_capabilities , in_ : * const u8 , in_len : usize ) -> yh_rc ; } extern "C" {
pub fn yh_util_generate_key_wrap ( session : * mut yh_session , key_id : * mut u16 , label : * const :: std :: os :: raw :: c_char , domains : u16 , capabilities : * const yh_capabilities , algorithm : yh_algorithm , delegated_capabilities : * const yh_capabilities ) -> yh_rc ; } extern "C" {
pub fn yh_util_get_logs ( session : * mut yh_session , unlogged_boot : * mut u16 , unlogged_auth : * mut u16 , out : * mut yh_log_entry , n_items : * mut usize ) -> yh_rc ; } extern "C" {
pub fn yh_util_set_log_index ( session : * mut yh_session , index : u16 ) -> yh_rc ; } extern "C" {
pub fn yh_util_get_opaque ( session : * mut yh_session , object_id : u16 , out : * mut u8 , out_len : * mut usize ) -> yh_rc ; } extern "C" {
pub fn yh_util_import_opaque ( session : * mut yh_session , object_id : * mut u16 , label : * const :: std :: os :: raw :: c_char , domains : u16 , capabilities : * const yh_capabilities , algorithm : yh_algorithm , in_ : * const u8 , in_len : usize ) -> yh_rc ; } extern "C" {
pub fn yh_util_ssh_certify ( session : * mut yh_session , key_id : u16 , template_id : u16 , sig_algo : yh_algorithm , in_ : * const u8 , in_len : usize , out : * mut u8 , out_len : * mut usize ) -> yh_rc ; } extern "C" {
pub fn yh_util_import_authkey ( session : * mut yh_session , key_id : * mut u16 , label : * const :: std :: os :: raw :: c_char , domains : u16 , capabilities : * const yh_capabilities , delegated_capabilities : * const yh_capabilities , password : * const u8 , password_len : usize ) -> yh_rc ; } extern "C" {
pub fn yh_util_get_template ( session : * mut yh_session , object_id : u16 , out : * mut u8 , out_len : * mut usize ) -> yh_rc ; } extern "C" {
pub fn yh_util_import_template ( session : * mut yh_session , object_id : * mut u16 , label : * const :: std :: os :: raw :: c_char , domains : u16 , capabilities : * const yh_capabilities , algorithm : yh_algorithm , in_ : * const u8 , in_len : usize ) -> yh_rc ; } extern "C" {
pub fn yh_util_otp_aead_create ( session : * mut yh_session , key_id : u16 , key : * const u8 , private_id : * const u8 , out : * mut u8 , out_len : * mut usize ) -> yh_rc ; } extern "C" {
pub fn yh_util_otp_aead_random ( session : * mut yh_session , key_id : u16 , out : * mut u8 , out_len : * mut usize ) -> yh_rc ; } extern "C" {
pub fn yh_util_otp_decrypt ( session : * mut yh_session , key_id : u16 , aead : * const u8 , aead_len : usize , otp : * const u8 , useCtr : * mut u16 , sessionCtr : * mut u8 , tstph : * mut u8 , tstpl : * mut u16 ) -> yh_rc ; } extern "C" {
pub fn yh_util_put_otp_aead_key ( session : * mut yh_session , key_id : * mut u16 , label : * const :: std :: os :: raw :: c_char , domains : u16 , capabilities : * const yh_capabilities , nonce_id : u32 , in_ : * const u8 , in_len : usize ) -> yh_rc ; } extern "C" {
pub fn yh_util_generate_otp_aead_key ( session : * mut yh_session , key_id : * mut u16 , label : * const :: std :: os :: raw :: c_char , domains : u16 , capabilities : * const yh_capabilities , algorithm : yh_algorithm , nonce_id : u32 ) -> yh_rc ; } extern "C" {
pub fn yh_util_attest_asymmetric ( session : * mut yh_session , key_id : u16 , attest_id : u16 , out : * mut u8 , out_len : * mut usize ) -> yh_rc ; } extern "C" {
pub fn yh_util_put_option ( session : * mut yh_session , option : yh_option , len : usize , val : * mut u8 ) -> yh_rc ; } extern "C" {
pub fn yh_util_get_option ( session : * mut yh_session , option : yh_option , out : * mut u8 , out_len : * mut usize ) -> yh_rc ; } extern "C" {
pub fn yh_util_get_storage_stats ( session : * mut yh_session , total_records : * mut u16 , free_records : * mut u16 , total_pages : * mut u16 , free_pages : * mut u16 , page_size : * mut u16 ) -> yh_rc ; } extern "C" {
pub fn yh_util_wrap_data ( session : * mut yh_session , key_id : u16 , in_ : * const u8 , in_len : usize , out : * mut u8 , out_len : * mut usize ) -> yh_rc ; } extern "C" {
pub fn yh_util_unwrap_data ( session : * mut yh_session , key_id : u16 , in_ : * const u8 , in_len : usize , out : * mut u8 , out_len : * mut usize ) -> yh_rc ; } extern "C" {
pub fn yh_util_blink ( session : * mut yh_session , seconds : u8 ) -> yh_rc ; } extern "C" {
pub fn yh_util_reset ( session : * mut yh_session ) -> yh_rc ; } extern "C" {
pub fn yh_get_session_id ( session : * mut yh_session , sid : * mut u8 ) -> yh_rc ; } extern "C" {
pub fn yh_connector_has_device ( connector : * mut yh_connector ) -> bool ; } extern "C" {
pub fn yh_get_connector_version ( connector : * mut yh_connector , major : * mut u8 , minor : * mut u8 , patch : * mut u8 ) -> yh_rc ; } extern "C" {
pub fn yh_get_connector_address ( connector : * mut yh_connector , address : * const * mut :: std :: os :: raw :: c_char ) -> yh_rc ; } extern "C" {
pub fn yh_capabilities_to_num ( capability : * const :: std :: os :: raw :: c_char , result : * mut yh_capabilities ) -> yh_rc ; } extern "C" {
pub fn yh_num_to_capabilities ( num : * const yh_capabilities , result : * mut * const :: std :: os :: raw :: c_char , n_result : * mut usize ) -> yh_rc ; } extern "C" {
pub fn yh_check_capability ( capabilities : * const yh_capabilities , capability : * const :: std :: os :: raw :: c_char ) -> bool ; } extern "C" {
pub fn yh_merge_capabilities ( a : * const yh_capabilities , b : * const yh_capabilities , result : * mut yh_capabilities ) -> yh_rc ; } extern "C" {
pub fn yh_filter_capabilities ( capabilities : * const yh_capabilities , filter : * const yh_capabilities , result : * mut yh_capabilities ) -> yh_rc ; } extern "C" {
pub fn yh_is_rsa ( algorithm : yh_algorithm ) -> bool ; } extern "C" {
pub fn yh_is_ec ( algorithm : yh_algorithm ) -> bool ; } extern "C" {
pub fn yh_is_ed ( algorithm : yh_algorithm ) -> bool ; } extern "C" {
pub fn yh_is_hmac ( algorithm : yh_algorithm ) -> bool ; } extern "C" {
pub fn yh_get_key_bitlength ( algorithm : yh_algorithm , result : * mut usize ) -> yh_rc ; } extern "C" {
pub fn yh_algo_to_string ( algo : yh_algorithm , result : * mut * const :: std :: os :: raw :: c_char ) -> yh_rc ; } extern "C" {
pub fn yh_string_to_algo ( string : * const :: std :: os :: raw :: c_char , algo : * mut yh_algorithm ) -> yh_rc ; } extern "C" {
pub fn yh_type_to_string ( type_ : yh_object_type , result : * mut * const :: std :: os :: raw :: c_char ) -> yh_rc ; } extern "C" {
pub fn yh_string_to_type ( string : * const :: std :: os :: raw :: c_char , type_ : * mut yh_object_type ) -> yh_rc ; } extern "C" {
pub fn yh_string_to_option ( string : * const :: std :: os :: raw :: c_char , option : * mut yh_option ) -> yh_rc ; } extern "C" {
pub fn yh_verify_logs ( logs : * mut yh_log_entry , n_items : usize , last_previous_log : * mut yh_log_entry ) -> bool ; } extern "C" {
pub fn yh_parse_domains ( domains : * const :: std :: os :: raw :: c_char , result : * mut u16 ) -> yh_rc ; } extern "C" {
pub fn yh_domains_to_string ( domains : u16 , string : * mut :: std :: os :: raw :: c_char , max_len : usize ) -> yh_rc ; }