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
/* automatically generated by rust-bindgen */

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 ] } /// Capabilitites representation
 # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct yh_capabilities { /// Capabilities is represented as an 8 byte uint8_t array
 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 ; /// Logging struct as returned by device
 # [ repr ( C , packed ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct yh_log_entry { /// Monotonically increasing index
 pub number : u16 , /// What command was executed @see yh_cmd
 pub command : u8 , /// Length of in-data
 pub length : u16 , /// ID of authentication key used
 pub session_key : u16 , /// ID of first object used
 pub target_key : u16 , /// ID of second object used
 pub second_key : u16 , /// Command result @see yh_cmd
 pub result : u8 , /// Systick at time of execution
 pub systick : u32 , /// Truncated sha256 digest of this last digest + this entry
 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 ) ) ) ; } /// Object descriptor
 # [ repr ( C , packed ) ] # [ derive ( Copy , Clone ) ] pub struct yh_object_descriptor { /// Object capabilities @see yh_capabilities
 pub capabilities : yh_capabilities , /// Object ID
 pub id : u16 , /// Object length
 pub len : u16 , /// Object domains
 pub domains : u16 , /// Object type
 pub type_ : yh_object_type , /// Object algorithm
 pub algorithm : yh_algorithm , /// Object sequence
 pub sequence : u8 , /// Object origin
 pub origin : u8 , /// Object label
 pub label : [ :: std :: os :: raw :: c_char ; 41usize ] , /// Object delegated capabilities
 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" { /// Return a string describing an error condition
