目次

last update: 2024/04

RI600V4 (ITRON) RTOS用BSPパッケージ
第4章: 暗号・サイファーライブラリ
評価ボード:EK-RX671




テストサンプル

Demo Sample Application Folder:

Application
 └ _Exclude
     ├ CRYPTO  ....... 暗号・サイファー機能のデモサンプル
Sample説明
CRYPTO_Bench_AESAES 暗号ライブラリのベンチマークテスト
CRYPTO_Bench_CamelliaCamellia 暗号ライブラリのベンチマークテスト
CRYPTO_Bench_DESDES 暗号ライブラリのベンチマークテスト
CRYPTO_Bench_ECDHECDH 鍵アグリーメントライブラリのベンチマークテスト
CRYPTO_Bench_ECDSAECDSA デジタル署名暗号(Sign・Verify)のベンチマークテスト
CRYPTO_Bench_EdDSAEdDSA デジタル署名暗号(Sign・Verify)のベンチマークテスト
CRYPTO_Bench_MD5MD5 ハッシュアルゴリズムライブラリのベンチマークテスト
CRYPTO_Bench_SHA1SHA-1 ハッシュアルゴリズムライブラリのベンチマークテスト
CRYPTO_Bench_SHA3SHA-3 ハッシュアルゴリズムライブラリのベンチマークテスト
CRYPTO_Bench_SHA256SHA-256 ハッシュアルゴリズムライブラリのベンチマークテスト

関連設定ファイル:

BSP
 |- Setup
     |- CRYPTO_X_Config_Full_Generic.c  .... 初期化設定ファイル

Config
 |- CRYPTO_Conf.h  ............... コンフィグレーション設定ファイル 
 |
 |- OS
 |   |- CRYPTO_OS_uITRON_Config.c  ........... OSリソースID設定ファイル
 |   |- libRI600V4_OSLayer_RXv3_L.lib  ....... OSインターフェース設定ファイル
 |
 |- SYS   ........................ SYS インターフェース設定(ソース・ヘッダ)

ビルド・動作確認方法

プロジェクト設定では「\Application\_Exclude\CRYPTO」フォルダはビルド対象外に設定しています。

「\_Exclude\CRYPTO」フォルダ下の動作確認を行うテストサンプルファイルをビルド対象設定の「\Application」フォルダ下にコピーします。
プロジェクトを再ビルドし、評価ボードに接続してデバッグセッションを開始します。
デバッガのIOコンソールのログ画面から結果を確認します。

テストレポート

Sample: CRYPTO_Bench_AES

Debug IO Console:

Eval Board: EK-RX671
Base: Renesas RI600V4 RTOS
------------------------------------------------
AES Benchmark compiled Apr 12 2024 14:11:37

Compiler: CC-RX V3.05.00
System:   Processor speed               = 120.000 MHz
Config:   CRYPTO_VERSION                = 24001 [2.40a]
Config:   CRYPTO_CONFIG_AES_OPTIMIZE    = 7
Config:   CRYPTO_CONFIG_AES_HW_OPTIMIZE = 1
Config:   CRYPTO_CONFIG_GCM_OPTIMIZE    = 0

+--------------+------+-----------------+-----------------+
|              |      | ECB        MB/s | CBC        MB/s |
| Cipher       | Bits |     Enc     Dec |     Enc     Dec |
+--------------+------+-----------------+-----------------+
| AES          |  128 |    1.35    1.45 |    1.26    1.30 |
| AES          |  192 |    1.13    1.21 |    1.06    1.11 |
| AES          |  256 |    0.97    1.04 |    0.92    0.97 |
+--------------+------+-----------------+-----------------+
|              |      | GCM        MB/s | CCM        MB/s |
| Cipher       | Bits |     Enc     Dec |     Enc     Dec |
+--------------+------+-----------------+-----------------+
| AES          |  128 |    0.09    0.09 |    0.62    0.62 |
| AES          |  192 |    0.09    0.09 |    0.52    0.52 |
| AES          |  256 |    0.10    0.10 |    0.45    0.45 |
+--------------+------+-----------------+-----------------+

