/* * ks_flash.c * ---------- * Keystore implementation in flash memory. * * Authors: Rob Austein, Fredrik Thulin * Copyright (c) 2015-2016, NORDUnet A/S All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * - Neither the name of the NORDUnet nor the names of its contributors may * be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define HAL_OK LIBHAL_OK #include "hal.h" #include "hal_internal.h" #undef HAL_OK #define HAL_OK CMIS_HAL_OK #include "stm-keystore.h" #include "masterkey.h" #undef HAL_OK #include #include #include "last_gasp_pin_internal.h" #define PAGE_SIZE_MASK (KEYSTORE_PAGE_SIZE - 1) #define KEK_LENGTH (bitsToBytes(256)) /* * Temporary hack: In-memory copy of entire (tiny) keystore database. * This is backwards compatability to let us debug without changing * too many moving parts at the same time, but will need to be * replaced by something that can handle a much larger number of keys, * which is one of the main points of the new keystore API. */ typedef struct { hal_ks_t ks; /* Must be first (C "subclassing") */ hal_ks_pin_t wheel_pin; hal_ks_pin_t so_pin; hal_ks_pin_t user_pin; #if HAL_STATIC_PKEY_STATE_BLOCKS > 0 hal_ks_key_t keys[HAL_STATIC_PKEY_STATE_BLOCKS]; #else #warning No keys in keydb #endif } db_t; static db_t db; #define FLASH_SECTOR_1_OFFSET (0 * KEYSTORE_SECTOR_SIZE) #define FLASH_SECTOR_2_OFFSET (1 * KEYSTORE_SECTOR_SIZE) static inline uint32_t _active_sector_offset() { /* XXX Load status bytes from both sectors and decide which is current. */ #warning Have not implemented two flash sectors yet return FLASH_SECTOR_1_OFFSET; } static inline uint32_t _get_key_offset(uint32_t num) { /* * Reserve first two pages for flash sector state, PINs and future additions. * The three PINs alone currently occupy 3 * (64 + 16 + 4) bytes (252). */ uint32_t offset = KEYSTORE_PAGE_SIZE * 2; uint32_t key_size = sizeof(*db.keys); uint32_t bytes_per_key = KEYSTORE_PAGE_SIZE * ((key_size / KEYSTORE_PAGE_SIZE) + 1); offset += num * bytes_per_key; return offset; } static hal_error_t ks_init(void) { if (db.ks.driver == hal_ks_token_driver) return LIBHAL_OK; if (db.ks.driver != NULL) return HAL_ERROR_IMPOSSIBLE; uint8_t page_buf[KEYSTORE_PAGE_SIZE]; uint32_t idx = 0; /* Current index into db.keys[] */ memset(&db, 0, sizeof(db)); if (keystore_check_id() != 1) return HAL_ERROR_KEYSTORE_ACCESS; uint32_t active_sector_offset = _active_sector_offset(); /* * The PINs are in the second page of the sector. * Caching all of these these makes some sense in any case. */ uint32_t offset = active_sector_offset + KEYSTORE_PAGE_SIZE; if (keystore_read_data(offset, page_buf, sizeof(page_buf)) != 1) return HAL_ERROR_KEYSTORE_ACCESS; offset = 0; memcpy(&db.wheel_pin, page_buf + offset, sizeof(db.wheel_pin)); offset += sizeof(db.wheel_pin); memcpy(&db.so_pin, page_buf + offset, sizeof(db.so_pin)); offset += sizeof(db.so_pin); memcpy(&db.user_pin, page_buf + offset, sizeof(db.user_pin)); /* * Now read out all the keys. This is a temporary hack, in the long * run we want to pull these as they're needed, although depending * on how we organize the flash we might still need an initial scan * on startup to build some kind of in-memory index. */ for (int i = 0; i < sizeof(db.keys) / sizeof(*db.keys); i++) { if ((offset = _get_key_offset(i)) > KEYSTORE_SECTOR_SIZE) { idx++; continue; } offset += active_sector_offset; if (keystore_read_data(offset, page_buf, sizeof(page_buf)) != 1) return HAL_ERROR_KEYSTORE_ACCESS; const hal_ks_key_t *key = (const hal_ks_key_t *) page_buf; if (key->in_use == 0xff) { /* unprogrammed data */ idx++; continue; } if (key->in_use == 1) { uint8_t *dst = (uint8_t *) &db.keys[idx]; uint32_t to_read = sizeof(*db.keys); /* We already have the first page in page_buf. Put it into place. */ memcpy(dst, page_buf, sizeof(page_buf)); to_read -= sizeof(page_buf); dst += sizeof(page_buf); /* Read as many more full pages as possible */ if (keystore_read_data (offset + KEYSTORE_PAGE_SIZE, dst, to_read & ~PAGE_SIZE_MASK) != 1) return HAL_ERROR_KEYSTORE_ACCESS; dst += to_read & ~PAGE_SIZE_MASK; to_read &= PAGE_SIZE_MASK; if (to_read) { /* Partial last page. We can only read full pages so load it into page_buf. */ if (keystore_read_data(offset + sizeof(*db.keys) - to_read, page_buf, sizeof(page_buf)) != 1) return HAL_ERROR_KEYSTORE_ACCESS; memcpy(dst, page_buf, to_read); } } idx++; } db.ks.driver = hal_ks_token_driver; return LIBHAL_OK; } static hal_error_t _write_data_to_flash(const uint32_t offset, const uint8_t *data, const size_t len) { uint8_t page_buf[KEYSTORE_PAGE_SIZE]; uint32_t to_write = len; if (keystore_write_data(offset, data, to_write & ~PAGE_SIZE_MASK) != 1) return HAL_ERROR_KEYSTORE_ACCESS; to_write &= PAGE_SIZE_MASK; if (to_write) { /* * Use page_buf to write the remaining bytes, since we must write a full page each time. */ memset(page_buf, 0xff, sizeof(page_buf)); memcpy(page_buf, data + len - to_write, to_write); if (keystore_write_data((offset + len) & ~PAGE_SIZE_MASK, page_buf, sizeof(page_buf)) != 1) return HAL_ERROR_KEYSTORE_ACCESS; } return LIBHAL_OK; } /* * Write the full DB to flash, PINs and all. */ static hal_error_t _write_db_to_flash(const uint32_t sector_offset) { hal_error_t status; uint8_t page_buf[KEYSTORE_PAGE_SIZE]; uint32_t i, offset; if (sizeof(db.wheel_pin) + sizeof(db.so_pin) + sizeof(db.user_pin) > sizeof(page_buf)) return HAL_ERROR_BAD_ARGUMENTS; /* Put the three PINs into page_buf */ offset = 0; memcpy(page_buf + offset, &db.wheel_pin, sizeof(db.wheel_pin)); offset += sizeof(db.wheel_pin); memcpy(page_buf + offset, &db.so_pin, sizeof(db.so_pin)); offset += sizeof(db.so_pin); memcpy(page_buf + offset, &db.user_pin, sizeof(db.user_pin)); /* Write PINs into the second of the two reserved pages at the start of the sector. */ offset = sector_offset + KEYSTORE_PAGE_SIZE; if ((status = _write_data_to_flash(offset, page_buf, sizeof(page_buf))) != LIBHAL_OK) return status; for (i = 0; i < sizeof(db.keys) / sizeof(*db.keys); i++) { offset = _get_key_offset(i); if (offset > KEYSTORE_SECTOR_SIZE) return HAL_ERROR_BAD_ARGUMENTS; offset += sector_offset; if ((status =_write_data_to_flash(offset, (uint8_t *) &db.keys[i], sizeof(*db.keys))) != LIBHAL_OK) return status; } return LIBHAL_OK; } static hal_error_t ks_open(const hal_ks_driver_t * const driver, hal_ks_t **ks) { hal_error_t err; if (driver != hal_ks_token_driver || ks == NULL) return HAL_ERROR_BAD_ARGUMENTS; if ((err = ks_init()) != LIBHAL_OK) return err; *ks = &db.ks; return LIBHAL_OK; } static hal_error_t ks_close(hal_ks_t *ks) { if (ks != NULL && ks != &db.ks) return HAL_ERROR_BAD_ARGUMENTS; return LIBHAL_OK; } static inline int acceptable_key_type(const hal_key_type_t type) { switch (type) { case HAL_KEY_TYPE_RSA_PRIVATE: case HAL_KEY_TYPE_EC_PRIVATE: case HAL_KEY_TYPE_RSA_PUBLIC: case HAL_KEY_TYPE_EC_PUBLIC: return 1; default: return 0; } } static inline hal_ks_key_t *find(const hal_uuid_t * const name) { assert(name != NULL); for (int i = 0; i < sizeof(db.keys)/sizeof(*db.keys); i++) if (db.keys[i].in_use && hal_uuid_cmp(&db.keys[i].name, name) == 0) return &db.keys[i]; return NULL; } static hal_error_t ks_fetch(hal_ks_t *ks, hal_pkey_slot_t *slot, uint8_t *der, size_t *der_len, const size_t der_max) { if (ks != &db.ks || slot == NULL) return HAL_ERROR_BAD_ARGUMENTS; const hal_ks_key_t * const k = find(&slot->name); if (k == NULL) return HAL_ERROR_KEY_NOT_FOUND; slot->type = k->type; slot->curve = k->curve; slot->flags = k->flags; if (der == NULL && der_len != NULL) *der_len = k->der_len; if (der != NULL) { uint8_t kek[KEK_LENGTH]; size_t kek_len, der_len_; hal_error_t err; if (der_len == NULL) der_len = &der_len_; *der_len = der_max; if ((err = hal_get_kek(kek, &kek_len, sizeof(kek))) == LIBHAL_OK) err = hal_aes_keyunwrap(NULL, kek, kek_len, k->der, k->der_len, der, der_len); memset(kek, 0, sizeof(kek)); if (err != LIBHAL_OK) return err; } return LIBHAL_OK; } static hal_error_t ks_list(hal_ks_t *ks, hal_pkey_info_t *result, unsigned *result_len, const unsigned result_max) { if (ks != &db.ks || result == NULL || result_len == NULL) return HAL_ERROR_BAD_ARGUMENTS; *result_len = 0; for (int i = 0; i < sizeof(db.keys)/sizeof(*db.keys); i++) { if (!db.keys[i].in_use) continue; if (*result_len == result_max) return HAL_ERROR_RESULT_TOO_LONG; result[*result_len].type = db.keys[i].type; result[*result_len].curve = db.keys[i].curve; result[*result_len].flags = db.keys[i].flags; result[*result_len].name = db.keys[i].name; ++ *result_len; } return LIBHAL_OK; } /* * This function in particular really needs to be rewritten to take * advantage of the new keystore API. */ static hal_error_t ks_store(hal_ks_t *ks, const hal_pkey_slot_t * const slot, const uint8_t * const der, const size_t der_len) { if (ks != &db.ks || slot == NULL || der == NULL || der_len == 0 || !acceptable_key_type(slot->type)) return HAL_ERROR_BAD_ARGUMENTS; if (find(&slot->name) != NULL) return HAL_ERROR_KEY_NAME_IN_USE; int loc = -1; for (int i = 0; i < sizeof(db.keys)/sizeof(*db.keys); i++) if (!db.keys[i].in_use && loc < 0) loc = i; if (loc < 0) return HAL_ERROR_NO_KEY_SLOTS_AVAILABLE; hal_ks_key_t k; memset(&k, 0, sizeof(k)); k.der_len = sizeof(k.der); uint8_t kek[KEK_LENGTH]; size_t kek_len; hal_error_t err; if ((err = hal_get_kek(kek, &kek_len, sizeof(kek))) == LIBHAL_OK) err = hal_aes_keywrap(NULL, kek, kek_len, der, der_len, k.der, &k.der_len); memset(kek, 0, sizeof(kek)); if (err != LIBHAL_OK) return err; k.name = slot->name; k.type = slot->type; k.curve = slot->curve; k.flags = slot->flags; uint8_t page_buf[KEYSTORE_PAGE_SIZE]; uint32_t offset = _get_key_offset(loc); if (offset > KEYSTORE_SECTOR_SIZE) return HAL_ERROR_BAD_ARGUMENTS; uint32_t active_sector_offset = _active_sector_offset(); offset += active_sector_offset; if (keystore_check_id() != 1) return HAL_ERROR_KEYSTORE_ACCESS; /* * Check if there is a key occupying this slot in the flash already. * This includes the case where we've zeroed a former key without * erasing the flash sector, so we have to check the flash itself, * we can't just look at the in-memory representation. */ if (keystore_read_data(offset, page_buf, sizeof(page_buf)) != 1) return HAL_ERROR_KEYSTORE_ACCESS; const int unused_since_erasure = ((hal_ks_key_t *) page_buf)->in_use == 0xFF; db.keys[loc] = k; db.keys[loc].in_use = 1; if (unused_since_erasure) { /* * Key slot was unused in flash, so we can just write the new key there. */ if ((err = _write_data_to_flash(offset, (uint8_t *) &k, sizeof(k))) != LIBHAL_OK) return err; } else { /* * Key slot in flash has been used. We should be more clever than * this, but for now we just rewrite the whole freaking keystore. */ /* TODO: Erase and write the database to the inactive sector, and then toggle active sector. */ if (keystore_erase_sectors(active_sector_offset / KEYSTORE_SECTOR_SIZE, active_sector_offset / KEYSTORE_SECTOR_SIZE) != 1) return HAL_ERROR_KEYSTORE_ACCESS; if ((err =_write_db_to_flash(active_sector_offset)) != LIBHAL_OK) return err; } return LIBHAL_OK; } static hal_error_t ks_delete(hal_ks_t *ks, const hal_pkey_slot_t * const slot) { if (ks != &db.ks || slot == NULL) return HAL_ERROR_BAD_ARGUMENTS; hal_ks_key_t *k = find(&slot->name); if (k == NULL) return HAL_ERROR_KEY_NOT_FOUND; const int loc = k - db.keys; uint32_t offset = _get_key_offset(loc); if (loc < 0 || offset > KEYSTORE_SECTOR_SIZE) return HAL_ERROR_IMPOSSIBLE; offset += _active_sector_offset(); memset(k, 0, sizeof(*k)); /* * Setting bits to 0 never requires erasing flash. Just write it. */ return _write_data_to_flash(offset, (uint8_t *) k, sizeof(*k)); } const hal_ks_driver_t hal_ks_token_driver[1] = {{ ks_open, ks_close, ks_store, ks_fetch, ks_delete, ks_list }}; /* * The remaining functions aren't really part of the keystore API per se, * but they all involve non-key data which we keep in the keystore * because it's the flash we've got. */ hal_error_t hal_get_pin(const hal_user_t user, const hal_ks_pin_t **pin) { if (pin == NULL) return HAL_ERROR_BAD_ARGUMENTS; hal_error_t err; if ((err = ks_init()) != LIBHAL_OK) return err; switch (user) { case HAL_USER_WHEEL: *pin = &db.wheel_pin; break; case HAL_USER_SO: *pin = &db.so_pin; break; case HAL_USER_NORMAL: *pin = &db.user_pin; break; default: return HAL_ERROR_BAD_ARGUMENTS; } /* * If we were looking for the WHEEL PIN and it appears to be * completely unset, return the compiled-in last-gasp PIN. This is * a terrible answer, but we need some kind of bootstrapping * mechanism. Feel free to suggest something better. */ uint8_t u00 = 0x00, uFF = 0xFF; for (int i = 0; i < sizeof((*pin)->pin); i++) { u00 |= (*pin)->pin[i]; uFF &= (*pin)->pin[i]; } for (int i = 0; i < sizeof((*pin)->salt); i++) { u00 |= (*pin)->salt[i]; uFF &= (*pin)->salt[i]; } if (user == HAL_USER_WHEEL && ((u00 == 0x00 && (*pin)->iterations == 0x00000000) || (uFF == 0xFF && (*pin)->iterations == 0xFFFFFFFF))) *pin = &hal_last_gasp_pin; return LIBHAL_OK; } hal_error_t hal_set_pin(const hal_user_t user, const hal_ks_pin_t * const pin) { uint32_t active_sector_offset; if (pin == NULL) return HAL_ERROR_BAD_ARGUMENTS; hal_ks_pin_t *p = NULL; switch (user) { case HAL_USER_WHEEL: p = &db.wheel_pin; break; case HAL_USER_SO: p = &db.so_pin; break; case HAL_USER_NORMAL: p = &db.user_pin; break; default: return HAL_ERROR_BAD_ARGUMENTS; } memcpy(p, pin, sizeof(*p)); active_sector_offset = _active_sector_offset(); /* TODO: Could check if the PIN is currently all 0xff, in which case we wouldn't have to * erase and re-write the whole DB. */ /* TODO: Erase and write the database to the inactive sector, and then toggle active sector. */ if (keystore_erase_sectors(active_sector_offset / KEYSTORE_SECTOR_SIZE, active_sector_offset / KEYSTORE_SECTOR_SIZE) != 1) return HAL_ERROR_KEYSTORE_ACCESS; return _write_db_to_flash(active_sector_offset); } hal_error_t hal_get_kek(uint8_t *kek, size_t *kek_len, const size_t kek_max) { if (kek == NULL || kek_len == NULL || kek_max < bitsToBytes(128)) return HAL_ERROR_BAD_ARGUMENTS; const size_t len = ((kek_max < bitsToBytes(192)) ? bitsToBytes(128) : (kek_max < bitsToBytes(256)) ? bitsToBytes(192) : bitsToBytes(256)); hal_error_t err = masterkey_volatile_read(kek, len); if (err == LIBHAL_OK) { *kek_len = len; return LIBHAL_OK; } if (masterkey_flash_read(kek, len) == LIBHAL_OK) { *kek_len = len; return LIBHAL_OK; } /* * Both keystores returned an error, probably HAL_ERROR_MASTERKEY_NOT_SET. * I could try to be clever and compare the errors, but really the volatile * keystore is the important one (you shouldn't store the master key in * flash), so return that error. */ return err; } /* * Local variables: * indent-tabs-mode: nil * End: */ _hal_i2c.c?id=4a38cf6f44d1c013cbe794093ea6c5b50337431a'>4a38cf6
1
2
3
4
5
6
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368