目次

last update: 2024/09

OSレス環境用BSPパッケージ
第2章: 暗号・サイファーライブラリ
評価ボード:AP-RX651-0A




テストサンプル

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 ハッシュアルゴリズムライブラリのベンチマークテスト
CRYPTO_Bench_SHA512SHA-512 ハッシュアルゴリズムライブラリのベンチマークテスト

関連設定ファイル:

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

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

ビルド・動作確認方法

プロジェクト設定では「\Application\_Exclude\CRYPTO」フォルダはビルド対象外に設定しています。以下のどちらかの方法で動作確認を行うサンプルアプリケーションを選択します。

  1. 「\_Exclude\CRYPTO」フォルダ下の対象テストサンプルファイルをビルド対象設定の「\Application」フォルダ下にコピーします。
  2. 「\_Exclude\CRYPTO」フォルダ下の対象テストサンプルファイルのみ「ビルド対象外」の設定を解除します。

プロジェクトを再ビルドし、評価ボードに接続してデバッグセッションを開始します。
デバッガのIOコンソールのログ画面から結果を確認します。

テストレポート

Sample: CRYPTO_Bench_AES

Debug IO Console:

SEGGER Software Evaluation Sample
Eval Board: AP-RX651-0A (RX651 RXv2 @96MHz)
Base: Baremetal (No RTOS)
------------------------------------------------
AES Benchmark compiled Sep 30 2024 15:17:08

Compiler: CC-RX V3.06.00
System:   Processor speed               = 96.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 |    0.82    0.86 |    0.77    0.80 |
| AES          |  192 |    0.68    0.72 |    0.65    0.68 |
| AES          |  256 |    0.58    0.62 |    0.56    0.59 |
+--------------+------+-----------------+-----------------+
|              |      | GCM        MB/s | CCM        MB/s |
| Cipher       | Bits |     Enc     Dec |     Enc     Dec |
+--------------+------+-----------------+-----------------+
| AES          |  128 |    0.07    0.07 |    0.38    0.38 |
| AES          |  192 |    0.07    0.07 |    0.32    0.32 |
| AES          |  256 |    0.07    0.07 |    0.27    0.27 |
+--------------+------+-----------------+-----------------+

Benchmark complete

STOP.

Sample: CRYPTO_Bench_Camellia

Debug IO Console:

SEGGER Software Evaluation Sample
Eval Board: AP-RX651-0A (RX651 RXv2 @96MHz)
Base: Baremetal (No RTOS)
------------------------------------------------
Camellia Benchmark compiled Sep 30 2024 15:18:59

Compiler: CC-RX V3.06.00
System:   Processor speed                 = 96.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 |    1.54    1.57 |    1.39    1.38 |
| CAMELLIA     |  192 |    1.17    1.20 |    1.08    1.09 |
| CAMELLIA     |  256 |    1.17    1.20 |    1.08    1.09 |
+--------------+------+-----------------+-----------------+
|              |      | GCM        MB/s | CCM        MB/s |
| Cipher       | Bits |     Enc     Dec |     Enc     Dec |
+--------------+------+-----------------+-----------------+
| Camellia     |  128 |    0.07    0.07 |    0.68    0.68 |
| Camellia     |  192 |    0.07    0.07 |    0.53    0.53 |
| Camellia     |  256 |    0.07    0.07 |    0.53    0.53 |
+--------------+------+-----------------+-----------------+

Benchmark complete

STOP.

Sample: CRYPTO_Bench_DES

Debug IO Console:

SEGGER Software Evaluation Sample
Eval Board: AP-RX651-0A (RX651 RXv2 @96MHz)
Base: Baremetal (No RTOS)
------------------------------------------------
DES Benchmark compiled Sep 30 2024 15:20:24

Compiler: CC-RX V3.06.00
System:   Processor speed               = 96.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 |   0.95   0.94 |   0.88   0.87 |
| DES          |  128 |   0.33   0.33 |   0.32   0.32 |
| DES          |  192 |   0.33   0.33 |   0.32   0.32 |
+--------------+------+---------------+---------------+