Benchmark complete

STOP.

Sample: CRYPTO_Bench_Camellia

Debug IO Console:

Eval Board: EK-RX671
Base: Renesas RI600V4 RTOS
------------------------------------------------
Camellia Benchmark compiled Apr 12 2024 14:24:15

Compiler: CC-RX V3.05.00
System:   Processor speed                 = 120.000 MHz
Config:   CRYPTO_VERSION                  = 24001 [2.40a]
Config:   CRYPTO_CONFIG_CAMELLIA_OPTIMIZE = 3
Config:   CRYPTO_CONFIG_GCM_OPTIMIZE      = 0

+--------------+------+-----------------+-----------------+
|              |      | ECB        MB/s | CBC        MB/s |
| Cipher       | Bits |     Enc     Dec |     Enc     Dec |
+--------------+------+-----------------+-----------------+
| CAMELLIA     |  128 |    2.08    2.16 |    1.85    1.88 |
| CAMELLIA     |  192 |    1.62    1.64 |    1.48    1.47 |
| CAMELLIA     |  256 |    1.62    1.64 |    1.48    1.47 |
+--------------+------+-----------------+-----------------+
|              |      | GCM        MB/s | CCM        MB/s |
| Cipher       | Bits |     Enc     Dec |     Enc     Dec |
+--------------+------+-----------------+-----------------+
| Camellia     |  128 |    0.10    0.10 |    0.91    0.91 |
| Camellia     |  192 |    0.09    0.09 |    0.72    0.72 |
| Camellia     |  256 |    0.10    0.10 |    0.72    0.72 |
+--------------+------+-----------------+-----------------+

Benchmark complete

STOP.

Sample: CRYPTO_Bench_DES

Debug IO Console:

Eval Board: EK-RX671
Base: Renesas RI600V4 RTOS
------------------------------------------------
DES Benchmark compiled Apr 12 2024 15:09:08

Compiler: CC-RX V3.05.00
System:   Processor speed               = 120.000 MHz
Config:   CRYPTO_VERSION                = 24001 [2.40a]
Config:   CRYPTO_CONFIG_DES_OPTIMIZE    = 5

+--------------+------+---------------+---------------+
|              |      | ECB      MB/s | CBC      MB/s |
| Cipher       | Bits |    Enc    Dec |    Enc    Dec |
+--------------+------+---------------+---------------+
| DES          |   64 |   1.17   1.21 |   1.31   1.31 |
| DES          |  128 |   0.47   0.47 |   0.49   0.48 |
| DES          |  192 |   0.47   0.47 |   0.49   0.48 |
+--------------+------+---------------+---------------+

* Note: key sizes include parity bits

Benchmark complete

STOP.

Sample: CRYPTO_Bench_ECDH

Debug IO Console:

Eval Board: EK-RX671
Base: Renesas RI600V4 RTOS
------------------------------------------------
ECDH Key Agreement Benchmark compiled Apr 12 2024 15:10:36

Compiler: CC-RX V3.05.00
System:   Processor speed          = 120.000 MHz
Config:   Static heap size         = 3256 bytes
Config:   CRYPTO_VERSION           = 24001 [2.40a]
Config:   CRYPTO_MPI_BITS_PER_LIMB = 32

This benchmarks both ends of an ECDH key agreement, but
timing is reported as the time for one end's calculation.