///
/// @param err yh_rc error code
///
/// @return String with descriptive error
 pub fn yh_strerror ( err : yh_rc ) -> * const :: std :: os :: raw :: c_char ; } extern "C" { /// Set verbosity
/// This function may be called prior to global library initialization.
///
/// @param verbosity
///
/// @return yh_rc error code
 pub fn yh_set_verbosity ( verbosity : u8 ) -> yh_rc ; } extern "C" { /// Get verbosity
///
/// @param verbosity
///
/// @return yh_rc error code
 pub fn yh_get_verbosity ( verbosity : * mut u8 ) -> yh_rc ; } extern "C" { /// Set file for debug output
///
/// @param output
///
/// @return void
 pub fn yh_set_debug_output ( output : * mut FILE ) ; } extern "C" { /// Global library initialization
///
/// @return yh_rc error code
 pub fn yh_init ( ) -> yh_rc ; } extern "C" { /// Global library cleanup
///
/// @return yh_rc error code
 pub fn yh_exit ( ) -> yh_rc ; } extern "C" { /// Instantiate a new connector
///
/// @param url URL to associate with this connector
/// @param connector reference to connector
///
/// @return yh_rc error code
 pub fn yh_init_connector ( url : * const :: std :: os :: raw :: c_char , connector : * mut * mut yh_connector ) -> yh_rc ; } extern "C" { /// Set connector options
///
/// @param connector connector to set an option on
/// @param opt option to set @see yh_connector_option
/// @param val value to set, type is specific for the given option
///
/// @return yh_rc error code
 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" { /// Connect to all specified connectors
///
/// @param connectors pointer of connector array
/// @param n_connectors number of connectors in array (will be set to
/// successful connectors on return)
/// @param timeout timeout in seconds
///
/// @return yh_rc error code
 pub fn yh_connect_all ( connectors : * mut * mut yh_connector , n_connectors : * mut usize , timeout : :: std :: os :: raw :: c_int ) -> yh_rc ; } extern "C" { /// Connect to one connector in array
///
/// @param connectors pointer of connector array
/// @param n_connectors number of connectors in array
/// @param idx index of connected connector, may be NULL
///
/// @return yh_rc error code
 pub fn yh_connect_best ( connectors : * mut * mut yh_connector , n_connectors : usize , idx : * mut :: std :: os :: raw :: c_int ) -> yh_rc ; } extern "C" { /// Disconnect from connector
///
/// @param connector connector to disconnect from
///
/// @return yh_rc error code
 pub fn yh_disconnect ( connector : * mut yh_connector ) -> yh_rc ; } extern "C" { /// Send a plain message to a connector
///
/// @param connector connector to send to
/// @param cmd command to send
/// @param data data to send
/// @param data_len data length
/// @param response_cmd response command
/// @param response response data
/// @param response_len response length
///
/// @return yh_rc error code
 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" { /// Send an encrypted message over a session
///
/// @param session session to send over
/// @param cmd command to send
/// @param data data to send
/// @param data_len data length
/// @param response_cmd response command
/// @param response response data
/// @param response_len response length
///
/// @return yh_rc error code
 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" { /// Create a session with keys derived frm password
///
/// @param connector connector to create the session with
/// @param auth_keyset_id ID of the authentication key to be used
/// @param password password to derive keys from
/// @param password_len length of the password in bytes
/// @param recreate_session session will be recreated if expired, this caches the
/// password in memory
/// @param context context data for the authentication
/// @param context_len context length
/// @param session created session
///
/// @return yh_rc error code
 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" { /// Create a session
///
/// @param connector connector to create the session with
/// @param auth_keyset_id ID of the authentication key
/// @param key_enc encryption key
/// @param key_enc_len length of encryption key
/// @param key_mac MAC key
/// @param key_mac_len length of MAC key
/// @param recreate_session session will be recreated if expired, this caches the
/// password in memory
/// @param context context data for the authentication
/// @param context_len context length
/// @param session created session
///
/// @return yh_rc error code
 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" { /// Begin create extenal session
///
/// @param connector connector to create the session with
/// @param auth_keyset_id ID of the authentication key
/// @param context context data for the authentication
/// @param context_len length of context data
/// @param card_cryptogram card cryptogram
/// @param card_cryptogram_len catd cryptogram length
/// @param session created session
///
/// @return yh_rc error code
 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" { /// Finish creating external session
///
/// @param connector connector to create the session with
/// @param session session
/// @param key_senc session encryption key
/// @param key_senc_len session encrypt key length
/// @param key_smac session MAC key
/// @param key_smac_len session MAC key length
/// @param key_srmac session return MAC key
/// @param key_srmac_len session return MAC key length
/// @param context context data
/// @param context_len context length
/// @param card_cryptogram card cryptogram
/// @param card_cryptogram_len card cryptogram length
///
/// @return yh_rc error code
 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" { /// Free data associated with session
///
/// @param session session to destroy
///
/// @return yh_rc error code
 pub fn yh_destroy_session ( session : * mut * mut yh_session ) -> yh_rc ; } extern "C" { /// Authenticate session
///
/// @param session session to authenticate
/// @param context context data
/// @param context_len context length
///
/// @return yh_rc error code
 pub fn yh_authenticate_session ( session : * mut yh_session , context : * mut u8 , context_len : usize ) -> yh_rc ; } extern "C" { /// Get device info
///
/// @param connector connector to send over
/// @param major version major
/// @param minor version minor
/// @param patch version path
/// @param serial serial number
/// @param log_total total number of log entries
/// @param log_used log entries used
/// @param algorithms algorithms array
/// @param n_algorithms number of algorithms
///
/// @return yh_rc error code
 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" { /// List objects
///
/// @param session session to use
/// @param id ID to filter by (0 to not filter by ID)
/// @param type Type to filter by (0 to not filter by type) @see yh_object_type
/// @param domains Domains to filter by (0 to not filter by domain)
/// @param capabilities Capabilities to filter by (0 to not filter by
/// capabilities) @see yh_capabilities
/// @param algorithm Algorithm to filter by (0 to not filter by algorithm)
/// @param label Label to filter by
/// @param objects Array of objects returned
/// @param n_objects Max length of objects (will be set to number found on
/// return)
///
/// @return yh_rc error code
 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" { /// Get object info
///
/// @param session session to use
/// @param id Object ID
/// @param type Object type
/// @param object object information
///
/// @return yh_rc error code
 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" { /// Get Public key
///
/// @param session session to use
/// @param id Object ID
/// @param data Data out
/// @param datalen Data length
/// @param algorithm Algorithm of object
///
/// @return yh_rc error code
 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" { /// Close session
///
/// @param session session to close
///
/// @return yh_rc error code
 pub fn yh_util_close_session ( session : * mut yh_session ) -> yh_rc ; } extern "C" { /// Sign data using PKCS1 v1.5
///
/// @param session session to use
/// @param key_id Object ID
/// @param hashed if data is already hashed
/// @param in in data to sign
/// @param in_len length of in
/// @param out signed data
/// @param out_len length of signed data
///
/// @return yh_rc error code
 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" { /// Sign data using RSS
///
/// @param session session to use
/// @param key_id Object ID
/// @param in data to sign
/// @param in_len length of in
/// @param out signed data
/// @param out_len length of signed data
/// @param salt_len length of salt
/// @param mgf1Algo algorithm for mgf1
///
/// @return yh_rc error code
 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" { /// Sign data using ECDSA
///
/// @param session session to use
/// @param key_id Object ID
/// @param in data to sign
/// @param in_len length of in
/// @param out signed data
/// @param out_len length of signed data
///
/// @return yh_rc error code
 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" { /// Sign data using EDDSA
///
/// @param session session to use
/// @param key_id Object ID
/// @param in data to sign
/// @param in_len length of in
/// @param out signed data
/// @param out_len length of signed data
///
/// @return yh_rc error code
 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" { /// HMAC data
///
/// @param session session to use
/// @param key_id Object ID
/// @param in data to hmac
/// @param in_len length of in
/// @param out HMAC
/// @param out_len length of HMAC
///
/// @return yh_rc error code
 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" { /// Get pseudo random data
///
/// @param session session to use
/// @param len length of data to get
/// @param out random data out
/// @param out_len length of random data
///
/// @return yh_rc error code
 pub fn yh_util_get_random ( session : * mut yh_session , len : usize , out : * mut u8 , out_len : * mut usize ) -> yh_rc ; } extern "C" { /// Import RSA key
///
/// @param session session to use
/// @param key_id Object ID
/// @param label Label
/// @param domains domains
/// @param capabilities capabilities
/// @param algorithm algorithm
/// @param p P
/// @param q Q
///
/// @return yh_rc error code
 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" { /// Import EC key
///
/// @param session session to use
/// @param key_id Object ID
/// @param label Label
/// @param domains domains
/// @param capabilities capabilities
/// @param algorithm algorithm
/// @param s S
///
/// @return yh_rc error code
 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" { /// Import ED key
///
/// @param session session to use
/// @param key_id Object ID
/// @param label Label
/// @param domains domains
/// @param capabilities capabilities
/// @param algorithm algorithm
/// @param k k
///
/// @return yh_rc error code
 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" { /// Import HMAC key
///
/// @param session session to use
/// @param key_id Object ID
/// @param label Label
/// @param domains domains
/// @param capabilities capabilities
/// @param algorithm algorithm
/// @param key key data
/// @param key_len length of key
///
/// @return yh_rc error code
 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" { /// Generate RSA key
///
/// @param session session to use
/// @param key_id Object ID
/// @param label Label
/// @param domains domains
/// @param capabilities capabilities
/// @param algorithm algorithm
///
/// @return yh_rc error code
 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" { /// Generate EC key
///
/// @param session session to use
/// @param key_id Object ID
/// @param label Label
/// @param domains domains
/// @param capabilities capabilities
/// @param algorithm algorithm
///
/// @return yh_rc error code
 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" { /// Generate ED key
///
/// @param session session to use
/// @param key_id Object ID
/// @param label Label
/// @param domains domains
/// @param capabilities capabilities
/// @param algorithm algorithm
///
/// @return yh_rc error code
 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" { /// Verify HMAC data
///
/// @param session session to use
/// @param key_id Object ID
/// @param signature HMAC
/// @param signature_len HMAC length
/// @param data data to verify
/// @param data_len data length
/// @param verified if verification succeeded
///
/// @return yh_rc error code
 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" { /// Generate HMAC key
///
/// @param session session to use
/// @param key_id Object ID
/// @param label Label
/// @param domains domains
/// @param capabilities capabilities
/// @param algorithm algorithm
///
/// @return yh_rc error code
 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" { /// Decrypt PKCS1 v1.5 data
///
/// @param session session to use
/// @param key_id Object ID
/// @param in Encrypted data
/// @param in_len length of encrypted data
/// @param out Decrypted data
/// @param out_len length of decrypted data
///
/// @return yh_rc error code
 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" { /// Decrypt OAEP data
///
/// @param session session to use
/// @param key_id Object ID
/// @param in Encrypted data
/// @param in_len length of encrypted data
/// @param out Decrypted data
/// @param out_len length of decrypted data
/// @param label OAEP label
/// @param label_len label length
/// @param mgf1Algo MGF1 algorithm
///
/// @return yh_rc error code
 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" { /// Perform ECDH key exchange
///
/// @param session session to use
/// @param key_id Object ID
/// @param in public key
/// @param in_len length of public key
/// @param out Agreed key
/// @param out_len length of agreed key
///
/// @return yh_rc error code
 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" { /// Delete an object
///
/// @param session session to use
/// @param id Object ID
/// @param type Object type
///
/// @return yh_rc error code
 pub fn yh_util_delete_object ( session : * mut yh_session , id : u16 , type_ : yh_object_type ) -> yh_rc ; } extern "C" { /// Export an object under wrap
///
/// @param session session to use
/// @param wrapping_key_id ID of wrapping key
/// @param target_type Type of object
/// @param target_id ID of object
/// @param out wrapped data
/// @param out_len length of wrapped data
///
/// @return yh_rc error code
 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" { /// Import a wrapped object
///
/// @param session session to use
/// @param wrapping_key_id ID of wrapping key
/// @param in wrapped data
/// @param in_len length of wrapped data
/// @param target_type what type the imported object has
/// @param target_id ID of imported object
///
/// @return yh_rc error code
 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" { /// Import a wrap key
///
/// @param session session to use
/// @param key_id Object ID
/// @param label label
/// @param domains domains
/// @param capabilities capabilities
/// @param algorithm algorithm
/// @param delegated_capabilities delegated capabilities
/// @param in key
/// @param in_len key length
///
/// @return yh_rc error code
 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" { /// Generate a wrap key
///
/// @param session session to use
/// @param key_id Object ID
/// @param label label
/// @param domains domains
/// @param capabilities capabilities
/// @param algorithm algorithm
/// @param delegated_capabilities delegated capabilitites
///
/// @return yh_rc error code
 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" { /// Get logs
///
/// @param session session to use
/// @param unlogged_boot number of unlogged boots
/// @param unlogged_auth number of unlogged authentications
/// @param out array of log entries
/// @param n_items number of items in out
///
/// @return yh_rc error code
 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" { /// Set the log index
///
/// @param session session to use
/// @param index index to set
///
/// @return yh_rc error code
 pub fn yh_util_set_log_index ( session : * mut yh_session , index : u16 ) -> yh_rc ; } extern "C" { /// Get opaque object
///
/// @param session session to use
/// @param object_id Object ID
/// @param out data
/// @param out_len length of out
///
/// @return yh_rc error code
 pub fn yh_util_get_opaque ( session : * mut yh_session , object_id : u16 , out : * mut u8 , out_len : * mut usize ) -> yh_rc ; } extern "C" { /// Import opaque object
///
/// @param session session to use
/// @param object_id Object ID
/// @param label label
/// @param domains domains
/// @param capabilities
/// @param algorithm algorithm
/// @param in object data
/// @param in_len length of in
///
/// @return
 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" { /// SSH certify
///
/// @param session session to use
/// @param key_id Key ID
/// @param template_id Template ID
/// @param sig_algo signature algorithm
/// @param in Certificate request
/// @param in_len length of in
/// @param out Signature
/// @param out_len length of out
///
/// @return yh_rc error code
 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" { /// Import authentication key
///
/// @param session session to use
/// @param key_id Object ID
/// @param label label
/// @param domains domains
/// @param capabilities capabilities
/// @param delegated_capabilities delegated capabilities
/// @param password password to derive key from
/// @param password_len password length in bytes
///
/// @return yh_rc error code
 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" { /// Get template
///
/// @param session session to use
/// @param object_id Object ID
/// @param out data
/// @param out_len length of out
///
/// @return yh_rc error code
 pub fn yh_util_get_template ( session : * mut yh_session , object_id : u16 , out : * mut u8 , out_len : * mut usize ) -> yh_rc ; } extern "C" { /// Import template
///
/// @param session session to use
/// @param object_id Object ID
/// @param label label
/// @param domains domains
/// @param capabilities capabilities
/// @param algorithm algorithm
/// @param in data
/// @param in_len length of in
///
/// @return yh_rc error code
 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" { /// Create OTP AEAD
///
/// @param session session to use
/// @param key_id Object ID
/// @param key OTP key
/// @param private_id OTP private id
/// @param out AEAD
/// @param out_len length of out
///
/// @return yh_rc error code
 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" { /// Create OTP AEAD from random
///
/// @param session session to use
/// @param key_id Object ID
/// @param out AEAD
/// @param out_len length of out
///
/// @return yh_rc error code
 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" { /// Decrypt OTP
///
/// @param session session to use
/// @param key_id Object ID
/// @param aead AEAD
/// @param aead_len length of AEAD
/// @param otp OTP
/// @param useCtr OTP use counter
/// @param sessionCtr OTP session counter
/// @param tstph OTP timestamp high
/// @param tstpl OTP timestamp low
///
/// @return yh_rc error code
 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" { /// Import OTP AEAD Key
///
/// @param session session to use
/// @param key_id Object ID
/// @param label label
/// @param domains domains
/// @param capabilities capabilities
/// @param nonce_id nonce ID
/// @param in key
/// @param in_len length of in
///
/// @return
 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" { /// Generate OTP AEAD Key
///
/// @param session session to use
/// @param key_id Object ID
/// @param label label
/// @param domains domains
/// @param capabilities capabilities
/// @param algorithm algorithm
/// @param nonce_id nonce ID
///
/// @return yh_rc error code
 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" { /// Attest asymmetric key
///
/// @param session session to use
/// @param key_id Object ID
/// @param attest_id Attestation key ID
/// @param out Certificate
/// @param out_len length of out
///
/// @return yh_rc error code
 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" { /// Put global option
///
/// @param session session to use
/// @param option option
/// @param len length of option data
/// @param val option data
///
/// @return yh_rc error code
 pub fn yh_util_put_option ( session : * mut yh_session , option : yh_option , len : usize , val : * mut u8 ) -> yh_rc ; } extern "C" { /// Get global option
///
/// @param session session to use
/// @param option option
/// @param out option data
/// @param out_len length of out
///
/// @return yh_rc error code
 pub fn yh_util_get_option ( session : * mut yh_session , option : yh_option , out : * mut u8 , out_len : * mut usize ) -> yh_rc ; } extern "C" { /// Get storage statistics
///
/// @param session session to use
/// @param total_records total records available
/// @param free_records number of free records
/// @param total_pages total pages available
/// @param free_pages number of free pages
/// @param page_size page size in bytes
///
/// @return yh_rc error code
 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" { /// Wrap data
///
/// @param session session to use
/// @param key_id Object ID
/// @param in data to wrap
/// @param in_len length of in
/// @param out wrapped data
/// @param out_len length of out
///
/// @return yh_rc error code
 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" { /// Unwrap data
///
/// @param session session to use
/// @param key_id Object ID
/// @param in wrapped data
/// @param in_len length of in
/// @param out unwrapped data
/// @param out_len length of out
///
/// @return yh_rc error code
 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" { /// Blink the device
///
/// @param session session to use
/// @param seconds seconds to blink
///
/// @return yh_rc error code
 pub fn yh_util_blink ( session : * mut yh_session , seconds : u8 ) -> yh_rc ; } extern "C" { /// Reset the device
///
/// @param session session to use
///
/// @return yh_rc error code. This function will normally return a network error
 pub fn yh_util_reset ( session : * mut yh_session ) -> yh_rc ; } extern "C" { /// Get session ID
///
/// @param session session to use
/// @param sid session ID
///
/// @return yh_rc error code
 pub fn yh_get_session_id ( session : * mut yh_session , sid : * mut u8 ) -> yh_rc ; } extern "C" { /// Check if the connector has a device connected
///
/// @param connector connector
///
/// @return true or false
 pub fn yh_connector_has_device ( connector : * mut yh_connector ) -> bool ; } extern "C" { /// Get the connector version
///
/// @param connector connector
/// @param major major version
/// @param minor minor version
/// @param patch patch version
///
/// @return yh_rc error code
 pub fn yh_get_connector_version ( connector : * mut yh_connector , major : * mut u8 , minor : * mut u8 , patch : * mut u8 ) -> yh_rc ; } extern "C" { /// Get connector address
///
/// @param connector connector
/// @param address pointer to string address
///
/// @return yh_rc error code
 pub fn yh_get_connector_address ( connector : * mut yh_connector , address : * const * mut :: std :: os :: raw :: c_char ) -> yh_rc ; } extern "C" { /// Convert capability string to byte array
///
/// @param capability string of capabilities
/// @param result capabilities
///
/// @return yh_rc error code
 pub fn yh_capabilities_to_num ( capability : * const :: std :: os :: raw :: c_char , result : * mut yh_capabilities ) -> yh_rc ; } extern "C" { /// Convert capability byte array to strings
///
/// @param num capabilities
/// @param result array of string pointers
/// @param n_result number of elements of result
///
/// @return yh_rc error code
 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" { /// Check if capability is set
///
/// @param capabilities capabilities
/// @param capability capability string
///
/// @return true or false
 pub fn yh_check_capability ( capabilities : * const yh_capabilities , capability : * const :: std :: os :: raw :: c_char ) -> bool ; } extern "C" { /// Merge two sets of capabilities
///
/// @param a a set of capabilities
/// @param b a set of capabilities
/// @param result resulting set of capabilities
///
/// @return yh_rc error code
 pub fn yh_merge_capabilities ( a : * const yh_capabilities , b : * const yh_capabilities , result : * mut yh_capabilities ) -> yh_rc ; } extern "C" { /// Filter one set of capabilities with another
///
/// @param capabilities set of capabilities
/// @param filter capabilities to filter with
/// @param result resulting set of capabilities
///
/// @return yh_rc error code
 pub fn yh_filter_capabilities ( capabilities : * const yh_capabilities , filter : * const yh_capabilities , result : * mut yh_capabilities ) -> yh_rc ; } extern "C" { /// Check if algorithm is an RSA algorithm
///
/// @param algorithm algorithm
///
/// @return true or false
 pub fn yh_is_rsa ( algorithm : yh_algorithm ) -> bool ; } extern "C" { /// Check if algorithm is an EC algorithm
///
/// @param algorithm algorithm
///
/// @return true or false
 pub fn yh_is_ec ( algorithm : yh_algorithm ) -> bool ; } extern "C" { /// Check if algorithm is an ED algorithm
///
/// @param algorithm algorithm
///
/// @return true or false
 pub fn yh_is_ed ( algorithm : yh_algorithm ) -> bool ; } extern "C" { /// Check if algorithm is a HMAC algorithm
///
/// @param algorithm algorithm
///
/// @return true or false
 pub fn yh_is_hmac ( algorithm : yh_algorithm ) -> bool ; } extern "C" { /// Get algorithm bitlength
///
/// @param algorithm algorithm
/// @param result bitlength
///
/// @return yh_rc error code
 pub fn yh_get_key_bitlength ( algorithm : yh_algorithm , result : * mut usize ) -> yh_rc ; } extern "C" { /// Convert algorithm to string
///
/// @param algo algorithm
/// @param result string
///
/// @return yh_rc error code
 pub fn yh_algo_to_string ( algo : yh_algorithm , result : * mut * const :: std :: os :: raw :: c_char ) -> yh_rc ; } extern "C" { /// Convert string to algorithm
///
/// @param string algorithm as string
/// @param algo algorithm
///
/// @return yh_rc error code
 pub fn yh_string_to_algo ( string : * const :: std :: os :: raw :: c_char , algo : * mut yh_algorithm ) -> yh_rc ; } extern "C" { /// Convert type to string
///
/// @param type type
/// @param result string
///
/// @return yh_rc error code
 pub fn yh_type_to_string ( type_ : yh_object_type , result : * mut * const :: std :: os :: raw :: c_char ) -> yh_rc ; } extern "C" { /// Convert string to type
///
/// @param string type as string
/// @param type type
///
/// @return yh_rc error code
 pub fn yh_string_to_type ( string : * const :: std :: os :: raw :: c_char , type_ : * mut yh_object_type ) -> yh_rc ; } extern "C" { /// Convert string to option
///
/// @param string option as string
/// @param option option
///
/// @return yh_rc error code
 pub fn yh_string_to_option ( string : * const :: std :: os :: raw :: c_char , option : * mut yh_option ) -> yh_rc ; } extern "C" { /// Verify an array of log entries
///
/// @param logs pointer to an array of log entries
/// @param n_items number of items logs
/// @param last_previous_log optional pointer to the entry before the first entry
/// in logs
///
/// @return true or false
 pub fn yh_verify_logs ( logs : * mut yh_log_entry , n_items : usize , last_previous_log : * mut yh_log_entry ) -> bool ; } extern "C" { /// Parse a string to a domains parameter.
///
/// @param domains string of the format 1,2,3
/// @param result resulting parsed domain parameter
///
/// @return yh_rc error code
 pub fn yh_parse_domains ( domains : * const :: std :: os :: raw :: c_char , result : * mut u16 ) -> yh_rc ; } extern "C" { /// Write out domains to a string.
///
/// @param domains encoded domains
/// @param string string to hold the result
/// @param max_len maximum length of string
///
/// @return yh_rc error code
 pub fn yh_domains_to_string ( domains : u16 , string : * mut :: std :: os :: raw :: c_char , max_len : usize ) -> yh_rc ; }