* Note: key sizes include parity bits

Benchmark complete

STOP.

Sample: CRYPTO_Bench_ECDH

Debug IO Console:

SEGGER Software Evaluation Sample
Eval Board: AP-RX651-0A (RX651 RXv2 @96MHz)
Base: Baremetal (No RTOS)
------------------------------------------------
ECDH Key Agreement Benchmark compiled Sep 30 2024 15:21:36

Compiler: CC-RX V3.06.00
System:   Processor speed          = 96.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        |       160.13 |          704 |
| secp192k1        |       225.33 |          704 |
| secp224r1        |       190.17 |          792 |
| secp224k1        |       309.50 |          792 |
| secp256r1        |       305.75 |          880 |
| secp256k1        |       396.25 |          880 |
| secp384r1        |       561.00 |         1232 |
| secp521r1        |      1230.00 |         1628 |
| brainpoolP160r1  |       161.88 |          616 |
| brainpoolP160t1  |       149.75 |          616 |
| brainpoolP192r1  |       227.33 |          704 |
| brainpoolP192t1  |       222.33 |          704 |
| brainpoolP224r1  |       302.75 |          792 |
| brainpoolP224t1  |       291.75 |          792 |
| brainpoolP256r1  |       437.75 |          880 |
| brainpoolP256t1  |       382.25 |          880 |
| brainpoolP320r1  |       664.50 |         1056 |
| brainpoolP320t1  |       606.50 |         1056 |
| brainpoolP384r1  |      1101.50 |         1232 |
| brainpoolP384t1  |      1000.50 |         1232 |
| brainpoolP512r1  |      2155.00 |         1584 |
| brainpoolP512t1  |      2025.00 |         1584 |
+------------------+--------------+--------------+

Benchmark complete

STOP.

Sample: CRYPTO_Bench_ECDSA

Debug IO Console:

SEGGER Software Evaluation Sample
Eval Board: AP-RX651-0A (RX651 RXv2 @96MHz)
Base: Baremetal (No RTOS)
------------------------------------------------
ECDSA Sign and Verify Benchmark compiled Sep 30 2024 15:26:19

Compiler: CC-RX V3.06.00
System:   Processor speed                   = 96.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        |     41.00 |      1152 |     39.35 |      1920 |
| secp192k1        |     56.44 |      1152 |     53.85 |      1920 |
| secp224r1        |     49.23 |      1296 |     45.77 |      2160 |
| secp224k1        |     76.57 |      1296 |     73.93 |      2160 |
| secp256r1        |     78.14 |      1440 |     72.93 |      2400 |
| secp256k1        |    103.10 |      1440 |     95.25 |      2400 |
| secp384r1        |    141.88 |      2016 |    135.88 |      3360 |
| secp521r1        |    308.50 |      2664 |    285.75 |      4440 |
| brainpoolP160r1  |     42.17 |      1008 |     39.96 |      1680 |
| brainpoolP160t1  |     38.46 |      1008 |     38.04 |      1680 |
| brainpoolP192r1  |     59.22 |      1152 |     57.00 |      1920 |
| brainpoolP192t1  |     54.40 |      1152 |     52.50 |      1920 |
| brainpoolP224r1  |     80.00 |      1296 |     74.43 |      2160 |
| brainpoolP224t1  |     72.64 |      1296 |     69.00 |      2160 |
| brainpoolP256r1  |    107.80 |      1440 |    102.40 |      2400 |
| brainpoolP256t1  |     99.58 |      1440 |     93.67 |      2400 |
| brainpoolP320r1  |    169.67 |      1728 |    156.38 |      2880 |
| brainpoolP320t1  |    154.88 |      1728 |    146.25 |      2880 |
| brainpoolP384r1  |    281.00 |      2016 |    266.25 |      3360 |
| brainpoolP384t1  |    259.00 |      2016 |    234.33 |      3360 |
| brainpoolP512r1  |    560.50 |      2592 |    518.00 |      4320 |
| brainpoolP512t1  |    527.50 |      2592 |    467.00 |      4320 |
+------------------+-----------+-----------+-----------+-----------+