+------------------+--------------+--------------+
| Curve            | ms/Agreement |       Memory |
+------------------+--------------+--------------+
| secp192r1        |       117.60 |          704 |
| secp192k1        |       167.17 |          704 |
| secp224r1        |       143.75 |          792 |
| secp224k1        |       233.83 |          792 |
| secp256r1        |       223.33 |          880 |
| secp256k1        |       310.50 |          880 |
| secp384r1        |       409.00 |         1232 |
| secp521r1        |       885.00 |         1628 |
| brainpoolP160r1  |       120.70 |          616 |
| brainpoolP160t1  |       117.50 |          616 |
| brainpoolP192r1  |       171.50 |          704 |
| brainpoolP192t1  |       167.67 |          704 |
| brainpoolP224r1  |       231.17 |          792 |
| brainpoolP224t1  |       215.83 |          792 |
| brainpoolP256r1  |       318.25 |          880 |
| brainpoolP256t1  |       298.00 |          880 |
| brainpoolP320r1  |       513.00 |         1056 |
| brainpoolP320t1  |       472.75 |         1056 |
| brainpoolP384r1  |       807.00 |         1232 |
| brainpoolP384t1  |       775.00 |         1232 |
| brainpoolP512r1  |      1697.00 |         1584 |
| brainpoolP512t1  |      1530.00 |         1584 |
+------------------+--------------+--------------+

Benchmark complete

STOP.

Sample: CRYPTO_Bench_ECDSA

Debug IO Console:

Eval Board: EK-RX671
Base: Renesas RI600V4 RTOS
------------------------------------------------
ECDSA Sign and Verify Benchmark compiled Apr 12 2024 15:12:42

Compiler: CC-RX V3.05.00
System:   Processor speed                   = 120.000 MHz
Config:   Static heap size                  = 4440 bytes
Config:   CRYPTO_VERSION                    = 24001 [2.40a]
Config:   CRYPTO_MPI_BITS_PER_LIMB          = 32
Config:   CRYPTO_CONFIG_ECDSA_TWIN_MULTIPLY = 1

+------------------+-----------+-----------+-----------+-----------+
|                  |      Sign |     Sign  |    Verify |    Verify |
| Curve            |        ms |     bytes |        ms |     bytes |
+------------------+-----------+-----------+-----------+-----------+
| secp192r1        |     30.09 |      1152 |     28.89 |      1920 |
| secp192k1        |     42.71 |      1152 |     40.08 |      1920 |
| secp224r1        |     36.82 |      1296 |     35.07 |      2160 |
| secp224k1        |     57.94 |      1296 |     53.90 |      2160 |
| secp256r1        |     58.28 |      1440 |     54.85 |      2400 |
| secp256k1        |     78.07 |      1440 |     73.50 |      2400 |
| secp384r1        |    107.10 |      2016 |    100.90 |      3360 |
| secp521r1        |    232.00 |      2664 |    213.67 |      4440 |
| brainpoolP160r1  |     30.94 |      1008 |     30.62 |      1680 |
| brainpoolP160t1  |     28.94 |      1008 |     27.08 |      1680 |
| brainpoolP192r1  |     44.88 |      1152 |     41.79 |      1920 |
| brainpoolP192t1  |     41.23 |      1152 |     38.11 |      1920 |
| brainpoolP224r1  |     59.17 |      1296 |     56.61 |      2160 |
| brainpoolP224t1  |     54.45 |      1296 |     51.10 |      2160 |
| brainpoolP256r1  |     83.67 |      1440 |     75.79 |      2400 |
| brainpoolP256t1  |     75.79 |      1440 |     70.50 |      2400 |
| brainpoolP320r1  |    129.13 |      1728 |    118.60 |      2880 |
| brainpoolP320t1  |    120.90 |      1728 |    110.90 |      2880 |
| brainpoolP384r1  |    212.33 |      2016 |    196.00 |      3360 |
| brainpoolP384t1  |    197.67 |      2016 |    181.50 |      3360 |
| brainpoolP512r1  |    442.75 |      2592 |    394.50 |      4320 |
| brainpoolP512t1  |    394.00 |      2592 |    363.75 |      4320 |
+------------------+-----------+-----------+-----------+-----------+

Benchmark complete

STOP.

Sample: CRYPTO_Bench_EdDSA

Debug IO Console:

Eval Board: EK-RX671
Base: Renesas RI600V4 RTOS
------------------------------------------------
EdDSA Sign and Verify Benchmark compiled Apr 12 2024 15:17:07

Compiler: CC-RX V3.05.00
System:   Processor speed          = 120.000 MHz
Config:   Static heap size         = 3844 bytes
Config:   CRYPTO_VERSION           = 24001 [2.40a]
Config:   CRYPTO_MPI_BITS_PER_LIMB = 32

+--------------+--------------+
| Curve        | ms/Sign      |
+--------------+--------------+
| Ed25519      |        55.67 |
| Ed448        |       125.25 |
+--------------+--------------+

+--------------+--------------+
| Curve        | ms/Verify    |
+--------------+--------------+
| Ed25519      |       126.12 |
| Ed448        |       275.25 |
+--------------+--------------+

Benchmark complete

STOP.

Sample: CRYPTO_Bench_MD5

Debug IO Console:

Eval Board: EK-RX671
Base: Renesas RI600V4 RTOS
------------------------------------------------
MD5 Benchmark compiled Apr 12 2024 16:16:49

Compiler: CC-RX V3.05.00
System:   Processor speed               = 120.000 MHz
Config:   CRYPTO_VERSION                = 24001 [2.40a]
Config:   CRYPTO_CONFIG_MD5_OPTIMIZE    = 1
Config:   CRYPTO_CONFIG_MD5_HW_OPTIMIZE = 1

+--------------+-----------+
| Algorithm    | Hash MB/s |
+--------------+-----------+
| MD5          |      5.39 |
+--------------+-----------+

Benchmark complete

STOP.

Sample: CRYPTO_Bench_SHA1

Debug IO Console:

Eval Board: EK-RX671
Base: Renesas RI600V4 RTOS
------------------------------------------------
SHA-1 Benchmark compiled Apr 12 2024 16:32:16

Compiler: CC-RX V3.05.00
System:   Processor speed                = 120.000 MHz
Config:   CRYPTO_VERSION                 = 24001 [2.40a]
Config:   CRYPTO_CONFIG_SHA1_OPTIMIZE    = 1
Config:   CRYPTO_CONFIG_SHA1_HW_OPTIMIZE = 1

+--------------+-----------+
| Algorithm    | Hash MB/s |
+--------------+-----------+
| SHA-1        |      2.85 |
+--------------+-----------+

Benchmark complete

STOP.

Sample: CRYPTO_Bench_SHA3

Debug IO Console:

Eval Board: EK-RX671
Base: Renesas RI600V4 RTOS
------------------------------------------------
SHA-3 Benchmark compiled Apr 12 2024 16:34:12

Compiler: CC-RX V3.05.00
System:   Processor speed                = 120.000 MHz
Config:   CRYPTO_VERSION                 = 24001 [2.40a]
Config:   CRYPTO_CONFIG_SHA3_OPTIMIZE    = 1

+--------------+-----------+
| Algorithm    | Hash MB/s |
+--------------+-----------+
| SHA-3        |      0.53 |
+--------------+-----------+

Benchmark complete

STOP.

Sample: CRYPTO_Bench_SHA256

Debug IO Console:

Eval Board: EK-RX671
Base: Renesas RI600V4 RTOS
------------------------------------------------
SHA-256 Benchmark compiled Apr 12 2024 16:39:32

Compiler: CC-RX V3.05.00
System:   Processor speed                  = 120.000 MHz
Config:   CRYPTO_VERSION                   = 24001 [2.40a]
Config:   CRYPTO_CONFIG_SHA256_OPTIMIZE    = 1
Config:   CRYPTO_CONFIG_SHA256_HW_OPTIMIZE = 1

+--------------+-----------+
| Algorithm    | Hash MB/s |
+--------------+-----------+
| SHA-224 (SW) |      2.70 |
| SHA-256 (SW) |      2.70 |
+--------------+-----------+

Benchmark complete

STOP.
前の章

FAT32 ファイルシステム

次の章

セキュリティ機能の評価