1 2017-11-17 NIIBE Yutaka <gniibe@fsij.org>
3 * src/stack-def.h (SIZE_0): Increase.
5 * src/main.c (emit_led, display_status_code, main): Use
6 eventflag_wait_timeout instead of chopstx_usec_wait.
8 2017-11-17 NIIBE Yutaka <gniibe@fsij.org>
10 * regnual/regnual.c (calc_crc32): Enable CRC module.
12 * src/neug.c (crc32_rv_stop): New.
13 (neug_fini): Call crc32_rv_stop.
15 * src/main.c (main): Call chopstx_conf_idle.
17 * src/usb-ccid.c (usb_event_handle): Use 2 for call of
18 chopstx_conf_idle on suspend. Call random_fini on suspend
19 to stop ADC module. Call random_init on wakeup.
20 Sleep a bit to switch main thread.
22 2017-11-16 NIIBE Yutaka <gniibe@fsij.org>
24 * src/gnuk.h (LED_OFF): New.
26 * src/usb-ccid.c (usb_event_handle): LED off on sleep.
27 (ccid_thread): Use constant pointer for chopstx_poll.
28 (poll_event_intr): Remove.
30 2017-11-15 NIIBE Yutaka <gniibe@fsij.org>
32 * src/usb-ccid.c (usb_event_handle): Allow sleep on suspend.
34 * src/usb_ctrl.c (usb_device_reset): Fix device state.
36 2017-11-14 NIIBE Yutaka <gniibe@fsij.org>
38 * src/usb-ccid.c (ccid_usb_reset): Remove
39 (usb_event_handle): Return value change to notify
40 caller about needs for going out of the loop.
41 Support USB suspend/resume.
42 (ccid_thread): Supporting USB suspend, sleep forever with
45 * src/main.c (main): Add USB_DEVICE_STATE_ prefix.
46 * src/usb_ctrl.c: Likewise.
47 (usb_device_reset): Don't call ccid_usb_reset.
48 (usb_set_configuration, usb_set_interface): Likewise.
50 * src/usb_desc.c (device_desc): bcdUSB = 2.0, supporting
53 2017-11-13 NIIBE Yutaka <gniibe@fsij.org>
55 * src/usb_ctrl.c: Use new const USB_DEVICE_STATE_*
56 * src/main.c (main): Likewise.
57 * src/usb-ccid.c: Likewise.
58 (INTR_REQ_USB): Remove. Use the definition
61 2017-11-08 NIIBE Yutaka <gniibe@fsij.org>
63 * src/openpgp-do.c (gpg_do_kdf_check): New.
64 (proc_resetting_code): Use gpg_do_kdf_check.
65 * src/openpgp.c (cmd_verify, cmd_change_password)
66 (cmd_reset_user_password): Likewise.
68 2017-11-07 NIIBE Yutaka <gniibe@fsij.org>
70 * src/openpgp-do.c (proc_resetting_code): Error when
73 * src/openpgp.c (cmd_verify, cmd_change_password)
74 (cmd_reset_user_password): Avoid authentication error
75 by old GnuPG which doesn't support KDF.
77 2017-11-06 NIIBE Yutaka <gniibe@fsij.org>
79 * tests/test_empty_card.py (test_extended_capabilities): Support
81 * test/features/802_get_data_static.feature: Likewise.
82 * test/features/402_get_data_static.feature: Likewise.
83 * test/features/002_get_data_static.feature: Likewise.
85 2017-11-02 NIIBE Yutaka <gniibe@fsij.org>
87 * src/openpgp-do.c (rw_kdf): Only writable when no keys.
88 (gpg_do_get_initial_pw_setting): New.
89 (gpg_do_write_prvkey): Use gpg_do_get_initial_pw_setting.
90 (gpg_do_keygen): Likewise.
91 (extended_capabilities): Enable KDF-DO available bit.
93 * src/openpgp.c (cmd_change_password): Use
94 gpg_do_get_initial_pw_setting.
95 * src/ac.c (verify_user_0, verify_admin_0): Likewise.
97 2017-11-01 NIIBE Yutaka <gniibe@fsij.org>
99 * src/openpgp-do.c (GPG_DO_KDF): New.
100 (GPG_DO_FEATURE_MNGMNT): New.
101 (do_tag_to_nr): Support GPG_DO_KDF.
102 (GPG_DO_UIF_SIG, GPG_DO_UIF_DEC, GPG_DO_UIF_AUT): New.
104 (gpg_do_table): Add an entry for GPG_DO_KDF.
106 * src/gnuk.h (NR_DO_KDF): New.
108 2017-10-31 NIIBE Yutaka <gniibe@fsij.org>
110 * src/openpgp-do.c (gpg_do_keygen): Bug fix for memory alignment.
112 2017-10-24 NIIBE Yutaka <gniibe@fsij.org>
114 * tests/card_reader.py (CardReader.ccid_power_on): Setting
115 PPS only for Gemalto GemPC reader.
117 2017-10-18 Aurelien Jarno <aurelien@aurel32.net>
119 * src/gnuk.ld.in: Fix keystore_pool size.
121 2017-10-12 Aurelien Jarno <aurelien@aurel32.net>
123 * polarssl/include/polarssl/bn_mul.h (MULADDC_HUIT_DEAD): Rename
125 [__ARM_FEATURE_DSP] (MULADDC_1024_CORE, MULADDC_1024_LOOP)
126 (MULADDC_INIT, MULADDC_CORE, MULADDC_HUIT, MULADDC_STOP): New.
128 * polarssl/library/bignum.c (mpi_montsqr): Check on
129 POLARSSL_HAVE_ASM and __arm__.
130 [__ARM_FEATURE_DSP] (mpi_montsqr): New.
132 (mpi_exp_mod): Use MAX_WSIZE.
134 * src/Makefile (DEFS): Remove BIGNUM_C_IMPLEMENTATION.
136 * src/main.c (HEAP_SIZE): Rename from MEMORY_SIZE.
137 (HEAP_END, HEAP_ALIGNMENT, HEAP_ALIGN): Likewise.
139 * src/stack-def.h (SIZE_3): Depend on MEMORY_SIZE.
140 * src/configure: Emit DEFS with MEMORY_SIZE.
142 2017-10-11 NIIBE Yutaka <gniibe@fsij.org>
146 * regnual/Makefile (LDSCRIPT): Move after include.
147 * regnual/types.h: Add uintptr_t.
149 * test/features/002_get_data_static.feature (data object AID): Fix
150 for any binary value.
151 * 402_get_data_static.feature: Likewise.
152 * 802_get_data_static.feature: Likewise.
154 2017-10-10 NIIBE Yutaka <gniibe@fsij.org>
156 * src/main.c (main): Support --debug option.
157 * chopstx: Update to 1.5.
159 2017-10-06 NIIBE Yutaka <gniibe@fsij.org>
161 * src/configure (flash_override): Fix suggested by Jeremy Drake.
162 (help): STM8S_DISCOVERY is supported again.
164 2017-10-06 NIIBE Yutaka <gniibe@fsij.org>
166 * src/gnuk.ld.in (.stacks): Specify NOLOAD type.
168 * src/configure: Allow not specifying VIDPID.
170 * src/main.c [GNU_LINUX_EMULATION] (main): Handle "--vidpid"
171 option to assign vendor ID and product ID of USB.
173 * src/usb_desc.c [GNU_LINUX_EMULATION] (device_desc): Export.
175 * GNUK_USB_DEVICE_ID (0000:0000): New.
177 2017-10-05 NIIBE Yutaka <gniibe@fsij.org>
179 * src/stack-def.h (SIZE_1, SIZE_3): Tweak the size.
181 * src/call-rsa.c (rsa_genkey): Single step.
182 * src/openpgp-do.c (gpg_do_keygen): Do RSA key generation in single
183 step, using APDU buffer.
184 * src/openpgp.c (cmd_pgp_gakp): Supply the APDU as a buffer.
186 * src/Makefile (install): New target.
188 * src/configure (prefix. exec_prefix, libexecdir): Add.
190 * src/main.c [GNU_LINUX_EMULATION] (main): Option handling.
192 * tool/gnuk-emulation-setup: New.
194 * polarssl/library/bignum.c (M_LIMBS, limbs_M, MAX_A_LIMBS)
195 (limbs_MAX_A, mpi_gen_prime): Fix for 64-bit machine.
197 2017-10-04 NIIBE Yutaka <gniibe@fsij.org>
199 * src/configure (output_vendor_product_serial_strings): Support
202 * polarssl/library/bignum.c (mpi_div_mpi): Fix for 64-bit machine.
204 * src/main.c (gnuk_malloc, gnuk_free): Fix for 64-bit machine.
206 * src/stack-def.h (SIZE_3): Tweak the size.
208 * src/openpgp-do.c (gpg_do_keygen): Do RSA key generation in two
211 * src/call-rsa.c (rsa_genkey_start, rsa_genkey_finish): New.
212 (rsa_genkey): Remove.
214 2017-10-03 NIIBE Yutaka <gniibe@fsij.org>
216 * src/call-ec.c (ecc_compute_public): No use of malloc.
217 * src/call-rsa.c (modulus_calc, rsa_genkey): Likewise.
218 * src/ecc-edwards.c (eddsa_compute_public_25519): Likewise.
219 * src/ecc-mont.c (ecdh_compute_public_25519): Likewise.
220 * src/openpgp-do.c (gpg_do_write_prvkey, gpg_do_chks_prvkey)
221 (proc_key_import, gpg_do_keygen): Likewise.
223 * polarssl/library/rsa.c: Don't include stdlib.h.
224 * src/gnuk-malloc.h: Rename from stdlib.h.
225 * polarssl/library/bignum.c: Include gnuk-malloc.h.
227 * src/Makefile (build/flash.data): Generate.
229 * src/main.c (flash_addr_key_storage_start)
230 (flash_addr_data_storage_start): New.
231 (main): Determine flash address.
233 * src/flash.c (FLASH_ADDR_KEY_STORAGE_START)
234 (FLASH_ADDR_DATA_STORAGE_START): New.
235 (flash_do_storage_init, flash_terminate, flash_activate)
236 (flash_key_storage_init, flash_copying_gc, flash_do_release)
237 (flash_key_getpage): Use new macros.
239 2017-10-02 NIIBE Yutaka <gniibe@fsij.org>
241 * src/main.c (device_initialize_once): Not for GNU/Linux.
243 * src/openpgp.c, src/flash.c: Distinguish FLASH_UPGRADE_SUPPORT.
245 * src/main.c [GNU_LINUX_EMULATION]: Use emulated_main.
246 (MEMORY_SIZE, MEMORY_END): Fix for GNU/Linux.
248 * src/usb-ccid.c (INTR_REQ_USB): Fix for GNU/Linux.
250 * polarssl/library/bignum.c (mpi_montsqr): Easy C implementation.
252 2017-09-30 NIIBE Yutaka <gniibe@fsij.org>
254 * src/flash.c (flash_terminate, flash_activate)
255 (flash_copying_gc, flash_do_write_internal, flash_do_release)
256 (flash_key_write, flash_check_all_other_keys_released)
257 (flash_key_fill_zero_as_released, flash_key_release)
258 (flash_key_release_page, flash_clear_halfword)
259 (flash_put_data_internal, flash_put_data, flash_bool_clear)
260 (flash_bool_write_internal, flash_bool_write)
261 (flash_enum_write_internal, flash_enum_write)
262 (flash_cnt123_write_internal, flash_cnt123_increment)
263 (flash_cnt123_clear, flash_erase_binary, flash_write_binary): Fix
266 * src/usb-ccid.c (ccid_tx_done): Rename from EP1_IN_Callback.
267 (ccid_rx_ready): Rename from EP1_OUT_Callback.
269 2017-09-29 NIIBE Yutaka <gniibe@fsij.org>
271 * src/usb-ccid.c (epo_init, epi_init, ccid_thread): Simplify.
272 (EP1_IN_Callback, ccid_prepare_receive, EP1_OUT_Callback)
273 (usb_rx_ready, ccid_error, ccid_power_on, ccid_send_status)
274 (ccid_send_data_block_internal, ccid_send_data_block_0x9000)
275 (ccid_send_data_block_gr, ccid_send_params)
276 (ccid_notify_slot_change, _write) [GNU_LINUX_EMULATION]: Use
277 different usb driver API.
279 * src/usb_ctrl.c (usb_device_reset): Fix control endpoint init.
280 (gnuk_setup_endpoints_for_interface): Add DEV
282 (usb_device_reset) [GNU_LINUX_EMULATION]: Use usb_lld_setup_endp.
284 2017-09-29 NIIBE Yutaka <gniibe@fsij.org>
286 * src/main.c [FLASH_UPGRADE_SUPPORT] (main): Factor out flash ROM
288 (calculate_regnual_entry_address): Likewise.
289 * src/usb_ctrl.c (usb_setup, download_check_crc32): Likewise.
291 * src/openpgp.c (modify_binary): Fix for 64-bit machine.
292 * src/openpgp-do.c (encrypt, decrypt): Likewise.
293 (gpg_data_scan): Likewise.
294 (gpg_do_chks_prvkey): Fix error return path.
296 * src/stack-def.h: New.
298 * src/gnuk.ld.in: Remove stack definitions.
299 * src/configure: Remove stack size modifications.
301 * src/main.c (STACK_MAIN, STACK_PROCESS_1): Use stack-def.h.
302 * src/usb-ccid.c (STACK_PROCESS_3): Likewise.
303 * src/usb-msc.c (STACK_PROCESS_5): Likewise.
304 * src/pin-cir.c (STACK_PROCESS_6, STACK_PROCESS_7): Likewise.
306 * src/usb_ctrl.c (download_check_crc32): Use chrc32_rv_ functions.
308 * src/mcu-stm32f103.c (rbit, check_crc32): Remove.
310 * src/neug.c: Update from NeuG.
313 2017-09-28 NIIBE Yutaka <gniibe@fsij.org>
315 * src/ec_p256k1.c (coefficient_a): Remove.
317 * polarssl/library/bignum.c (mpi_fill_pseudo_random): Fix for
320 * src/call-rsa.c (rsa_decrypt): Fix for 64-bit machine.
322 * src/flash.c (flash_do_storage_init): Rename from flash_init.
323 (flash_key_storage_init): Rename from flash_init_keys.
324 * src/openpgp.c (gpg_init): Use new function names.
326 * src/stdlib.h: Update for GNU/Linux emulation.
328 * src/Makefile: Support GNU/Linux emulation.
329 * src/configure: Support GNU/Linux emulation.
332 2017-08-11 NIIBE Yutaka <gniibe@fsij.org>
335 * chopstx: Update to 1.4.
337 * src/gnuk.ld.in (__process3_stack_size__): Tweak the size.
339 * src/configure: Define STM32F103_OVERRIDE_FLASH_SIZE_KB for
342 * src/configure: Let generate src/config.mk.
343 * src/Makefile: Rename from src/Makefile.in.
344 * regnual/Makefile: Use src/config.mk.
346 2017-08-03 NIIBE Yutaka <gniibe@fsij.org>
348 * src/openpgp.c (cmd_terminate_df): Fix for admin-less mode.
350 2017-08-03 Jeremy Drake <jeremydrake+gnuk@eacceleration.com>
352 * regnual/regnual.c (main): Allow compile time
353 flash size definition by STM32F103_OVERRIDE_FLASH_SIZE_KB.
355 2017-08-02 Jeremy Drake <jeremydrake+gnuk@eacceleration.com>
357 * src/flash.c (flash_terminate): Erase Certificate DO, too.
359 2017-08-01 NIIBE Yutaka <gniibe@fsij.org>
361 * src/openpgp.c (FILE_CARD_TERMINATED_OPENPGP): Remove.
362 (cmd_select_file): Don't change file_selection.
364 2017-07-19 NIIBE Yutaka <gniibe@fsij.org>
366 * src/mod.c (mod_inv): Clear TMP.
368 * src/configure (REVISION): Generate even when no git.
370 * polarssl/library/bignum.c (mpi_exp_mod): Call mpi_grow for X
371 after the initialization of RR.
373 2017-07-18 NIIBE Yutaka <gniibe@fsij.org>
375 * src/configure: Bark when no git available.
377 2017-07-18 Anthony Romano <anthony.romano@coreos.com>
381 2017-07-18 Anthony Romano <anthony.romano@coreos.com>
383 * src/main.c (MEMORY_SIZE, MEM_HEAD_IS_CORRUPT, MEM_HEAD_CHECK):
385 (gnuk_malloc, gnuk_free): Add calls to MEM_HEAD_CHECK.
387 * src/gnuk.h (FATAL_HEAP): New.
389 2017-07-18 Anthony Romano <anthony.romano@coreos.com>
391 * src/openpgp-do.c (gpg_reset_algo_attr): New.
392 (rw_algorithm_attr): Use gpg_reset_algo_attr.
393 Fix null dereference.
395 2017-07-18 Anthony Romano <anthony.romano@coreos.com>
397 * src/mod.c (mod_reduce): Clean up unused code.
399 2017-07-18 Anthony Romano <anthony.romano@coreos.com>
401 * src/call-rsa.c (modulus_calc): Free modulus on error.
402 (rsa_genkey): Remove bogus check, and call chopstx_cleanup_pop
403 with 1 to release p_q_modulus on error. Assign NULL to clp.arg
404 when it's goes with no error.
406 * src/main.c (gnuk_free): Allow NULL.
408 2017-07-18 NIIBE Yutaka <gniibe@fsij.org>
410 * Update chopstx (with USBIP emulation).
412 2017-05-12 NIIBE Yutaka <gniibe@fsij.org>
416 2017-04-28 NIIBE Yutaka <gniibe@fsij.org>
418 * src/mcu-stm32f103.c: New.
419 (check_crc32, sram_address): New.
421 * src/usb_ctrl.c (download_check_crc32): Use check_crc32 and
424 * src/openpgp-do.c (gpg_write_digital_signature_counter): Fix
425 writing lower 10-bit.
427 2017-04-27 NIIBE Yutaka <gniibe@fsij.org>
429 * src/gnuk.ld.in (_data_pool): Move to the end.
431 * src/flash.c (flash_init): Return address of end of data object.
432 * src/openpgp.c (gpg_init): Get address of end of data object.
433 * src/openpgp-do.c (gpg_data_scan): Check the end address.
435 2017-02-02 NIIBE Yutaka <gniibe@fsij.org>
439 * src/gnuk.ld.in (__process1_stack_size__): Increase by 0x20.
440 * chopstx: Update to 1.3.
441 * src/configure: Add BLUE_PILL in the help message.
443 2017-02-01 NIIBE Yutaka <gniibe@fsij.org>
445 * README: Update README. Thanks to Paul Fertser.
447 2017-01-02 Szczepan Zalega <szczepan@nitrokey.com>
449 * tool/upgrade_by_passwd.py: Add file extention check.
451 2017-02-01 NIIBE Yutaka <gniibe@fsij.org>
453 * tool/upgrade_by_passwd.py (main): More verbose messages
454 suggested by Szczepan Zalega <szczepan@nitrokey.com>.
456 * tool/gnuk_token.py (USB_PRODUCT_LIST): New.
457 (gnuk_devices_by_vidpid): Support searching by USB_PRODUCT_LIST.
458 Thanks to Szczepan Zalega <szczepan@nitrokey.com>.
460 * tool/usb_strings.py: Use gnuk_token.py.
462 2016-10-21 Niibe Yutaka <gniibe@fsij.org>
464 * src/ecc.c (check_secret): Fix condition.
466 2016-10-15 NIIBE Yutaka <gniibe@fsij.org>
470 * tool/gnuk_put_binary_libusb.py (main): Likewise.
471 * tool/upgrade_by_passwd.py (main): Add call of cmd_select_openpgp
474 * src/openpgp.c (gpg_init): flash_init_keys shoule be after
475 gpg_data_scan since flash_init_keys accesses Data Object for
478 * src/usb-ccid.c (ccid_power_on): Don't waste stack.
480 2016-10-14 Niibe Yutaka <gniibe@fsij.org>
482 * src/usb-ccid.c (ccid_power_on) [LIFE_CYCLE_MANAGEMENT_SUPPORT]:
483 Change LCS value in ATR at run time.
485 * src/openpgp.c (gpg_init): Handle FILE_CARD_TERMINATED.
486 (cmd_select_file): Don't return AID.
487 (cmd_activate_file, cmd_terminate_df): New.
488 (process_command_apdu): Let return GPG_NO_RECORD() when
491 * src/openpgp-do.c (gpg_do_terminate): New.
492 (gpg_data_scan): Handle p_start is NULL.
493 (do_hist_bytes): Remove.
495 * src/flash.c (flash_data): Change the value from 0x0000.
496 (flash_init): Support termination state. Fix handling
497 of the boundary case where gen0 is 0xfffe.
498 (flash_terminate, flash_activate): New.
499 (flash_copying_gc): Skip 0xffff for generation number.
501 2016-10-13 Niibe Yutaka <gniibe@fsij.org>
503 * src/status-code.h: Rename from openpgp.h.
505 * chopstx: Update to 1.2.
507 * tests: New test suite for OpenPGP card with PyTest.
509 * src/configure (factory_reset): New.
511 * src/usb-ccid.c (ccid_power_on): Use ATR_head and historical
514 * src/openpgp-do.c (rw_algorithm_attr): Clear fingerprint, timestamp,
515 and possibly ds_counter.
517 2016-10-12 Niibe Yutaka <gniibe@fsij.org>
519 * test/features/steps.py (cmd_reset_retry_counter): Fix.
520 * tool/gnuk_token.py (gnuk_token.cmd_reset_retry_counter): Fix.
521 (gnuk_token.cmd_select_openpgp): Fix P2.
523 2016-09-02 Niibe Yutaka <gniibe@fsij.org>
525 * src/configure (REVISION): Fix the detection of .git.
526 It may be a regular file (if it's created by worktree).
528 2016-08-24 Niibe Yutaka <gniibe@fsij.org>
530 * test/features/steps.py (ini): Use GLC (the global context),
531 instead of FTC (the feature context), so that token only is
534 2016-08-03 Niibe Yutaka <gniibe@fsij.org>
536 * tool/hub_ctrl.py: Port to Python 3.
538 2016-07-11 NIIBE Yutaka <gniibe@fsij.org>
542 * src/usb-ccid.c (ccid_power_on): Fix call of chopstx_create.
543 * src/usb-msc.c (msc_init): Ditto.
544 * src/pin-cir.c (cir_init): Ditto.
545 * src/neug.c (neug_init): Ditto.
546 * src/main.c (main): Ditto.
548 * src/usb-ccid.c (struct ccid): Arrange for smaller footprint.
549 * src/gnuk.h (struct apdu): Likewise.
551 * src/usb-ccid.c (ccid_card_change_signal): Don't touch ccid_state_p.
552 (ccid_state_p): This is constant.
554 * src/configure (output_vendor_product_serial_strings): Add const
557 * src/usb-ccid.c (epo_init, epi_init): Simplify without notify method.
558 (EP1_IN_Callback, EP1_OUT_Callback): Call notify_tx and notify_icc
561 2016-07-09 NIIBE Yutaka <gniibe@fsij.org>
563 * src/openpgp.c (openpgp_card_thread): Don't need to get SELF.
565 2016-07-06 NIIBE Yutaka <gniibe@fsij.org>
567 * src/pin-cir.c (cir_getchar): Use chopstx_poll.
568 * src/usb-ccid.c (usb_tx_done): Fix ifdef condition.
569 * src/usb_ctrl.c (usb_ctrl_write_finish): Fix ifdef nesting.
571 2016-07-04 NIIBE Yutaka <gniibe@fsij.org>
573 * doc/conf.py: Remove 'sphinx.ext.pngmath' and 'sphinx.ext.mathjax'.
574 Reported by Kenji Rikitake.
576 2016-07-01 NIIBE Yutaka <gniibe@fsij.org>
578 * chopstx: Update to 1.1.
579 * src/usb-ccid.c (poll_event_intr, ccid_thread): Follow the
582 2016-06-21 Niibe Yutaka <gniibe@fsij.org>
584 * doc/index.rst: Update documentation by an example
587 2016-06-17 Niibe Yutaka <gniibe@fsij.org>
589 * chopstx: Update to 1.0.
591 2016-06-15 NIIBE Yutaka <gniibe@fsij.org>
593 * src/gnuk.ld.in (__process2_stack_size__): Update
594 thread size for rng by examining NeuG.
596 * src/usb-ccid.c (poll_event_intr): New.
598 2016-06-14 Niibe Yutaka <gniibe@fsij.org>
600 * regnual/regnual.c (usb_device_reset): Rename from
602 (usb_ctrl_write_finish): Rename from usb_cb_ctrl_write_finish.
603 (usb_setup): Rename from usb_cb_setup.
604 (usb_get_descriptor): Rename from usb_cb_get_descriptor.
605 (usb_set_configuration): New.
606 (usb_interrupt_handler): New.
608 * src/usb-ccid.c (usb_tx_done): Rename from usb_cb_tx_done.
609 (usb_rx_ready): Rename from usb_cb_rx_ready.
610 (usb_event_handle): New.
611 (ccid_thread): Use usb_event_handle.
613 * src/usb-msc.c (EP6_IN_Callback): Update to new USB API.
614 (EP6_OUT_Callback): Likewise.
616 * src/usb_ctrl.c (usb_device_reset): Rename from
618 (vcom_port_data_setup): Update to new USB API.
619 (usb_ctrl_write_finish): Rename from usb_cb_ctrl_write_finish.
620 (usb_setup): Rename from usb_cb_setup.
621 (usb_set_configuration): New, based on usb_cb_handle_event.
622 (usb_set_interface): Rename from usb_cb_interface.
623 (usb_get_interface): New.
624 (usb_get_status_interface): New.
626 * src/usb_desc.c (usb_get_descriptor): Rename from
627 usb_cb_get_descriptor.
629 2016-06-02 Niibe Yutaka <gniibe@fsij.org>
631 * regnual/regnual.c (usb_cb_tx_done): Follow the change of USB
634 * regnual/reset.c: Rename from sys.c.
636 2016-06-01 Niibe Yutaka <gniibe@fsij.org>
638 * tool/stlinkv2.py (stlinkv2.__init__): Don't
639 call setConfiguration.
641 * tool/gnuk_token.py (gnuk_token, regnual): Don't
642 call setAltInterface, it's not needed.
644 * src/usb-ccid.c (ccid_notify_slot_change): New.
645 (ccid_thread): Call ccid_notify_slot_change at
646 interface_reset and EV_CARD_CHANGE.
648 2016-05-31 NIIBE Yutaka <gniibe@fsij.org>
650 * src/usb_stm32f103.c, src/stm32f103.h: Remove.
651 * src/adc_stm32f103.c, src/sys.c: Remove.
653 * src/usb_ctrl.c (usb_cb_interface): call ccid_usb_reset.
654 (usb_cb_handle_event): Likewise.
656 * src/usb-ccid.c (ccid_thread): Handle RESET->CONFIGURE process
658 (ccid_thread): Handle SET_INTERFACE correctly.
660 * polarssl/library/aes.c (FT0, FT1, FT2): Add "weak" flag.
662 * src/neug.c: Update from NeuG.
664 * src/usb_desc.c (usb_cb_get_descriptor): Only valid if USE_SYS3.
666 * src/Makefile.in (USE_SYS, USE_USB, USE_ADC): Enabled.
669 * src/sys.c, src/sys.h: Remove.
670 * src/usb_stm32f103.c, src/usb_lld.h: Remove.
671 * src/adc_stm32f103.c, src/adc.h: Remove.
673 * chopstx: Update to 0.12.
675 2016-05-21 Niibe Yutaka <gniibe@fsij.org>
677 * src/main.c (led_blink, main): Fix LED blink protocol.
679 2016-05-20 NIIBE Yutaka <gniibe@fsij.org>
682 * src/usb-ccid.c (ccid_thread): Fix timeout.
683 (icc_handle_timeout, icc_send_status): Tweak.
685 2016-05-19 Niibe Yutaka <gniibe@fsij.org>
687 * src/usb_ctrl.c (usb_cb_ctrl_write_finish): Set bDeviceState.
689 * src/usb-ccid.c: Rename from usb-icc.c.
690 (ccid_thread): Handle reGNUal upgrade.
692 * src/Makefile.in (CSRC): Follow the change.
694 * chopstx: Update to 0.11.
696 2016-05-18 Niibe Yutaka <gniibe@fsij.org>
698 * src/gnuk.ld.in: Tweak thread size.
699 * src/main.c (main): Use chopstx_setpriority.
700 * src/usb-icc.c (ccid_init): Use new eventflag API.
702 * regnual/regnual.c (nvic_enable_intr): New.
703 (main): Call nvic_enable_intr.
707 2016-05-16 Niibe Yutaka <gniibe@fsij.org>
709 * regnual/regnual.c (usb_cb_rx_ready, usb_cb_tx_done)
710 (usb_cb_device_reset): Follow the change of USB API.
713 * src/sys.c: Update from Chopstx.
715 2016-05-13 Niibe Yutaka <gniibe@fsij.org>
717 * src/neug.c (rng): Call chopstx_claim_irq before adc_start.
718 Remove call of chopstx_release_irq.
720 2016-05-12 Niibe Yutaka <gniibe@fsij.org>
723 * src/sys.c: Update from Chopstx.
724 * src/usb_lld.h: Likewise.
725 * src/usb_stm32f103.c: Likewise.
727 * src/usb_ctrl.c (usb_intr): Follow the change of USB API.
728 (usb_cb_rx_ready, usb_cb_tx_done): Likewise.
730 * src/adc.h: Remove unused declarations.
732 2016-03-08 Niibe Yutaka <gniibe@fsij.org>
734 * tool/gnuk_token.py (gnuk_token.__init__, regnual.__init__):
735 Don't call setConfiguration method.
737 * src/usb_lld.h (usb_cb_ctrl_write_finish): Change the API of
738 callback, which possibly needs INDEX, VALUE, and LEN parameters.
739 (usb_lld_set_data_to_recv): Fix the type of P.
740 (USB_DEVICE_DESCRIPTOR_TYPE, USB_CONFIGURATION_DESCRIPTOR_TYPE)
741 (USB_STRING_DESCRIPTOR_TYPE, USB_INTERFACE_DESCRIPTOR_TYPE)
742 (USB_ENDPOINT_DESCRIPTOR_TYPE): Remove, as we have the enumeration
743 values for same things.
745 * src/usb_stm32f103.c (handle_in0): Follow the change.
746 * src/usb_ctrl.c (usb_cb_ctrl_write_finish): Likewise.
748 * src/usb_desc.c (usb_cb_get_descriptor): Use HID_INTERFACE.
749 (device_desc, config_desc, string_descriptors)
750 (usb_cb_get_descriptor): Use the enumeration types.
751 * src/configure: Use the enumeration types.
753 * regnual/regnual.c: Follow the change of usb_lld.h.
755 2016-02-09 Niibe Yutaka <gniibe@fsij.org>
757 * src/openpgp.c (cmd_verify): Support VERIFY reset, which is
758 described in the specification V2.2 and V3.1.
760 * polarssl/library/bignum.c (mpi_exp_mod): Fix to our local
761 change. Thanks to Aidan Thornton for the failure test case.
763 Fix of mpi_div_mpi from upstream.
764 * polarssl/library/bignum.c (int_clz, int_div_int): New.
765 (mpi_div_mpi): Use int_div_int.
767 2016-02-09 Niibe Yutaka <gniibe@fsij.org>
769 * src/openpgp.c (s2k): Include the unique ID of MCU into the
770 computation of S2K function.
772 2016-02-08 Niibe Yutaka <gniibe@fsij.org>
774 * src/modp256r1.c (modp256r1_add, modp256r1_sub): Keep the result
776 (modp256r1_reduce): Fix wrong calculation.
777 * src/modp256k1.c (modp256k1_add, modp256k1_sub): Likewise.
778 Thanks to Aidan Thornton.
780 2016-02-05 Niibe Yutaka <gniibe@fsij.org>
782 * src/configure: Add submodule check suggested by Elliott
785 2015-11-30 perillamint <perillamint@gentoo.moe>
787 * src/openpgp.c (card_thread): Fix offset of bConfirmPIN.
789 2015-09-18 Niibe Yutaka <gniibe@fsij.org>
793 * src/openpgp-do.c (proc_key_import): Fix error return.
794 (rw_algorithm_attr): Check it's not ALGO_RSA2K.
796 2015-09-17 Niibe Yutaka <gniibe@fsij.org>
800 2015-09-15 Niibe Yutaka <gniibe@fsij.org>
802 * chopstx: Update to 0.10.
804 * src/main.c (main): Don't join after calling ccid_usb_reset.
805 * src/usb-icc.c (ccid_thread): Don't finish on reset, but
808 * src/usb_ctrl.c (usb_cb_device_reset): Stop the interface.
810 * src/usb_stm32f103.c (std_set_interface): Bug fix for conf.
812 * src/gnuk.ld.in (__process3_stack_size__): Increase stack size of
814 (__process2_stack_size__): Increase stack size of RNG.
815 (__process4_stack_size__): Increase stack size of USB.
816 (__main_stack_size__): Decrease stack size of exception handlers.
817 (__process1_stack_size__): Decrease stack size of CCID.
819 2015-09-14 Niibe Yutaka <gniibe@fsij.org>
821 * src/gnuk.h (LED_GNUK_EXEC): New.
822 * src/main.c, src/usb-icc.c, src/usb_ctrl.c: icc_state_p access
825 2015-09-11 Niibe Yutaka <gniibe@fsij.org>
827 * tool/upgrade_by_passwd.py (main): Loop until finding reGNUal
830 2015-09-10 Niibe Yutaka <gniibe@fsij.org>
832 * src/call-rsa.c (rsa_cleanup): New.
833 (rsa_sign, rsa_decrypt, rsa_genkey): Allow cancellation.
834 * src/openpgp.c (cmd_pso, cmd_internal_authenticate): Cancellation
835 is handled by each functions in case of RSA.
837 2015-09-09 Niibe Yutaka <gniibe@fsij.org>
839 * src/sys.h: Update from Chopstx.
840 * src/adc_stm32f103.c: Update from NeuG.
842 * src/openpgp.c (process_command_apdu): Protect command execution
843 against cancelling the execution thread.
844 (cmd_pso, cmd_internal_authenticate): Allow cancellation.
846 * src/main.c (main): Handle LED_USB_RESET.
848 * src/usb-icc.c (ccid_usb_reset): New.
849 (ccid_thread): Upon receival of EV_USB_RESET, finish
850 the thread, canceling the card thread.
852 2015-09-08 Niibe Yutaka <gniibe@fsij.org>
854 * src/gnuk.h (EV_USB_RESET, LED_USB_RESET): New.
856 * src/usb_ctrl.c (CDC_CTRL_DTR): New.
857 (vcom_port_data_setup): Distinguish detail->value for DTR.
859 * src/configure (help): Add ST_DONGLE and ST_NUCLEO_F103.
861 2015-09-04 Niibe Yutaka <gniibe@fsij.org>
863 * src/openpgp-do.c (do_openpgpcard_aid): Use upper bytes of unique
864 ID of MCU; same as USB serial number.
866 * src/configure (help): Add NITROKEY_START.
868 2015-08-26 Mateusz Zalega <mateusz@nitrokey.com>
870 * GNUK_USB_DEVICE_ID: Add Nitrokey Start.
872 2015-08-05 Niibe Yutaka <gniibe@fsij.org>
876 2015-08-04 Niibe Yutaka <gniibe@fsij.org>
878 * src/adc_stm32f103.c: Update from NeuG 1.0.3.
880 * chopstx: Update to 0.08.
883 2015-08-03 Niibe Yutaka <gniibe@fsij.org>
885 * test/features/steps.py (set_msg): Python3 fix.
886 * test/generate_keys.py: Likewise.
887 * test/rsa_keys.py: Likewise.
889 * tool/gnuk_token.py (gnuk_token.download, gnuk_token.execute)
890 (regnual.download): Python3 fix.
891 (list_to_string): Remove.
893 * tool/upgrade_by_passwd.py (maian): Python3 fix.
894 * tool/usb_strings.py (main): Python3 fix.
896 2015-07-31 Niibe Yutaka <gniibe@fsij.org>
898 * src/configure (output_vendor_product_serial_strings): Fix sed
899 script when string is short. Remove empty line.
901 * regnual/regnual.c (usb_cb_ctrl_write_finish, usb_cb_setup)
902 (usb_cb_get_descriptor, usb_cb_interface): Follow the change
905 * tool/stlinkv2.py: Support ST-Link/V2-1.
907 2015-07-28 Niibe Yutaka <gniibe@fsij.org>
909 * tool/stlinkv2.py: Fix for Python3. Thanks to Bertrand Jacquin.
911 * tool/gpg_agent.py: Fix for Python3.
913 * src/usb-msc.c: Update from Fraucheky.
915 * src/usb_stm32f103.c (struct DATA_INFO): Remove offset.
916 (struct DEVICE_INFO): Integrate CONTROL_INFO.
918 2015-07-27 Niibe Yutaka <gniibe@fsij.org>
920 * src/usb_stm32f103.c (usb_lld_reply_request): New.
921 (usb_lld_set_data_to_send): Remove.
922 (usb_lld_set_data_to_recv): Not a macro but a function.
923 (std_get_status): Don't use statically allocated memory.
924 (std_get_configuration): Use usb_lld_reply_request.
925 (handle_setup0): Follow the change.
926 * src/usb_ctrl.c (vcom_port_data_setup, usb_cb_setup)
927 (usb_cb_interface): Use usb_lld_reply_request.
928 * src/usb_desc.c (usb_cb_get_descriptor): Likewise.
930 2015-07-24 Niibe Yutaka <gniibe@fsij.org>
932 * tool/gnuk_put_binary.py: Remove.
933 * tool/gnuk_remove_keys.py: Remove.
935 2015-07-23 Niibe Yutaka <gniibe@fsij.org>
937 * src/configure (nl): New. Follow the change of NeuG.
939 2015-07-21 Niibe Yutaka <gniibe@fsij.org>
943 2015-07-20 Niibe Yutaka <gniibe@fsij.org>
945 * src/openpgp-do.c (gpg_do_keygen): Support ECC.
946 * src/call-ec.c (ecc_check_secret): New.
947 * src/ecc.c (check_secret): New.
949 2015-07-18 Niibe Yutaka <gniibe@fsij.org>
951 * src/configure (keygen): It's always enabled.
952 * src/openpgp-do.c (gpg_do_keygen): Support key generation.
953 * src/openpgp.c (cmd_pgp_gakp): Likewise.
954 * src/call-rsa.c (rsa_genkey): Likewise.
955 * src/random.c (random_gen): Likewise.
956 * src/Makefile.in (KEYGEN_SUPPORT): Remove.
957 * polarssl/include/polarssl/config.h (POLARSSL_GENPRIME): Define.
959 2015-07-16 Niibe Yutaka <gniibe@fsij.org>
961 * src/configure (FLASH_PAGE_SIZE, FLASH_SIZE, MEMORY_SIZE)
962 [sys1_compat]: Use safe values for common binary.
963 (TARGET_DEFINE): Remove.
965 2015-07-15 Niibe Yutaka <gniibe@fsij.org>
967 * tool/usb_strings.py (field): Add 'Board'.
969 * regnual/regnual.c (usb_cb_get_descriptor): Update.
970 * src/usb_ctrl.c (usb_cb_interface): Call usb_lld_write.
971 * src/usb_desc.c (usb_cb_get_descriptor): Support sys_board_name,
973 * src/usb_lld.h (usb_cb_get_descriptor): Add last argument length
975 * src/usb_stm32f103.c (handle_setup0): Allow setup callback to
976 call usb_lld_write with ENDP0.
977 * src/usb_conf.h (NUM_STRING_DESC): Remove.
979 * src/configure [!sys1_compat] (CONFIG): Don't include target
982 * src/flash.c: Detect flash_page_size at runtime.
984 * src/main.c: Remove dependency to board.h.
986 * src/neug.c: Update from NeuG 1.0.2.
987 * src/adc_stm32f103.c: Update.
989 * chopstx: Update to 0.07.
992 * src/gnuk.ld.in: Update.
994 * tool/stlinkv2.py (stlinkv2.get_chip_id): New. Detect flash
996 (main): Call stlinkv2.get_chip_id after MCU reset and stop.
999 2015-07-11 Niibe Yutaka <gniibe@fsij.org>
1001 * src/configure (help): Add STM32_PRIMER2 and CQ_STARM.
1003 * chopstx: Update to 0.06.
1005 * tool/stlinkv2.py: Support 512kB version of STM32F103.
1006 The size of executable file should be even.
1008 2015-07-07 Niibe Yutaka <gniibe@fsij.org>
1010 * src/Makefile.in (CSRC): Add ecc-mont.c.
1012 * src/ecc-mont.c (mod25638_mul_121665): Fix.
1013 (ecdh_compute_public_25519, ecdh_decrypt_curve25519): New.
1015 * src/openpgp.c (cmd_pso): Support ALGO_CURVE25519.
1017 * src/openpgp-do.c (algorithm_attr_cv25519): New.
1018 (rw_algorithm_attr, get_algo_attr_data_object)
1019 (gpg_get_algo_attr_key_size, gpg_do_write_prvkey)
1020 (proc_key_import, gpg_do_public_key): Support ALGO_CURVE25519.
1022 * src/gnuk.h (ALGO_CURVE25519): New.
1024 2015-07-06 Niibe Yutaka <gniibe@fsij.org>
1026 Enhancement for FSM-55.
1027 * tool/stlinkv2.py (stlinkv2.control_nrst): New.
1028 (stlinkv2.get_rdp_key,has_spi_flash,has_protection): New.
1029 (stlinkv2.get_core_id): Rename.
1030 (stlinkv2.blank_check): Use self.flash_size.
1031 (stlinkv2.start): Call control_nrst. Call get_core_id.
1032 Distinguishing chip, and set rdp_key, flash_size and require_nrst.
1033 (stlinkv2.flash_write): Use self.flash_block_size.
1034 (main): Call control_nrst.
1035 (prog_flash_write_body, prog_option_bytes_write_body)
1036 (prog_blank_check_body): Support Cortex-M0.
1037 (main): Call API V2 halt twice.
1038 * tool/asm-thumb/*.S: Updated for Cortex-M0.
1040 2015-06-30 Niibe Yutaka <gniibe@fsij.org>
1042 * src/sys.c: Update from chopstx/example-cdc/sys.c.
1044 * src/main.c (device_initialize_once): Apply change of NeuG.
1046 2015-06-03 Niibe Yutaka <gniibe@fsij.org>
1050 * test/ecc_nistp256_keys.py: New.
1052 * tool/upgrade_by_passwd.py: Remove -p option and add -f option.
1054 * tool/gnuk_token.py (gnuk_token.download): Add verbose flag.
1055 (regnual.download): Ditto.
1057 * tool/gnuk_upgrade.py: Use gnuk_token module.
1059 2015-06-02 Niibe Yutaka <gniibe@fsij.org>
1061 * src/openpgp.c (cmd_pso): Support OpenPGPcard spec v3.0.
1063 2015-04-20 Niibe Yutaka <gniibe@fsij.org>
1065 * chopstx: Upgrade to 0.05.
1067 2015-04-19 Niibe Yutaka <gniibe@fsij.org>
1069 * src/gnuk.h (CCID_CARD_INIT): New.
1070 * src/usb_desc.c (gnukConfigDescriptor): Update dwDefaultClock,
1071 dwMaximumClock, dwFeatures, and bClassEnvelope.
1072 * src/usb_ctrl.c (freq_table): Change the value to 4000MHz.
1073 (usb_cb_handle_event): Call ccid_card_change_signal after configure.
1074 * src/usb-icc.c (ccid_thread): Change EV_CARD_CHANGE handling.
1076 2015-04-18 Niibe Yutaka <gniibe@fsij.org>
1078 * src/main.c (main): Call chopstx_main_init.
1079 * src/Makefile.in (DEFS): Remove CHX_PRIO_MAIN.
1081 2015-04-17 Niibe Yutaka <gniibe@fsij.org>
1083 * src/configure: Fix shell syntax.
1085 2015-03-31 Niibe Yutaka <gniibe@fsij.org>
1087 * src/usb_conf.h (ICC_NUM_INTERFACES, HID_NUM_INTERFACES)
1088 (HID_NUM_INTERFACES, VCOM_NUM_INTERFACES, MSC_NUM_INTERFACES)
1089 (NUM_INTERFACES): Define here (moved from usb_desc.c).
1090 (ICC_INTERFACE, HID_INTERFACE, VCOM_INTERFACE_0, VCOM_INTERFACE_1)
1091 (MSC_INTERFACE): New.
1092 * src/usb_ctrl.c (gnuk_setup_endpoints_for_interface)
1093 (usb_cb_setup, usb_cb_ctrl_write_finish): Use *_INTERFACE.
1094 * src/usb_desc.c (gnukConfigDescriptor): Likewise.
1096 2015-03-06 Niibe Yutaka <gniibe@fsij.org>
1098 * src/ecc-edwards.c (eddsa_sign_25519): Return 0.
1100 2015-02-25 Niibe Yutaka <gniibe@fsij.org>
1102 * src/openpgp.c (cmd_internal_authenticate): Fix storing to
1105 2015-02-10 Niibe Yutaka <gniibe@fsij.org>
1107 * src/openpgp.c (cmd_pso): Fix counter update for EdDSA. Thanks
1108 to Jonathan Schleifer.
1110 * src/call-rsa.c (rsa_sign): Don't set res_APDU_len.
1111 (rsa_decrypt): Likewise, but get OUTPUT_LEN_P as an argument.
1113 2015-02-09 Niibe Yutaka <gniibe@fsij.org>
1115 * src/openpgp.c (cmd_pso): Fix EdDSA. Use GPG_KEY_FOR_SIGNING.
1117 2014-12-15 Niibe Yutaka <gniibe@fsij.org>
1121 2014-12-13 Niibe Yutaka <gniibe@fsij.org>
1123 * src/flash.c (flash_key_getpage, flash_key_release_page): New.
1125 * src/openpgp-do.c (gpg_do_delete_prvkey): New arg.
1126 (rw_algorithm_attr): Call gpg_do_delete_prvkey with CLEAN_PAGE_FULL.
1128 2014-12-12 Niibe Yutaka <gniibe@fsij.org>
1130 * src/Makefile.in (build/bignum.o): Specific OPT for this target.
1132 * src/configure (target): Default is FST-01.
1133 (--with-dfu): FST-01 doesn't have DFU. If set, it must be
1136 * boards/STBEE_MINI: Remove, since it is now supported by Chopstx.
1138 * test/features/802_get_data_static.feature: Reflect the change
1139 of extended capabilities.
1140 * test/features/402_get_data_static.feature: Ditto.
1141 * test/features/002_get_data_static.feature: Ditto.
1143 * test/features/003_keyattr_change.feature: New test.
1145 * src/usb_lld.h: Don't use 'extern' for function declarations.
1146 * src/usb-icc.c (end_cmd_apdu_data): Fix Le handling.
1148 2014-12-11 Niibe Yutaka <gniibe@fsij.org>
1150 * chopstx: Upgrade to 0.04.
1151 * src/syc.c: Update from 0.04.
1153 2014-12-10 Niibe Yutaka <gniibe@fsij.org>
1155 * src/ecc-cdh.c: Remove as smartcard only does
1156 a part of ECDH computation as gpg-agent does.
1158 * src/chconf.h, src/halconf.h: Remove files needed for ChibiOS/RT.
1160 2014-12-09 Niibe Yutaka <gniibe@fsij.org>
1162 * src/call-ec.c (ecc_compute_public): Rename, as we share
1163 same routine among ECDSA and ECDH.
1164 (ecdh_decrypt): New.
1166 2014-12-09 Niibe Yutaka <gniibe@fsij.org>
1168 * src/ecc.c (compute_kP): Bug fix. It's P, not G.
1169 (point_is_on_the_curve): Bug fix.
1171 2014-12-03 Niibe Yutaka <gniibe@fsij.org>
1173 Changes for RSA-4096.
1175 * src/gnuk.h (MAX_CMD_APDU_DATA_SIZE, MAX_RES_APDU_DATA_SIZE):
1176 Send/Recv buffer should be bigger.
1177 * polarssl/library/bignum.c (mpi_exp_mod): Don't consume much.
1178 * polarssl/library/rsa.c (rsa_rsaes_pkcs1_v15_decrypt): buffer
1179 allocation size should be variable.
1181 2014-12-01 Niibe Yutaka <gniibe@fsij.org>
1183 * src/Makefile.in (DEFS): Don't define compile time preference of
1184 key algo attributes.
1186 * src/openpgp-do.c (proc_key_import): Support modifiable key algo
1189 2014-11-21 Niibe Yutaka <gniibe@fsij.org>
1191 * src/gnuk.h (ALGO_RSA4K, ALGO_NISTP256R1, ALGO_SECP256K1)
1192 (ALGO_ED25519, ALGO_RSA2K): New.
1193 (struct key_data_internal): Move to ...
1194 * src/openpgp-do.c (struct key_data_internal): ... here.
1195 (CHECKSUM_ADDR, kdi_len): New.
1196 (CKDC_CALC, CKDC_CHECK): New.
1197 (compute_key_data_checksum): Add arg PRVKEY_LEN.
1198 (gpg_do_load_prvkey, gpg_do_delete_prvkey): Support modifiable key
1200 (gpg_do_write_prvkey, gpg_do_public_key, gpg_do_keygen): Likewise.
1201 (gpg_do_clear_prvkey): Use MAX_PRVKEY_LEN.
1203 * src/openpgp.c (gpg_init): Call flash_init_keys after
1205 (cmd_pso): Support modifiable key algo attributes.
1206 (cmd_internal_authenticate): Likewise.
1208 2014-11-21 Niibe Yutaka <gniibe@fsij.org>
1210 * src/openpgp-do.c (algorithm_attr_rsa2k): Rename from *_rsa.
1211 (algorithm_attr_rsa4k): New.
1212 (get_algo_attr_pointer, kk_to_nr, gpg_get_algo_attr)
1213 (get_algo_attr_data_object, gpg_get_algo_attr_key_size): New.
1214 (rw_algorithm_attr): New.
1215 (gpg_do_table): Register rw_algorithm_attr for GPG_DO_ALG_*.
1216 (gpg_data_scan, gpg_data_copy): Handle algo attributes.
1218 (rw_pw_status): Fix checking against redundant write.
1220 2014-11-20 Niibe Yutaka <gniibe@fsij.org>
1222 * src/openpgp-do.c (extended_capabilities): Key attributes can be
1225 2014-11-20 Niibe Yutaka <gniibe@fsij.org>
1227 * src/gnuk.h (NR_NONE, NR_DO__FIRST__): Remove.
1228 (NR_DO_*): Redefine.
1229 (NR_KEY_ALGO_ATTR_SIG, NR_KEY_ALGO_ATTR_DEC)
1230 (NR_KEY_ALGO_ATTR_AUT): New.
1232 * src/openpgp-do.c (gpg_do_load_prvkey, gpg_do_delete_prvkey)
1233 (gpg_do_write_prvkey, gpg_do_chks_prvkey, gpg_data_scan)
1234 (gpg_data_copy, gpg_do_read_simple)
1235 (gpg_do_write_simple): Don't use NR_DO__FIRST__.
1236 (gpg_do_put_data): Don't use NR_NONE any more.
1237 (do_tag_to_nr): Use -1 to specify NONE.
1239 * src/flash.c (flash_enum_clear, flash_enum_write_internal)
1240 (flash_enum_write): New.
1242 2014-11-19 Niibe Yutaka <gniibe@fsij.org>
1244 * src/gnuk.h (FIRMWARE_UPDATE_KEY_CONTENT_LEN): New.
1245 (size_of_key): New enum.
1247 * src/openpgp.c (gpg_get_firmware_update_key)
1248 (cmd_read_binary, cmd_external_authenticate): Use
1249 FIRMWARE_UPDATE_KEY_CONTENT_LEN.
1251 * src/flash.c (KEY_SIZE): Remove.
1252 (key_available_at): Add new arg as KEY_SIZE.
1253 (flash_check_all_other_keys_released): Likewise.
1254 (flash_key_fill_zero_as_released, flash_key_release): Likewise.
1256 (flash_init): Move initializing keys into another function.
1257 (flash_init_keys): New function.
1259 (flash_key_alloc): Use gpg_get_algo_attr_key_size.
1260 (flash_key_write): Add new arg as KEY_DATA_LEN.
1262 (flash_write_binary): Use FIRMWARE_UPDATE_KEY_CONTENT_LEN.
1264 2014-09-16 Niibe Yutaka <gniibe@fsij.org>
1266 * src/gnuk.h (MAX_PRVKEY_LEN): New.
1267 (KEY_CONTENT_LEN): Remove.
1269 * src/call-rsa.c (RSA_SIGNATURE_LENGTH): Remove.
1270 (rsa_sign, rsa_verify, rsa_genkey): Add new arg: PUBKEY_LEN.
1271 (rsa_decrypt): Don't use KEY_CONTENT_LEN.
1273 2014-06-19 Niibe Yutaka <gniibe@fsij.org>
1275 * src/ecc-mont.c (compute_nQ): Add comment.
1277 * src/mod.c (mod_inv): Fix comment. X^-1 = 0 when X=0
1278 is important for Montgomery curve computation.
1280 2014-06-05 Niibe Yutaka <gniibe@fsij.org>
1282 * tool/add_openpgp_authkey_from_gpgssh.py: New.
1284 2014-04-17 Niibe Yutaka <gniibe@fsij.org>
1286 * src/muladd_256.h (MULADD_256_ASM): New.
1287 (MULADD_256): Use MULADD_256_ASM.
1288 * src/ecc-mont.c (mod25638_mul_121665): Add asm implementation.
1290 * src/bn.c (bn256_add_uint, bn256_sub_uint): Simplify.
1291 * src/mod25638.c (mod25638_add, mod25638_sub): Simplify.
1292 (n25638, add19): Remove.
1293 (ADDWORD_256): Add s_ as source pointer.
1294 (mod25519_reduce): Remove a call to memcpy. Use bn256_add_uint.
1295 * src/ecc-edwards.c (point_double): Simplify.
1297 2014-04-16 Niibe Yutaka <gniibe@fsij.org>
1301 2014-04-15 Niibe Yutaka <gniibe@fsij.org>
1303 * src/ecc-mont.c: New.
1305 * src/mod25638.c (p25519): Move from ecc-edwards.c.
1306 (mod25519_reduce, add19): Likewise.
1307 (mod25638_reduce) [!ASM_IMPLEMENTATION]: Use bn256_add_uint.
1309 2014-04-14 Niibe Yutaka <gniibe@fsij.org>
1311 * src/jpc.c (jpc_to_ac): Error check before mod_inv.
1313 * src/mod.c (mod_inv): No return value (if N==0 returns ZERO).
1315 * src/bn.c [BN256_NO_RANDOM]: Only include "random.h" if needed.
1317 2014-04-08 Niibe Yutaka <gniibe@fsij.org>
1319 * src/mod.c (mod_inv): Use MAX_GCD_STEPS_BN256.
1320 Return failure or success.
1321 * src/jpc.c (jpc_to_ac): Use mod_inv.
1322 * src/modp256k1.c (modp256k1_inv): Remove.
1323 * src/modp256r1.c (modp256r1_inv): Remove.
1325 2014-04-07 Niibe Yutaka <gniibe@fsij.org>
1327 * src/openpgp-do.c (algorithm_attr_ed25519): It's OID only.
1329 2014-04-03 Niibe Yutaka <gniibe@fsij.org>
1331 * src/ecc-edwards.c (eddsa_sign_25519): Change type of OUT.
1332 * src/openpgp.c (cmd_internal_authenticate): Have a buffer.
1334 * src/flash.c (flash_init): Fix key address finder.
1336 2014-04-02 Niibe Yutaka <gniibe@fsij.org>
1338 * src/openpgp-do.c (proc_key_import): Handle EdDSA.
1339 (algorithm_attr_ed25519): Fix OID and add ID for SHA512.
1341 2014-04-01 Niibe Yutaka <gniibe@fsij.org>
1343 * src/ecc-edwards.c (eddsa_compute_public_25519): New.
1345 * src/openpgp-do.c (algorithm_attr_ed25519): New.
1346 (gpg_do_write_prvkey, proc_key_import, gpg_do_public_key): Add
1349 2014-03-31 Niibe Yutaka <gniibe@fsij.org>
1351 * src/ecc-edwards.c (eddsa_sign_25519): Rename and API change.
1353 * src/openpgp-do.c (gpg_do_load_prvkey, gpg_do_delete_prvkey)
1354 (gpg_do_write_prvkey, gpg_do_public_key, gpg_do_keygen): Follow
1355 the change of PRVKEY_DATA and KEY_DATA.
1357 * src/flash.c (key_available_at): New.
1358 (flash_init): Initilize KD.
1360 * src/gnuk.h (struct prvkey_data): Remove member KEY_ADDR.
1361 (struct key_data): Addd member KEY_ADDR.
1363 * src/openpgp-do.c (gpg_do_keygen): Bug fix. Reset the signature
1364 counter when new key is generated.
1366 * src/flash.c (flash_key_alloc): Change API, supply KK.
1368 2014-03-29 Niibe Yutaka <gniibe@fsij.org>
1370 * src/ecc-edwards.c (point_double, point_add): Rename.
1371 (mod25519_reduce): New.
1373 2014-03-28 Niibe Yutaka <gniibe@fsij.org>
1375 * misc/t-eddsa.c (main): Update for new API of eddsa_25519.
1377 * src/ecc-edwards.c (compute_kG_25519): Tune for 252-bit.
1378 (eddsa_25519): Public key should be provided by caller.
1379 (eddsa_public_key_25519): New.
1381 2014-03-27 Niibe Yutaka <gniibe@fsij.org>
1383 * src/ecc-edwards.c (ed_add_25638): Remove the third argument.
1384 (compute_kG_25519): The curve is complete, we don't need to avoid
1385 identity element as NIST curve or secp256k1 curve.
1386 (eddsa_25519): Change the API, with A and the seed.
1388 2014-03-26 Niibe Yutaka <gniibe@fsij.org>
1390 * src/mod25638.c (mod25638_reduce): New.
1391 (mod25638_mul, mod25638_sqr): Use mod25638_reduce.
1393 * src/ecc-edwards.c (ptc_to_ac_25519): No need to subtract p25519.
1395 2014-03-25 Niibe Yutaka <gniibe@fsij.org>
1397 * misc/t-eddsa.c: New.
1399 * src/ecc-edwards.c (bnX_mul_C, mod_reduce_M): New.
1402 2014-03-20 Niibe Yutaka <gniibe@fsij.org>
1404 * src/ecc-edwards.c (ed_add_25638): Fix for X == A.
1405 (main): Compute pre-computed tables.
1406 (precomputed_KG, precomputed_2E_KG): Add.
1407 (compute_kG_25519): New.
1409 2014-03-19 Niibe Yutaka <gniibe@fsij.org>
1411 * src/bn.c (bn256_add): Fix for X == B.
1412 (bn256_sub): Likewise.
1414 * src/ecc-edwards.c: New.
1416 2014-03-18 Niibe Yutaka <gniibe@fsij.org>
1418 * src/mod25638.c (mod25638_add, mod25638_sub, mod25638_sqr)
1419 (mod25638_shift): New.
1421 2014-03-13 Niibe Yutaka <gniibe@fsij.org>
1423 * src/mod25638.c: Rename from fe25519.c.
1424 * src/mod25638.h: Likewise.
1426 2014-03-07 Niibe Yutaka <gniibe@fsij.org>
1430 2014-02-25 Niibe Yutaka <gniibe@fsij.org>
1432 * src/openpgp-do.c (gpg_do_public_key): Don't put OID.
1434 * src/configure [certdo] (gnuk.ld): Add TIM_SIZE and EXT_SIZE.
1435 Thanks to Vasily Evseenko for the bug report.
1437 2014-02-21 Niibe Yutaka <gniibe@fsij.org>
1439 * src/ecc.c (compute_kG): Compute higer index at first.
1440 (point_is_on_the_curve): Don't use coefficient_a if it's zero.
1442 * src/jpc.c (jpc_double): Care coefficient A.
1444 * src/ec_p256r1.c (COEFFICIENT_A_IS_MINUS_3): New.
1445 * src/ec_p256k1.c (COEFFICIENT_A_IS_ZERO): New.
1446 * src/jpc_p256r1.c (COEFFICIENT_A_IS_MINUS_3): Likewise.
1447 * src/jpc_p256k1.c (COEFFICIENT_A_IS_MINUS_3): Likewise.
1449 * src/modp256k1.c (modp256k1_shift): Bug fix.
1451 2014-02-20 Niibe Yutaka <gniibe@fsij.org>
1453 * src/Makefile.in (CSRC): Add files of p256k1.
1455 * src/openpgp.c (cmd_pso): Support p256k1 for signature.
1457 * src/openpgp-do.c (algorithm_attr_p256k1): New.
1458 (gpg_do_write_prvkey): Support p256k1 for signature.
1459 (proc_key_import, gpg_do_table, gpg_do_public_key): Likewise.
1461 * src/Makefile.in (DEFS): Add -DRSA_SIG.
1463 * src/openpgp-do.c (gpg_do_write_prvkey): Use _p256r1.
1464 * src/openpgp.c (cmd_internal_authenticate): Likewise.
1466 * src/call-ec_p256k1.c: New. Use call-ec.c.
1467 * src/call-ec_p256r1.c: Use call-ec.c.
1468 * src/call-ec.c: New.
1469 (ecdsa_sign): Change the signature.
1471 2014-02-19 Niibe Yutaka <gniibe@fsij.org>
1473 * tool/calc_precompute_table_ecc.py: New.
1475 * src/ec_p256k1.c: New. Use ecc.c.
1476 * src/ec_p256k1.h: New.
1477 * src/ec_p256r1.c: Use ecc.c.
1480 2014-02-18 Niibe Yutaka <gniibe@fsij.org>
1482 * src/jpc_p256k1.c: New. Use jpc.c.
1483 * src/jpc_p256r1.c: Use jpc.c.
1486 * src/sha256.c (memcpy_output_bswap32): Bug fix.
1488 * src/modp256k1.h, src/modp256k1.c: New.
1490 2014-02-17 Niibe Yutaka <gniibe@fsij.org>
1492 * src/Makefile.in (CSRC): Follow the changes of filenames.
1494 * src/modp256r1.c (modp256r1_add, modp256r1_sub, S3)
1495 (modp256r1_mul, modp256r1_sqr, modp256r1_inv, modp256r1_shift):
1496 Use new function names.
1497 * src/jpc_p256r1.c (jpc_double_p256r1, jpc_add_ac_signed_p256r1)
1498 (jpc_to_ac_p256r1): Likewise.
1499 * src/ec_p256r1.c (point_is_on_the_curve)
1500 (compute_kG_p256r1, compute_kP_p256r1): Likewise.
1501 * src/call-ec_p256r1.c (ecdsa_sign): Likewise.
1503 * src/modp256r1.h: Rename from modp256.h.
1504 * src/jpc-ac_p256r1.h: Rename from jpc-ac.h.
1505 * src/ec_p256r1.h: Rename from ec_p256.h.
1507 * src/modp256r1.c: Rename from modp256.c.
1508 * src/jpc_p256r1.c: Rename from jpc.c.
1509 * src/ec_p256r1.c: Rename from ec_p256.c.
1510 * src/call-ec_p256r1.c: Rename from call-ec_p256.c.
1512 2014-02-05 NIIBE Yutaka <gniibe@fsij.org>
1514 * src/sha512.h, src/sha512.c: New.
1516 * src/sha256.c (initial_state): Don't export, it's internal.
1517 (memcpy_output_bswap32): Rename and remove last argument.
1519 2014-01-28 Niibe Yutaka <gniibe@fsij.org>
1521 * src/muladd_256.h: New.
1522 * src/bn.c (bn256_mul, bn256_sqr): Assembler implementation.
1524 * src/ec_p256.c (get_vk_kP): Bug fix.
1525 (compute_kP): Bug fix for index table.
1527 2014-01-27 Niibe Yutaka <gniibe@fsij.org>
1529 * src/ec_p256.c (get_vk_kP): New.
1530 (naf4_257_set, naf4_257_get, compute_naf4_257): Remove.
1531 (compute_kP): Change the argument, fixing for constant time.
1533 2014-01-24 Niibe Yutaka <gniibe@fsij.org>
1535 * src/ec_p256.c (get_vk): New.
1536 (compute_kG): Fix for constant time.
1537 (compute_kP): Simplify.
1539 2014-01-23 Niibe Yutaka <gniibe@fsij.org>
1541 * src/jpc.c (jpc_add_ac_signed): Fix for constant time.
1543 * src/ec_p256.c (ecdsa): Bug fix for k selection.
1545 2014-01-22 Niibe Yutaka <gniibe@fsij.org>
1547 * src/modp256.c (modp256_inv): Fix for constant time.
1549 * src/bn.c (bn256_sqr): Fix for constant time.
1551 * src/mod.c (mod_inv): Fix for constant time.
1553 * src/ec_p256.c (compute_kG): Simplify.
1555 * src/jpc.c (jpc_double): Support calling with A = infinity.
1557 2014-01-21 Niibe Yutaka <gniibe@fsij.org>
1559 * src/jpc.c (jpc_add_ac_signed): Bug fix for A check.
1561 * src/ec_p256.c (ecdsa): Fix for constant time.
1563 * src/modp256.c (modp256_add, modp256_sub, modp256_reduce)
1564 (modp256_shift): Fix for constant time.
1565 (modp256_inv): Likewise (not fully constant time, yet).
1567 * src/mod.c (mod_reduce): Fix for constant time.
1568 (mod_inv): Likewise (not fully constant time, yet).
1570 * src/bn.h (bn256, bn512): words -> word.
1571 * src/ec_p256.h (naf4_257): Likewise.
1573 2014-01-20 Niibe Yutaka <gniibe@fsij.org>
1575 * src/fe25519.h, src/fe25519.c: New.
1577 2014-01-15 Niibe Yutaka <gniibe@fsij.org>
1579 * src/bn.c (bn256_is_zero, bn256_is_ge, bn256_cmp): Computation
1580 should be constant time.
1582 2013-12-25 Niibe Yutaka <gniibe@fsij.org>
1586 * tool/gnuk_token.py (gnuk_token.__init__, regnual.__init__): Fix
1587 the argument of setAltInterface.
1588 * tool/gnuk_upgrade.py: Likewise.
1589 * tool/dfuse.py (DFU_STM32.__init__): Likewise.
1590 * tool/stlinkv2.py (stlinkv2.__init__): Likewise.
1592 2013-12-24 Niibe Yutaka <gniibe@fsij.org>
1594 * polarssl/include/polarssl/bn_mul.h (MULADDC_1024_CORE)
1595 (MULADDC_1024_LOOP): Use younger number registers more for shorter
1596 instructions and better performance.
1597 * polarssl/library/bignum.c (mpi_montsqr): Likewise. Change loop
1598 structure and conditional branch for better performance.
1600 2013-12-23 Niibe Yutaka <gniibe@fsij.org>
1602 * polarssl/library/bignum.c (mpi_montmul): Computation
1603 time should not depends on input.
1604 (mpi_montmul, mpi_montred, mpi_montsqr): Change the API.
1605 (mpi_exp_mod): Follow the change of the API. Allocate memory on
1606 stack instead of malloc.
1608 * src/gnuk.ld.in (__process3_stack_size__): Increase stack size.
1610 2013-12-20 Niibe Yutaka <gniibe@fsij.org>
1614 * src/usb_ctrl.c (USB_FSIJ_GNUK_CARD_CHANGE): New.
1615 (usb_cb_setup): Support USB_FSIJ_GNUK_CARD_CHANGE.
1616 * src/usb-icc.c (ccid_card_change_signal): New argument HOW.
1618 2013-12-20 Niibe Yutaka <gniibe@fsij.org>
1620 * polarssl/include/polarssl/bn_mul.h (MULADDC_1024_CORE)
1621 (MULADDC_CORE): Reorder instructions for more speed up.
1622 * polarssl/library/bignum.c (mpi_montsqr): Likewise.
1624 2013-12-19 Niibe Yutaka <gniibe@fsij.org>
1626 * src/configure (--enable-hid-card-change): New (experimental).
1627 * src/config.h.in (HID_CARD_CHANGE_DEFINE): New.
1628 * src/usb_ctrl.c (gnuk_setup_endpoints_for_interface)
1629 (usb_cb_setup, usb_cb_ctrl_write_finish): Conditionalize
1630 HID_CARD_CHANGE_SUPPORT.
1631 * src/usb_desc.c (gnukDeviceDescriptor, usb_cb_get_descriptor):
1634 2013-12-19 Niibe Yutaka <gniibe@fsij.org>
1636 * src/openpgp.c (S2KCOUNT): It's now 192, as the threat model
1637 of Gnuk Token is different.
1639 2013-12-19 Niibe Yutaka <gniibe@fsij.org>
1641 * polarssl/library/bignum.c (mpi_montsqr): New.
1642 (mpi_exp_mod): Use mpi_montsqr.
1644 Note that this change introduces a vulnerability by the
1645 Yarom/Falkner flush+reload cache side-channel attack. When this
1646 code is used on general purpose computer where we can observe
1647 which code is executed (sqr or mul), it's not safe.
1649 2013-12-16 Niibe Yutaka <gniibe@fsij.org>
1651 * polarssl/include/polarssl/bn_mul.h (MULADDC_1024_CORE)
1652 (MULADDC_1024_LOOP, MULADDC_HUIT, MULADDC_INIT, MULADDC_CORE)
1653 (MULADDC_STOP) [__arm__]: The value of input B won't change.
1654 More acculate specification for asm statement.
1656 * polarssl/library/bignum.c (mpi_cmp_abs_limbs): New.
1657 (mpi_montmul): Change the signature and use the upper half of T.
1658 (mpi_montred): Likewise.
1659 (mpi_exp_mod): Use improved mpi_montmul and mpi_montred.
1660 (mpi_sub_hlp, mpi_mul_hlp): Add const qualifier for S.
1662 2013-12-13 Niibe Yutaka <gniibe@fsij.org>
1664 * polarssl/library/bignum.c (mpi_exp_mod): Initialize lower
1665 half of T with zero.
1666 (mpi_montmul): Don't need to clear lower half of
1667 T, as we keep zero. Call mpi_sub_hlp with upper half of T.
1668 (mpi_montred): Ditto.
1670 * polarssl/library/bignum.c (mpi_montmul, mpi_montred): Minimize
1671 number of limbs for T.
1672 (mpi_exp_mod): Only allocate N-n * 2 for T.
1673 Only allocate N->n for X, W[i], and RR.
1675 2013-12-13 Niibe Yutaka <gniibe@fsij.org>
1677 * tool/upgrade_by_passwd.py (main): Support -k to specify KEYNO.
1679 2013-12-13 Niibe Yutaka <gniibe@fsij.org>
1681 * src/usb_ctrl.c (HID_LED_STATUS_CARDCHANGE): Rename from
1682 HID_LED_STATUS_NUMLOCK.
1684 * tool/gnuk_token.py (gnuk_token.stop_gnuk): Detach kernel
1687 2013-12-12 Niibe Yutaka <gniibe@fsij.org>
1689 * src/openpgp-do.c (do_openpgpcard_aid): Coerce to volatile to
1690 force memory access at run time.
1692 2013-12-11 Niibe Yutaka <gniibe@fsij.org>
1694 * regnual/sys.c (entry): Fix relocation calculation.
1696 2013-11-27 Niibe Yutaka <gniibe@fsij.org>
1698 * src/stm32f103.h (AFIO_MAPR_SWJ_CFG_DISABLE): New.
1699 * src/sys.c: Likewise.
1701 2013-11-26 Niibe Yutaka <gniibe@fsij.org>
1703 * src/usb_desc.c (hid_report_desc): New.
1704 (ICC_TOTAL_LENGTH): Update.
1705 (HID_TOTAL_LENGTH, HID_NUM_INTERFACES): New.
1706 (W_TOTAL_LENGTH, NUM_INTERFACES): Update.
1707 (gnukConfigDescriptor): Add IN2 interrupt endpoint descriptor.
1708 Add HID interface descriptor.
1709 (usb_cb_get_descriptor): Handle HID.
1711 * src/usb_ctrl.c (NUM_INTERFACES, MSC_INTERFACE_NO): Add 1.
1712 (USB_HID_REQ_*, HID_LED_STATUS_NUMLOCK): New.
1713 (gnuk_setup_endpoints_for_interface): Add ENDP2 interrupt
1715 (usb_cb_setup): Handle HID requests.
1716 (usb_cb_ctrl_write_finish): Likewise.
1718 * src/usb-icc.c (ccid_card_change_signal): New.
1719 (ccid_thread): Handle card change.
1720 (icc_error, icc_send_status): Handle ICC_STATE_NOCARD state.
1721 (icc_handle_data): Add the case of ICC_STATE_NOCARD.
1722 (EP2_IN_Callback): New.
1724 2013-11-26 Niibe Yutaka <gniibe@fsij.org>
1726 * src/pin-dial.c: Remove.
1727 * src/configure: Remove pin-dial support.
1729 2013-11-25 Niibe Yutaka <gniibe@fsij.org>
1731 * src/Makefile.in (HEXOUTPUT_MAKE_OPTION): New.
1732 * src/configure (HEXOUTPUT_MAKE_OPTION): New.
1733 * src/main.c: Include board.h.
1734 * src/stm32f103.h (EXTI0_IRQ, EXTI1_IRQ): New.
1736 2013-11-18 Niibe Yutaka <gniibe@fsij.org>
1738 * regnual/sys.c (entry): Bug fix of clearing BSS.
1740 * src/usb_stm32f103.c: Update from NeuG.
1741 (usb_handle_transfer): Add argument ISTR_VALUE.
1743 * src/openpgp.c (card_thread): Add noinline attribute.
1745 * src/usb-icc.c (ccid_thread): Join the OpenPGP thread.
1746 Add noinline attribute.
1748 2013-11-15 Niibe Yutaka <gniibe@fsij.org>
1750 * src/configure (options): Add --enable-sys1-compat.
1752 2013-11-12 Niibe Yutaka <gniibe@fsij.org>
1754 * chopstx: Upgrade to 0.03.
1756 * src/usb_desc.c (usb_initial_feature): Remove.
1757 (USB_SELF_POWERED): Move to ...
1758 * src/usb_conf.h (USB_SELF_POWERED): ... here.
1759 * src/usb_ctrl.c (usb_cb_device_reset, usb_intr): Follow the
1762 2013-11-11 Niibe Yutaka <gniibe@fsij.org>
1764 * src/adc_stm32f103.c (adc_wait_completion): Update from NeuG 1.0.
1766 2013-11-03 Niibe Yutaka <gniibe@fsij.org>
1768 * regnual/regnual.c (usb_cb_get_descriptor): Update to new API.
1770 * src/usb_lld.h (usb_initial_feature): Remove.
1772 * chopstx: Update to 0.01.
1773 * src/pin-cir.c: Chatter fix to 200ms.
1774 * src/main.c: Fix bDeviceState.
1776 2013-11-02 Niibe Yutaka <gniibe@fsij.org>
1778 * src/usb_lld.h, src/usb_stm32f103.c (std_get_descriptor): Change
1779 the API of usb_cb_get_descriptor.
1780 * src/usb_desc.c: Follow the change.
1781 * src/usb_conf.h: Modify for CCID INT and HID usage.
1783 2013-11-02 Niibe Yutaka <gniibe@fsij.org>
1785 * src/pin-cir.c: Port to Chopstx.
1788 * src/configure (TIM_SIZE, EXT_SIZE): New.
1789 * src/gnuk.ld.in (__process6_stack_size__)
1790 (__process7_stack_size__): New.
1791 * src/main.c (main): Call cir_init.
1792 * src/openpgp.c (openpgp_card_thread): Rename from GPGthread.
1793 * src/usb-icc.c (icc_power_on): Follow the change.
1795 2013-11-01 Niibe Yutaka <gniibe@fsij.org>
1797 * src/sys.c: Update from Chopstx.
1798 * src/usb_lld.h: Remove interrupt definition.
1799 * src/stm32f103.h: Add AFIO, EXTI, and TIMER constants.
1801 2013-10-31 Niibe Yutaka <gniibe@fsij.org>
1803 * src/main.c (main): Call msc_init before USB interrupt thread.
1804 * src/gnuk.h, src/usb-msc.h, src/usb-msc.c, src/pin-dnd.c: Port to
1806 * src/openpgp.c (get_pinpad_input): Follow the change.
1807 * src/usb_ctrl.c (gnuk_setup_endpoints_for_interface): Don't stall
1810 2013-10-24 Niibe Yutaka <gniibe@fsij.org>
1812 * src/Makefile.in (DEFS): Add -DCHX_PRIO_MAIN=5 for LED blink.
1813 * src/main.c (PRIO_CCID): It's now 3 (was: 2).
1815 2013-10-24 Niibe Yutaka <gniibe@fsij.org>
1817 * src/gnuk.ld.in (.gnuk_flash): Three pages for three keys.
1818 * src/flash.c (FLASH_KEYSTORE_SIZE): Likewise.
1819 (flash_keystore_release): Remove.
1820 (flash_key_fill_zero_as_released)
1821 (flash_check_all_other_keys_released, flash_key_release): New.
1822 (flash_init, flash_key_alloc): New method to handle free space.
1823 * src/openpgp-do.c (fetch_four_bytes): New.
1824 (gpg_do_load_prvkey, gpg_do_delete_prvkey, gpg_do_public_key): Use
1826 (gpg_do_delete_prvkey): Call flash_key_release.
1828 2013-10-23 Niibe Yutaka <gniibe@fsij.org>
1830 * test/features/010_setup_passphrase.feature
1831 * test/features/030_key_registration.feature
1832 * test/features/040_passphrase_change.feature
1833 * test/features/410_setup_passphrase.feature
1834 * test/features/430_key_registration.feature
1835 * test/features/201_keygen.feature
1836 * test/features/601_keygen.feature: Modified to support new way of
1837 pass phrase reset by key import / key generation.
1839 * test/features/201_keygen.feature
1840 * test/features/601_keygen.feature
1841 * test/features/202_setup_passphrase.feature
1842 * test/features/602_setup_passphrase.feature: Rename to change
1845 2013-10-23 Niibe Yutaka <gniibe@fsij.org>
1847 * src/openpgp-do.c (gpg_do_write_prvkey): Bug fix of adding
1850 2013-10-22 Niibe Yutaka <gniibe@fsij.org>
1852 * src/openpgp-do.c (gpg_do_write_prvkey): Bug fix.
1854 2013-10-15 Niibe Yutaka <gniibe@fsij.org>
1856 * src/openpgp.c (cmd_change_password, cmd_reset_user_password): It
1857 is now error to change User's pass phrase with no keys.
1859 * src/openpgp-do.c (proc_resetting_code): Likewise for resetting
1861 (gpg_do_delete_prvkey): New.
1862 (gpg_do_write_prvkey): Make sure to delete the key before writing.
1863 User's pass phrase is always the one of factory setting.
1864 (gpg_do_chks_prvkey): Support removing the key.
1865 (proc_key_import): Use gpg_do_delete_prvkey.
1866 (gpg_do_keygen): Use factory setting pass phrase.
1868 2013-10-11 Niibe Yutaka <gniibe@fsij.org>
1870 * src/ac.c (verify_user_0, verify_admin_00): Fix conditions.
1872 * src/openpgp-do.c (gpg_do_write_prvkey): Delete keystring
1873 information from data object of NR_DO_KEYSTRING_PW3.
1875 (gpg_do_keygen): Likewise.
1877 * src/openpgp.c (cmd_reset_user_password): Likewise.
1879 2013-10-10 Niibe Yutaka <gniibe@fsij.org>
1881 * src/gnuk.h (S2K_ITER): Remove. It's determined at compile time.
1883 * src/openpgp-do.c (proc_resetting_code, gpg_do_write_prvkey)
1884 (proc_key_import): Remove "iteration" field.
1886 * src/openpgp.c (cmd_change_password): Likewise.
1888 2013-10-10 Niibe Yutaka <gniibe@fsij.org>
1890 * src/openpgp-do.c (gpg_do_write_prvkey): Access of data object
1891 considering garbage collection.
1893 * src/openpgp.c (cmd_change_password): Call gpg_do_write_simple
1894 after accessing the data object (it may cause garbage collection).
1896 2013-10-10 Niibe Yutaka <gniibe@fsij.org>
1898 * polarssl/library/bignum.c (mpi_montred): Constant time for
1899 carry propagation. Bug fix for carry propagation.
1900 (mpi_exp_mod): Bug fix. Shrink the size of RR as same as X.
1902 2013-10-09 Niibe Yutaka <gniibe@fsij.org>
1904 * src/ac.c (verify_user_0, verify_admin_00, verify_admin_0): Add a
1905 flag to save into keystring_md_pw3. Add SALT handling.
1906 (decode_iterate_count, calc_md, gpg_set_pw3): Remove.
1908 * src/openpgp-do.c (proc_resetting_code, gpg_do_write_prvkey)
1909 (gpg_do_keygen): Add SALT handling.
1910 * src/openpgp.c (cmd_change_password, cmd_reset_user_password)
1912 * src/random.c (random_get_salt): Rename from get_salt.
1914 2013-10-09 Niibe Yutaka <gniibe@fsij.org>
1916 * src/openpgp-do.c (gpg_do_write_prvkey): Remove information (but
1917 pass phrase length) for admin from keystring data object.
1918 (proc_key_import): Recover admin keystring to DO when key deletion.
1920 2013-10-09 Niibe Yutaka <gniibe@fsij.org>
1922 * src/ac.c (verify_user_0, verify_admin_00): Handle PW_LEN_MASK.
1923 * src/openpgp-do.c (proc_resetting_code, gpg_do_write_prvkey):
1926 * src/openpgp.c (cmd_change_password, cmd_reset_user_password):
1927 Handle PW_LEN_KEYSTRING_BIT.
1929 2013-10-09 Niibe Yutaka <gniibe@fsij.org>
1931 * src/ac.c (verify_admin_00): New. Add authentication by loading
1933 (verify_admin_0): Use verify_admin_00.
1935 * src/openpgp.c (cmd_change_password): Admin keystring handling as
1938 2013-10-08 Niibe Yutaka <gniibe@fsij.org>
1940 * src/openpgp.c (modify_binary): Allow odd size of certificate.
1942 * polarssl/library/rsa.c: Update from PolarSSL 1.2.10.
1943 * polarssl/include/polarssl/rsa.h: Ditto.
1945 2013-10-07 Niibe Yutaka <gniibe@fsij.org>
1947 * polarssl/library/bignum.c (mpi_sub_hlp): Return CARRY.
1948 (mpi_sub_abs): Carry propagatoin is done here.
1949 (mpi_mul_hlp_mm): Remove.
1950 (mpi_mul_hlp): Return CARRY, computation in constant time.
1951 (mpi_mul_mpi): Change the order of computation not to propagate
1953 (mpi_montmul): Minimum zero-ing of D and reduce usage of temporary
1954 memory, by one word. Use carry of mpi_mul_hlp. Use
1955 NEED_SUBTRACTION against timing attack.
1956 (mpi_exp_mod): Minimum usage of temporary memory.
1958 2013-10-06 Niibe Yutaka <gniibe@fsij.org>
1960 * polarssl/library/bignum.c (mpi_mul_hlp_mm): New. Handle
1961 extra-carry in constant time to mitigate timing attack.
1962 (mpi_montmul): Use mpi_mul_hlp_mm.
1963 * src/call-rsa.c (rsa_sign, rsa_decrypt, rsa_verify): Don't
1966 2013-10-05 Niibe Yutaka <gniibe@fsij.org>
1968 * polarssl/include/polarssl/aes.h: Update from PolarSSL 1.2.9.
1969 * polarssl/include/polarssl/bignum.h: Ditto.
1970 * polarssl/include/polarssl/config.h: Ditto.
1971 * polarssl/include/polarssl/rsa.h: Ditto.
1972 * polarssl/library/aes.c, polarssl/library/bignum.c: Ditto.
1973 * polarssl/library/rsa.c: Ditto. Fix rsa_free.
1974 * src/call-rsa.c (rsa_sign, modulus_calc, rsa_decrypt)
1975 (rsa_verify): Follow changes of PolarSSL 1.2.9 with RSA blinding.
1976 Better error checking.
1978 2013-10-04 Niibe Yutaka <gniibe@fsij.org>
1980 * src/main.c (gnuk_malloc): Update ->neighbor field of a chunk on
1982 (gnuk_free): Access free list after getting the lock.
1984 2013-10-01 Niibe Yutaka <gniibe@fsij.org>
1986 * src/random.c (random_gen): Bug fix for INDEXed copy.
1988 * src/call-rsa.c (rsa_genkey): Call neug_flush and prng_seed.
1989 * polarssl/library/bignum.c (small_prime): More constants.
1990 (prng_seed, jkiss, mpi_fill_pseudo_random): New.
1991 (mpi_is_prime): Use mpi_fill_pseudo_random.
1993 2013-09-30 Niibe Yutaka <gniibe@fsij.org>
1995 * polarssl/library/bignum.c (mpi_is_prime): Enable trial divisions
1997 Add Fermat primality test.
1998 (mpi_gen_prime): Limit random value so that two MSBs of result will
2001 2013-09-27 Niibe Yutaka <gniibe@fsij.org>
2003 * polarssl/include/polarssl/bignum.h (mpi_is_prime): ifdef-out.
2004 * polarssl/library/bignum.c (mpi_is_prime): It's now internal
2005 function, assuming we already know its coprime to small primes.
2006 (M): New constant MPI. Multiply primes 2*...*691.
2007 (MAX_A): New constant MPI. 2^1024 / M - 1.
2008 (mpi_gen_prime): Specialize for 1024-bit, using Fouque-Tibouchi
2011 2013-09-25 Niibe Yutaka <gniibe@fsij.org>
2013 * src/sha256.h, src/adc.h
2014 * src/neug.c, src/adc_stm32f103.c: Update from NeuG 0.11.
2016 * chopstx: Upgrade to new Chopstx 0.00.
2018 * VERSION: New file.
2020 * src/configure (SERIALNO, SERIALNO_STR_LEN_DEFINE): New.
2021 (REVISION): Use the file VERSION if it doesn't have .git.
2022 Thanks to Sumedha Widyadharma for the bug report.
2024 * src/config.h.in (SERIALNO_STR_LEN_DEFINE): New.
2025 * src/main.c (ID_OFFSET): Use SERIALNO_STR_LEN.
2026 * src/usb_desc.c (gnukStringSerial): Remove. It's now
2027 generated in usb-strings.c.inc.
2029 * src/ec_p256.c (compute_kP): Fix for impossible cases.
2030 (point_is_on_the_curve): New.
2031 (coefficient_a, coefficient_b): New.
2033 2013-09-20 Niibe Yutaka <gniibe@fsij.org>
2035 * src/call-ec_p256.c (ecdsa_compute_public): Handle possible
2036 error (where key_data is the order).
2038 * src/ec_p256.c (compute_kG, compute_kP): Handle errors.
2040 * src/jpc.c (jpc_to_ac): Return -1 on error.
2041 (jpc_add_ac_signed): Handle the case where A=inf.
2043 * src/modp256.c (modp256_inv): Handle error case.
2045 * src/bn.c (bn256_cmp): New.
2047 2013-07-19 Niibe Yutaka <gniibe@fsij.org>
2049 * src/gnuk.ld.in: Layout change following NeuG.
2050 (_end): Add alignment of 16.
2052 * src/neug.c, src/adc.h, src/adc_stm32f103.c: Update from NeuG.
2054 * src/main.c [DFU_SUPPORT] (main): Fix calling
2055 flash_erase_all_and_exec.
2057 * src/openpgp-do.c (gpg_do_write_prvkey, gpg_do_keygen): Fix
2058 allocated memory handling. Clean up before free.
2059 * src/call-rsa.c (modulus_calc, rsa_genkey): Fix removing const.
2060 * src/call-ec_p256.c (ecdsa_compute_public): Likewise.
2062 2013-07-18 Niibe Yutaka <gniibe@fsij.org>
2065 * src/Makefile.in: Change for Chopstx.
2066 * src/configure: Likewise.
2067 * src/gnuk.h, src/gnuk.ld.in: Likewise.
2068 * src/ac.c: Include stdint.h and string.h, not ch.h.
2069 * src/call-rsa.c, src/debug.c, src/flash.c: Likewise.
2070 * src/call-ec_p256.c, src/usb_desc.c
2071 * src/openpgp-do.c, src/random.c: Likewise.
2072 * src/openpgp.c: Likewise. Use eventflag of Chopstx.
2073 * src/usb-icc.c: Likewise.
2074 * src/usb_ctrl.c: Update for Chopstx.
2076 * src/stdlib.h: Use gnuk_malloc and gnuk_free for malloc/free.
2077 * src/config.h.in: Move FLASH_PAGE_SIZE in board.h.
2078 * polarssl/library/aes.c (FT0, FT1, FT2): Export (for sys 2.0).
2079 * src/main.c (struct stdout, _write, EP3_IN_Callback)
2080 (EP5_OUT_Callback): Rewrite for Chopstx. No independent thread
2082 (display_fatal_code, emit_led, display_status_code, led_blink):
2083 Use primitives of Chopstx.
2084 (main): Changes for Chopstx.
2085 (gnuk_malloc_init, sbrk, gnuk_malloc, gnuk_free): New.
2087 2013-06-20 Niibe Yutaka <gniibe@fsij.org>
2089 * src/sys.c, src/sys.h, src/neug.c, src/adc.h
2090 * src/adc_stm32f103.c, src/usb_stm32f103.c: Update from NeuG 0.10.
2091 * src/stm32f103.h: New. From NeuG 0.10.
2093 2013-06-18 Niibe Yutaka <gniibe@fsij.org>
2095 * src/openpgp-do.c (gpg_do_write_prvkey, proc_key_import, gpg_do_table)
2096 (gpg_do_public_key) [RSA_AUTH]: Conditional compilation for RSA/ECDSA.
2097 * src/openpgp.c (cmd_internal_authenticate) [RSA_AUTH]: Likewise.
2099 * src/modp256.c (p256): Add const qualifier.
2101 2013-03-19 Niibe Yutaka <gniibe@fsij.org>
2103 * src/random.c (random_gen): New (was: random_byte).
2105 * src/call-rsa.c (rsa_sign): Follow change of API.
2106 (rsa_genkey): Use random_gen.
2107 (modulus_calc, rsa_decrypt, rsa_verify): Follow change of API.
2108 * src/openpgp-do.c (encrypt, decrypt): Likewise.
2110 * polarssl/include/polarssl/aes.h: Updated from PolarSSL 1.2.6.
2111 * polarssl/library/aes.c: Ditto.
2112 * polarssl/include/polarssl/rsa.h: Ditto.
2113 * polarssl/library/rsa.c: Ditto.
2114 * polarssl/include/polarssl/bignum.h: Ditto.
2115 * polarssl/library/bignum.c: Ditto.
2116 * polarssl: Move from polarssl-0.14.0, and needed files only.
2118 2013-03-15 Niibe Yutaka <gniibe@fsij.org>
2120 * regnual/regnual.ld (.bss): Put at RAM1. This makes reGNUal can
2121 be loaded on the lower address.
2123 * regnual/sys.c (entry): Don't change SP. Put alignment.
2125 * regnual/regnual.c (usb_cb_get_descriptor): Fix adding break.
2127 2013-03-14 Niibe Yutaka <gniibe@fsij.org>
2129 * tool/stlinkv2.py (stlinkv2.start): Call write_debug_reg to run
2132 2013-03-12 Niibe Yutaka <gniibe@fsij.org>
2134 * src/gnuk.ld.in (__process_stack_size__): Increase (was: 0x200).
2136 * tool/stlinkv2.py (stlinkv2.exit_from_debug_swd)
2137 (stlinkv2.exit_from_debug_swim): New.
2138 (stlinkv2.start): Call exit_from_debug_swd or
2139 exit_from_debug_swim.
2141 2013-03-09 Niibe Yutaka <gniibe@fsij.org>
2143 * src/openpgp-do.c (gpg_do_public_key): Add OID for ECDSA.
2144 (gpg_do_write_prvkey): Add PUBKEY_LEN for ECDSA.
2146 * src/flash.c (flash_key_write): Argument change for ECDSA key.
2148 * src/main.c (calculate_regnual_entry_address): New.
2149 (main): Use calculate_regnual_entry_address for entry point.
2151 * src/openpgp-do.c (gpg_do_write_prvkey): Coerce KDI.DATA to
2154 * src/usb_stm32f103.c (handle_setup0): Fix selecting handler.
2156 2013-03-08 Niibe Yutaka <gniibe@fsij.org>
2158 Relocatable reGNUal.
2160 * regnual/regnual.ld (MEMORY): 0x1400 was the value of Gnuk 1.0.1.
2162 (.text): Include .text.entry next to the .vectors.
2165 * regnual/sys.c (entry): Now, it's at .text.entry section.
2167 Don't use absolute values which causes relocations, but
2170 * regnual/Makefile (CFLAGS): Add -fpie.
2172 2013-03-07 Niibe Yutaka <gniibe@fsij.org>
2174 Follow the USB stack change.
2176 * regnual/regnual.c (usb_cb_device_reset): Rename from
2177 regnual_device_reset.
2178 (mem): Change type to uint32_t.
2179 (mem_info): Removed.
2180 (fetch): Avoid pointer punning.
2181 (usb_cb_ctrl_write_finish): Rename from regnual_ctrl_write_finish.
2182 (usb_cb_setup): Rename from regnual_setup.
2183 (usb_cb_get_descriptor): Rename from regnual_get_descriptor.
2184 (usb_cb_handle_event): Rename regnual_usb_event.
2185 (usb_cb_interface): Rename regnual_interface.
2186 (Device_Method): Remove.
2187 (usb_cb_get_descriptor): Not use struct Descriptor.
2189 2013-03-06 Niibe Yutaka <gniibe@fsij.org>
2191 USB stack implementation improvement.
2193 * src/usb_stm32f103.c (Device_Method, method_p): Remove.
2194 (usb_interrupt_handler): Call usb_cb_device_reset.
2195 (std_get_descriptor): Call usb_cb_get_descriptor.
2196 (std_set_configuration): Call usb_cb_handle_event.
2197 (std_get_status, std_get_interface, std_set_interface): Call
2199 (handle_setup0): Call usb_cb_setup.
2200 (handle_in0): Call usb_cb_handle_event and
2201 usb_cb_ctrl_write_finish.
2202 (request_handler): Remove.
2203 (handle_setup0): Call std_* directly, not indirectly by
2205 (ep_intr_handler_IN, ep_intr_handler_OUT): Remove.
2206 (usb_handle_transfer): Call EP*_Callback directly, not indirectly
2207 by ep_intr_handler_IN, ep_intr_handler_OUT.
2209 * src/usb_lld.h (struct usb_device_method, Device_Method): Remove.
2210 (usb_cb_device_reset, usb_cb_ctrl_write_finish)
2211 (usb_cb_setup, usb_cb_get_descriptor, usb_cb_handle_event)
2212 (usb_cb_interface): Define callbacks.
2213 (usb_initial_feature): New.
2214 (struct Descriptor): Move to ...
2215 * src/usb_desc.c: ... here.
2216 (usb_initial_feature): New.
2217 (usb_cb_get_descriptor): Rename from gnuk_get_descriptor and move
2220 * src/usb_ctrl.c (usb_cb_device_reset): Rename from
2222 (usb_cb_setup): Rename from gnuk_setup.
2223 (usb_cb_ctrl_write_finish): Rename from gnuk_ctrl_write_finish.
2224 (usb_cb_event): Rename from gnuk_usb_event.
2225 (usb_cb_interface): Rename from gnuk_interface.
2226 (Device_Method): Remove.
2228 * src/main.c (main): Use usb_initial_feature.
2230 2013-02-27 Niibe Yutaka <gniibe@fsij.org>
2232 * src/usb-icc.c (set_sw1sw2): Arguments are C and CHUNK_LEN.
2233 Fix reporting remaining bytes.
2234 (icc_send_data_block_gr): Follow the arguments change of
2237 2013-02-26 Niibe Yutaka <gniibe@fsij.org>
2239 * regnual/regnual.ld (MEMORY): Fix start address.
2241 * src/random.c (random_fini): New.
2242 * src/main.c (main): Call random_fini.
2244 2013-02-25 Niibe Yutaka <gniibe@fsij.org>
2246 * src/configure: Correct typo in help text.
2248 * src/gnuk.h (struct key_data_internal): Use uint32_t.
2249 * src/openpgp-do.c (do_openpgpcard_aid): Fix calculation of VID.
2250 (compute_key_data_checksum): Don't use type-punning pointer.
2251 (gpg_do_write_prvkey): Use coercing to char *.
2253 2013-02-22 Niibe Yutaka <gniibe@fsij.org>
2255 * src/openpgp-do.c (gpg_do_public_key): Add header of EC point.
2257 * src/openpgp-do.c (GPG_DO_DISCRETIONARY, cmp_discretionary): New.
2258 (cmp_app_data): Change to factor out GPG_DO_DISCRETIONARY.
2259 (gpg_do_table): Add GPG_DO_DISCRETIONARY.
2261 2013-02-21 Niibe Yutaka <gniibe@fsij.org>
2263 * src/gnuk.ld.in (MEMORY): Fix adding FLASH_SIZE unit.
2265 * src/call-ec_p256.c (ecdsa_sign): Fix secret key access.
2267 2013-02-20 Niibe Yutaka <gniibe@fsij.org>
2269 * src/openpgp.c (cmd_internal_authenticate): Support ECDSA for
2272 * src/openpgp-do.c (algorithm_attr_ecdsa): New.
2273 (algorithm_attr_rsa): Rename (was: algorithm_attr).
2274 (gpg_do_table): Change for GPG_DO_ALG_AUT.
2275 (gpg_do_write_prvkey): Support ECDSA key for authentication.
2276 (proc_key_import): Likewise.
2277 (gpg_do_public_key): Likewise.
2279 * src/call-ec_p256.c: New.
2280 * src/Makefile.in: Add call-ec_p256.c.
2281 * src/call-rsa.c (modulus_free): Remove.
2283 2013-02-19 Niibe Yutaka <gniibe@fsij.org>
2285 * regnual/regnual.ld (MEMORY): Fix address of regnual.
2287 * regnual/Makefile (MCFLAGS): Remove -mfix-cortex-m3-ldrd.
2288 (CFLAGS): Add output to .lst.
2289 * src/Makefile.in (MCFLAGS): Remove.
2291 * src/sha256.c: Update from NeuG 0.05.
2293 * ChibiOS_2.0.8: Remove.
2295 2013-02-18 Niibe Yutaka <gniibe@fsij.org>
2297 Changes for new ChibiOS/RT.
2298 * src/main.c: Include adc.h.
2299 (main): Call halInit, adc_init, and chSysInit (change for
2301 * src/random.h: New.
2302 * src/ac.c, src/bn.c, src/call-rsa.c, src/main.c: Include random.h.
2303 * src/openpgp.c, src/openpgp-do.c: Likewise.
2304 * src/configure, src/gnuk.ld.in: Add MEMORY_SIZE.
2305 * src/ec_p256.c: Fix call of bn256_add_uint.
2306 * boards/STM8S_DISCOVERY/*: Update for ChibiOS/RT 2.4.x.
2307 * boards/CQ_STARM/*: Likewise.
2308 * boards/FST_01_00/*: Likewise.
2309 * boards/OLIMEX_STM32_H103/*: Likewise.
2310 * boards/STBEE/*: Likewise.
2311 * boards/STBEE_MINI/*: Likewise.
2312 * boards/STM32_PRIMER2/*: Likewise.
2314 Merge ec_p256 branch.
2315 * src/Makefile.in: Add ECC files.
2316 * src/bn.h, src/bn.c: New.
2317 * src/jpc-ac.h, src/jpc.c: New.
2318 * src/ec_p256.h, src/ec_p256.c, src/ecc-cdh.c: New.
2319 * src/mod.h, src/mod.c, src/modp256.h, src/modp256.c: New.
2321 2013-02-17 Niibe Yutaka <gniibe@fsij.org>
2323 * chibios: New submodule for ChibioS/RT 2.4.x.
2324 * boards/FST_01/*: Update for ChibiOS/RT 2.4.x.
2325 * boards/common/mcuconf-common.h: Ditto.
2327 * src/chconf.h, src/halconf.h, src/Makefile.in, src/gnuk.ld.in:
2328 Update for ChibiOS/RT 2.4.x.
2330 * src/main.c, src/openpgp.c, src/usb-icc.c: Follow the change of
2332 * boards/common/board-common.c: Rename from hwinit.c.
2333 * src/usb_stm32f103.c: Rename from usb_lld.c.
2335 * src/neug.h, src/neug.c: Update NeuG 0.05.
2336 * src/adc_stm32f103.c, src/adc.h: New from NeuG 0.05.
2338 * src/random.c: Follow the change of NeuG 0.05.