Benchmark complete

STOP.

Sample: CRYPTO_Bench_EdDSA

Debug IO Console:

SEGGER Software Evaluation Sample
Eval Board: AP-RX651-0A (RX651 RXv2 @96MHz)
Base: Baremetal (No RTOS)
------------------------------------------------
EdDSA Sign and Verify Benchmark compiled Sep 30 2024 15:29:07

Compiler: CC-RX V3.06.00
System:   Processor speed          = 96.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      |        75.64 |
| Ed448        |       170.00 |
+--------------+--------------+

+--------------+--------------+
| Curve        | ms/Verify    |
+--------------+--------------+
| Ed25519      |       171.00 |
| Ed448        |       372.75 |
+--------------+--------------+

Benchmark complete

STOP.

Sample: CRYPTO_Bench_MD5

Debug IO Console:

SEGGER Software Evaluation Sample
Eval Board: AP-RX651-0A (RX651 RXv2 @96MHz)
Base: Baremetal (No RTOS)
------------------------------------------------
MD5 Benchmark compiled Sep 30 2024 15:30:15

Compiler: CC-RX V3.06.00
System:   Processor speed               = 96.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          |      3.60 |
+--------------+-----------+

Benchmark complete

STOP.

Sample: CRYPTO_Bench_SHA1

Debug IO Console:

SEGGER Software Evaluation Sample
Eval Board: AP-RX651-0A (RX651 RXv2 @96MHz)
Base: Baremetal (No RTOS)
------------------------------------------------
SHA-1 Benchmark compiled Sep 30 2024 15:31:29

Compiler: CC-RX V3.06.00
System:   Processor speed                = 96.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.16 |
+--------------+-----------+

Benchmark complete

STOP.

Sample: CRYPTO_Bench_SHA3

Debug IO Console:

SEGGER Software Evaluation Sample
Eval Board: AP-RX651-0A (RX651 RXv2 @96MHz)
Base: Baremetal (No RTOS)
------------------------------------------------
SHA-3 Benchmark compiled Sep 30 2024 15:32:11

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

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

Benchmark complete

STOP.

Sample: CRYPTO_Bench_SHA256

Debug IO Console:

SEGGER Software Evaluation Sample
Eval Board: AP-RX651-0A (RX651 RXv2 @96MHz)
Base: Baremetal (No RTOS)
------------------------------------------------
SHA-256 Benchmark compiled Sep 30 2024 15:33:33

Compiler: CC-RX V3.06.00
System:   Processor speed                  = 96.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) |      1.83 |
| SHA-256 (SW) |      1.83 |
+--------------+-----------+

Benchmark complete

STOP.

Sample: CRYPTO_Bench_SHA512

Debug IO Console:

SEGGER Software Evaluation Sample
Eval Board: AP-RX651-0A (RX651 RXv2 @96MHz)
Base: Baremetal (No RTOS)
------------------------------------------------
SHA-512 Benchmark compiled Sep 30 2024 15:34:30

Compiler: CC-RX V3.06.00
System:   Processor speed                  = 96.000 MHz
Config:   CRYPTO_VERSION                   = 24001 [2.40a]
Config:   CRYPTO_CONFIG_SHA512_OPTIMIZE    = 2
Config:   CRYPTO_CONFIG_SHA512_HW_OPTIMIZE = 1

+--------------+-----------+
| Algorithm    | Hash MB/s |
+--------------+-----------+
| SHA-512 (SW) |      1.23 |
+--------------+-----------+

Benchmark complete

STOP.
前の章

評価版パッケージ内容

次の章

セキュリティ機能の評価