AIニュース最前線
最新ニュースAI日報Hacker日報週報動画AIツールトレンド企業

AIニュース最前線

世界中のAI最新情報を日本語で毎時更新

最新ニュース日報トレンド企業プレミアムRSS
© 2026 ainew.jp特定商取引法に基づく表記
ニュース一覧元記事を開く
Amazon Science·2026年4月8日 00:00·約16分で読める

Amazonにおけるポスト量子暗号の検証と最適化

#ポスト量子暗号#形式的検証#暗号実装#AWS#オープンソース#セキュリティ標準
TL;DR

AmazonのAutomated Reasoning GroupとAWS Cryptographyは、量子コンピュータ耐性のある暗号規格ML-KEMのオープンソースで形式的検証済みの最適化実装を公開し、顧客データの長期的な安全性を高次元で確保した。

AI深層分析2026年4月8日 01:42
4
重要/ 5段階
深度40%
5
関連度30%
3
実用性20%
5
革新性10%
4

キーポイント

1

量子コンピュータ脅威への対応

従来の公開鍵暗号(RSA/ECC)は量子コンピュータによって解読される可能性があり、「今保存して後で解読」攻撃への対策が急務である。

2

ML-KEM規格の標準化

NISTが2024年にFIPS-203を公開し、ML-KEM(旧Kyber)を量子コンピュータ耐性のある鍵合意メカニズムとして標準化した。

3

Amazonの3つの暗号工学目標

顧客データの安全性、顧客体験(コスト最小化)、保守性の向上を同時に達成することを目指している。

4

自動推論による緊張の解決

シンプルさと高速化のトレードオフを、自動推論技術を用いて解決し、安全で高速かつ保守可能な暗号ソリューションを提供する。

5

オープンソース実装の意義

参照実装の簡潔さと研究論文の最適化手法を組み合わせ、生産環境対応の形式的検証済み実装をオープンソースで公開した。

影響分析・編集コメントを表示

影響分析

この取り組みは、量子コンピュータ脅威に対する実用的な対策を前倒しで提供し、業界全体のセキュリティ標準を引き上げる。オープンソースでの公開は、他社の実装検証や標準普及を促進し、エコシステム全体のレジリエンス向上に寄与する。

編集コメント

量子コンピュータ時代を見据えた実用的なセキュリティ対策の具体化として評価できる。PR要素はあるが、技術的詳細と業界標準への貢献が明確に示されており、実用性と深さが高い。

本日、安全なオンライン通信は、主にRSAと楕円曲線暗号(ECC)によって可能になっている公開鍵暗号によって支えられています。これらの安全性は、特定の計算問題が解読不能(intractable)であるという仮定に依存しています。しかし、従来のコンピュータにとっては解読不能と見なされているこれらの問題も、十分に大きな量子コンピュータにとっては解読可能(tractable)になる可能性があります。「今保存して後で復号」攻撃——暗号化された情報を傍受し、量子コンピュータがそれを復号できるようになるまで保持する攻撃——に対しては、技術的に実現可能となる遥か以前から、これらの攻撃に対する保護が必要です。量子耐性暗号(PQC: Post-quantum cryptography)とは、古典コンピュータ上で動作するが、量子計算の脅威に対して安全な暗号のことです。2024年、8年にわたる標準化作業を経て、米国国立標準技術研究所(NIST)はFIPS-203を公開し、量子コンピュータからの攻撃に対して安全であると見なされる鍵合意の仕組みとして、モジュール格子ベース鍵カプセル化機構(ML-KEM: Module-Lattice-Based Key Encapsulation Mechanism)を指定しました。本投稿では、AmazonのAutomated Reasoning Group、AWS Cryptography、そしてオープンソースコミュニティが協力して、ML-KEMのオープンソースかつ形式的に検証され最適化された実装を作成し、最高レベルの保証と最小限のコストで顧客を「今保存して後で復号」攻撃から保護する方法について説明します。

優れた暗号工学とは何か?

Amazonの顧客第一主義に則り、暗号ソリューションに取り組む際、私たちは以下の3つの目標を優先しています。

顧客データの安全性:暗号の実装は notoriously(有名になるほど)困難であり、いかなる欠陥も顧客のプライバシーを危険に晒す可能性があります。

顧客体験:暗号は計算上の「税」であり、顧客にとって最低のコストと最高の体験を提供するためにこれを最小限に抑えます。

将来のソリューション維持能力:メンテナンスに費やす時間が少なければ少ないほど、顧客のためにイノベーションを起こすことができます。

しかし、これらの目標の間には緊張関係があります。単純なコードは維持・実装が最も容易ですが、一般的に低速です。高速なコードは監査が困難でエラーが発生しやすい傾向があります。形式的推論(Automated reasoning)により、これらの緊張関係を解決し、顧客に対して安全かつ高速で、かつ保守可能な暗号ソリューションを一度に提供することができます。

なぜまたML-KEMの実装なのか?

ML-KEM(旧称:Kyber)は、実装の観点から十分に研究されています。一方では、Kyberの参照コードは長年にわたり精査されてきたクリーンなC言語実装を提供しています。他方では、多数の研究論文が、ML-KEMを各種の指標やプラットフォーム向けに最適化する方法を記述しています。2024年、AWS CryptographyとAutomated Reasoning Groupが直面した課題は、参照実装の単純さと研究論文で示された最適化の可能性を、単一の製品版(production-ready)の実装に組み合わせることでした。

ほぼ同じ時期、AWSはLinux FoundationのPost-Quantum Cryptography Alliance(PQCA)の創設メンバーとなり、PQCAは「標準化プロセスにある量子耐性暗号アルゴリズムの高保証ソフトウェア実装の構築を目指すオープンソースプロジェクトのコレクション」であるPost-Quantum Cryptography Package(PQCP)を作成しました。したがって、独自のコードを開発するのではなく、チームのメンバーはPQCPに参加し、まもなくmlkem-nativeを立ち上げました。これはML-KEMの参照実装と最適化および形式的検証に関する研究を組み合わせることを目的とした、高保証・高性能なC言語実装です。

コーディング:高速と低速

mlkem-nativeのモジュール型設計は、ML-KEMの高レベルロジックをカバーするフロントエンドと、すべてのパフォーマンスクリティカルなサブルーチンを担当するバックエンドを組み合わせています。Keccak置換(SHA3の基盤)や高速多項式演算の基盤となる数論変換(NTT: Number-theoretic transform)を含む各サブルーチンには、特定のハードウェア向けにネイティブに記述された複数の高効率実装があります。デフォルトのC言語実装に加え、mlkem-nativeはAArch64、x86_64、RISC-V64向けのアセンブリ/インスリンクス(intrinsics)バックエンドを提供します。保守性にとって重要なのは、フロントエンドとバックエンドのインターフェースが固定されていることです。新しいターゲットアーキテクチャ向けの最適化を追加する開発者は、バックエンド仕様に対して選択されたバックエンド機能を実装しますが、フロントエンドは変更されません。以下で説明するように、バックエンド仕様を開発することは、聞こえるほど単純ではありませんでした。

限界を知る:メモリ安全性

Cプログラミング言語でよく知られた課題の一つは、バッファオーバーフローのリスクです。メモリ領域の指定された制限を超えて書き込むと、データ構造が破損し、悪意を持って利用されると特権昇格コードの実行につながる可能性があります。このような問題の総称はメモリ安全性(memory safety)です。Rustのようなメモリ安全な言語は、例えば未定義の動作を示すのではなくパニックを起こすことで、境界外アクセスの影響を制限できますが、ミス自体を防ぐものではありません。

型安全性:もう一つのよく知られた課題は、ML-KEMの実装に関するものであり、整数オーバーフローのリスク——すなわち型安全性(type safety)の一側面です。RSAやECCと同様に、ML-KEMはモジュラ演算に依存しており、演算の結果を特定の数(ML-KEMの場合、素数3,329。MLKEM_Qまたは単にqと指定)で割った余りのみが次へ渡されます。モジュロ演算子はパーセント記号(%)で表されます。論理的に、ML-KEMで2つの数xとyを加算または乗算する必要がある場合、(x + y) % qおよび(x * y) % qを計算する必要があります。例えば、(294 * 38) % q = 11,172 % q = 1,185となります。データを一貫して「正準(canonical)」範囲{0, 1, 2, … , q-1}で表現するためにモジュラ減算を常に適用するこのような「積極的(eager)」なq法での演算は、著しく低速です。効率的なML-KEM実装は代わりに「消極的(lazy)」なq法での演算を使用します。データは可能な限りモジュラ減算なしで操作され、最悪の場合のオーバーフローリスクが生じて初めて減算が行われます。さらにこれにより、モンゴメリ減算などの不完全な減算アルゴリズムを使用することが可能になります。これらは高速ですが、常に完全に減少した出力を生成するわけではありません。

ML-KEMの場合、q = 3,329でのデータは通常、符号付き16ビット整数で保存されます。したがって、ML-KEM内の多数の演算ルーチンにわたる消極的演算を扱う際には、データの最悪の場合の境界を追跡し、その境界が16ビット整数の制限を超える場合にモジュラ減算を挿入することが不可欠です。この領域での小さなミスはテストで見逃されやすい——平均的な境界が最悪の場合の境界よりもはるかに小さいためです——そして本番環境でランダムに表面化することがあります。バッファ境界、特に演算境界を追跡することは時間がかかり、エラーが発生しやすいです。例えば、低レベルの演算関数の出力境界を弱めると、全く異なる関数で稀な演算オーバーフローを引き起こす可能性があります。これを手動でチェックするには、綿密なドキュメントと熟練した監査担当者が必要であり、開発を遅らせることにもなります。

mlkem-nativeでは、C Bounded Model Checker(CBMC)というツールを使用して、Cレベルでのメモリ安全性と型安全性を自動的に検証します。すべての関数について、バッファおよび演算データの境界を指定する機械可読かつ人間可読の契約(contracts)をソースコードに追加し、CBMCがその境界に関してバッファオーバーフローや演算オーバーフローが発生しないことを自動的に検証します。

モジュラ減算の単純な例を見てみましょう。関連する部分を一つずつ注目します。

まず、__contract__( ... ) に注意してください。やや簡略化すると、memory_no_aliasおよびmemory_slice行はコードが読み書きできるメモリを指定しており、これはメモリ安全性に関連します。ensures(array_bound(...))節は型安全性に関連し、関数が返す際にデータが区間[0, …, q)内にあることを保証することを指定しています。証明では、__loop__(invariant(...))が見え、ループがどのようにこの境界を段階的に確立するかを示しています。i番目の反復では、i番目の係数まで成立します。

最後に、実装はmlk_barrett_reduceおよびmlk_scalar_signed_to_unsigned_qを効果的に合成しています。CBMCはこれらの中身を見ず、契約に置き換えます。mlk_barrett_reduceがまず対称の出力区間(-q/2, …, q/2)を確立し、その後mlk_scalar_signed_to_unsigned_qがそれを[0, 1, …, q)にマッピングしていることがわかります。この例では、仕様が目視で望ましい方法で一致していることを確認するのは容易ですが、より複雑な例ではこれは明らかではありません。いずれにせよ、CBMCが自動的にチェックしてくれます。

安全を保ちながら高速化する

上記のCBMC証明は、mlkem-nativeのCコードに対するメモリ安全性と型安全性を確立します。しかし、mlkem-nativeの最もパフォーマンスクリティカルな部分——Keccak置換および数論変換——は、AArch64およびx86_64向けのハンド最適化アセンブリで実装されています。mlkem-nativeのアセンブリ実装に対する保証を高めつつ高性能を維持するために、私たちは3つのコンポーネントを使用します。SLOTHY(アセンブリのスーパーオプティマイザ)、HOL Light(定理証明器)、およびHOL Light上に構築されたアセンブリ用の検証インフラストラクチャであるs2n-bignumです。これらは、開発者がクリーンで保守可能なアセンブリを記述し、デプロイされたコードが正しさの形式的保証付きで最高パフォーマンスを達成するワークフローを可能にします。

手動で高性能なアセンブリを書くことは根本的な緊張関係を生み出します。計算を明確に表現するクリーンで監査可能なコードは低速であり、高速なコードは密でマイクロアーキテクチャ固有であり、保守が困難です。SLOTHYはこの緊張関係を、マイクロアーキテクチャ固有の最適化を自動化することで解決します。アセンブリプログラムを制約充足問題に変換し、制約ソルバを使用して最適な命令スケジュールおよびレジスタ割り当てを見つけ、最適化されたアセンブリを出力します。開発者は計算のロジックを強調したクリーンなコードを記述し、SLOTHYが高速なコードを生成します。

私たちはHOL Lightおよびs2n-bignumを使用して、すべてのAArch64およびx86_64アセンブリルーチンの機能的正しさを証明します。SLOTHYが使用される場所では、証明は特定の命令順序やレジスタ割り当てに依存しないように記述されます。したがって、証明を調整することなく、特定のマイクロアーキテクチャ向けにコードを再最適化できます。この「事後(post-hoc)」検証アプローチは、アセンブリがどのように生成されたかに関係なく、アセンブリによって表される計算の数学的正しさを確立します。特に、SLOTHYは信頼できる計算ベース(trusted computing base)から除外されます。

誠実さを保つ:形式的検証は絶対的なものではありません。すべての証明は、仕様やモデルといった形式オブジェクトを、非形式的な現実世界の要件およびシステムに結びつけますが、これらの結びつきにはギャップが生じます。形式仕様は実際に必要なものを捉えているか? 形式モデルは現実のシステムを忠実に反映しているか? 検証インフラストラクチャ自体は健全か? 顧客の信頼を獲得し維持するには、これらの限界について透明であることが必要です。したがって、mlkem-nativeで何が証明され、何が仮定され、残余リスクがどこにあるか——HOL Lightの証明で使用されるハードウェアモデルの忠実度から、CBMCのより大きな信頼できる計算ベース、そして2つの検証スタック間の手動ブリッジに至るまで——をマッピングした「SOUNDNESS.md」という文書を開発し公開しました。各ギャップについて、既存の緩和策を説明し、将来の作業を見通しています。私たちの目標は完全性を主張することではなく、透明性を通じて信頼を得ることです。コミュニティにSOUNDNESS.mdを批判的に読み、私たちの仮定に挑戦し、残りのギャップを閉じるのを手伝ってほしいと促しています。

実装への道:mlkem-nativeは、AWSのサービス全体の安全な通信を支えるAmazonのオープンソース暗号ライブラリであるAWS-LCに統合されています。この統合は、mlkem-nativeのソースコードを直接アップストリームリポジトリから取得する自動インポーターを使用しており、AWS-LCが最新の検証済み実装と同期していることを保証します。この統合は摩擦を最小限に設計されており、mlkem-nativeのモジュール型アーキテクチャにより、AWS-LCはコアのML-KEMロジックをインポートしつつ、プラットフォーム固有のコンポーネントの独自実装を提供できます。例えば、AWS-LCはmlkem-nativeの暗号プリミティブを既存のFIPS-202(SHA-3)実装にマッピングし、AWS-LCの乱数生成およびメモリゼロ化関数を使用し、必要に応じてペアワイズ一貫性テストなどのFIPSモード機能を有効にします。これを可能にするのは、mlkem-nativeのAPIをAWS-LCのインフラストラクチャに橋渡しする薄い互換性レイヤーであり、検証済みコードを変更することはありません。重要なのは、メモリ安全性と型安全性を証明するCBMC契約が、インポートされたソースコードに保持されていることです。プリプロセッサはこれらをコンパイル済みバイナリから削除しますが、ソースコード内では機械チェック可能なドキュメントとして残り、実装に付随する「生きた証明(living proof)」の形態となります。さらに、mlkem-nativeとAWS-LCの両方がオープンソースかつ寛容なライセンスであるため、その恩恵はAWSを超えて広がります。誰でもmlkem-nativeを自らのシステムに統合し、パフォーマンスと保証の同じ組み合わせを得ることができます。形式検証アーティファクト——CBMC契約およびHOL Light証明——はリポジトリの一部であり、関与するすべてのツールはオープンソースであり、セットアップおよび証明チェック用のスクリプトが提供されており、セキュリティ主張の独立した検証を呼びかけています。

影響:mlkem-nativeの開発は、形式的推論が体系的に適用される場合、暗号工学の3つの目標——安全性、パフォーマンス、保守性——が矛盾しないことを示しています。CBMCは複雑な演算を介して境界を手動で追跡することから解放し、テストで見逃され本番環境でランダムに表面化する可能性のあるエラーを検出しました。注釈はソースコード内に機械チェック可能なドキュメントとして残り、コードを同時により保守しやすく、より安全にしています。HOL Lightおよびs2n-bignumにより、正しさの数学的 certainty(確信)を持って積極的なアセンブリ最適化を展開できました。SLOTHYにより、特定のマイクロアーキテクチャ向けに最高パフォーマンスを達成しながら、クリーンで監査可能なコードを書くことができました。さらに、証明が最適化に依存しないように記述されているため、検証をやり直すことなくコードのリターゲットが可能です。結果として得られる実装は、従来の開発手法では達成できなかったものよりも、同時により安全で、高速であり、保守が容易です。顧客のセキュリティ、顧客体験、そしてイノベーション能力の間で妥協しませんでした——形式的推論がこれら3つすべてを提供しました。

AWS-LC-FIPS リリース | プラットフォーム | 演算 | c7i | Keygen | 30899651462.1 | Encaps | 30623612332.0 | Decaps | 25141515452.0

AWS-LC-FIPS リリース | プラットフォーム | 演算 | c7g | Keygen | 29617711342.4 | Encaps | 28482668742.3 | Decaps | 23919647652.3

Amazonの暗号ライブラリAWS-LCにおいて、ML-KEM参照実装からmlkem-nativeへの切り替えによるパフォーマンス影響。ML-KEM-768のパフォーマンスはc7iおよびc7g EC2インスタンスで測定されます。数値は1秒あたりの操作数(高いほど良い)を表します。ベースラインはML-KEM C参照実装を含むAWS-LC-FIPS 3.1リリースです。AWS-LC-FIPS 4リリースはmlkem-nativeでビルドされています。プラットフォームは、Intel(R) Xeon(R) Platinum 8488Cを搭載したc7iおよびGraviton 3プロセッサを搭載したc7gです。

謝辞:Automated Reasoning Groupのシニアプリンシパル応用科学者であるJohn Harrison氏に、HOL LightでのAArch64アセンブリ証明の大部分を提供し、HOL Lightインタラクティブ定理証明器およびs2n-bignum検証インフラストラクチャを維持してくれたことに感謝します。mlkem-nativeは、AWSだけでなくオープンソースコミュニティの多くのメンバーを含む協力的な取り組みです。まず第一に、mlkem-nativeを私たちと共に始め、それ以来プロジェクトの成功に不可欠な役割を果たしてきたzeroRISCの共同メンテナーであるMatthias Kannwischer氏に感謝します。

原文を表示

Today, secure online communication is enabled by public-key cryptography, primarily RSA and elliptic-curve cryptography (ECC), whose security depends on the assumption that certain computational problems are intractable. However, while believed to be intractable for conventional computers, the problems underlying RSA and ECC may be tractable for sufficiently large quantum computers. “Store now, decrypt later” attacks — which intercept encrypted information and hold onto it until quantum computers can decrypt it — require protection against these attacks long before they become technically feasible. Post-quantum cryptography (PQC) is cryptography running on classical computers but secure in the face of quantum computing. In 2024, following an eight-year standardization effort, the US National Institute of Standards and Technology (NIST) published standard FIPS-203, which specifies the Module-Lattice-Based Key Encapsulation Mechanism, or ML-KEM, as a mechanism for key agreement believed to be secure against attacks from quantum computers. In this post, we describe how Amazon’s Automated Reasoning Group, AWS Cryptography, and the open-source community have collaborated to create an open-source, formally verified, and optimized implementation of ML-KEM, protecting customers against store-now-decrypt-later attacks with the highest assurance and minimal cost. What is good cryptographic engineering? In keeping with Amazon’s customer obsession, we prioritize three goals when working on cryptographic solutions: The security of the customer’s data: Cryptography is notoriously hard to implement securely, and any flaw can endanger the customer’s privacy; The customer experience: Cryptography is a computational tax that we minimize to ensure the lowest cost and best experience for our customers; Our ability to maintain the solution going forward: The less time we need to spend on maintenance, the more we can innovate on behalf of our customers. There are, however, tensions between these goals: Simple code is easiest to maintain and write securely but tends to be slow. Fast code tends to be more difficult to audit and prone to errors. Automated reasoning allows us to resolve these tensions and provide our customers with cryptographic solutions that are secure, fast, and maintainable, all at once. Yet another implementation of ML-KEM? ML-KEM — formerly known as Kyber — is well studied from an implementation perspective: On the one hand, the Kyber reference code provides a clean C implementation that has been scrutinized for years. On the other hand, numerous research papers describe how to optimize ML-KEM for various metrics and platforms. The challenge faced by AWS Cryptography and the Automated Reasoning Group in 2024 was to combine the simplicity of the reference implementation and the optimization potential revealed in the research works in a single production-ready implementation. Around the same time, AWS became a founding member of the Linux Foundation’s Post-Quantum Cryptography Alliance (PQCA), which created the Post-Quantum Cryptography Package (PQCP), “a collection of open-source projects aiming to build high-assurance software implementations of standards-track post-quantum cryptography algorithms”. Therefore, rather than brewing our own code, members of our team joined the PQCP and soon after launched mlkem-native, a high-assurance, high-performance C implementation of ML-KEM aiming to combine the ML-KEM reference implementation with research on optimization and formal verification. Coding, fast and slow Mlkem-native’s modular design combines a frontend covering the high-level logic of ML-KEM with a backend responsible for all performance-critical subroutines. Each subroutine — including the Keccak permutation underlying SHA3 and the number-theoretic transform (NTT) underlying fast polynomial arithmetic — has multiple, highly efficient implementations written natively for specific hardware. In addition to the default C implementation, mlkem-native provides assembly/intrinsics backends for AArch64, x86_64, and RISC-V64. Importantly for maintainability, the interface between frontend and backend is fixed: a developer adding optimizations for a new target architecture implements select backend functionality against the backend specification, while the frontend stays the same. The development of the backend specification turned out to be less obvious than it sounds, as we explain below. Knowing your limits Memory safety A well-known challenge with the C programming language is the risk of buffer overflows: writing past the designated limits of a memory region can corrupt data structures and, when maliciously exploited, lead to unprivileged code execution. The umbrella term for such issues is memory safety. Memory-safe languages such as Rust can limit the impact of out-of-bounds accesses — by, for example, panicking instead of exhibiting undefined behavior — but they don’t prevent the mistake itself. Type safety Another well-known challenge, this time with implementing ML-KEM, is the risk of integer overflows — an aspect of type safety. Like RSA and ECC, ML-KEM relies on modular arithmetic, in which the results of operations are divided by a particular number — in ML-KEM’s case, the prime 3,329, designated MLKEM_Q or just q — and only the remainder is carried forward. The modulo operator is represented by the percentage symbol, %. Logically, if two numbers x and y need adding or multiplying in ML-KEM, one needs to compute (x + y) % q and (x * y) % q; for example, (294 * 38) % q = 11,172 % q = 1,185. Such “eager” arithmetic modulo q, which constantly applies modular reduction to represent data in the “canonical” range {0, 1, 2, … , q-1}, is prohibitively slow. Efficient ML-KEM implementations instead use “lazy” arithmetic modulo q: data is operated on without modular reduction for as long as possible, and only once there is a worst-case risk of overflow does reduction happen. Further, this allows the use of imperfect reduction algorithms such as Montgomery reduction, which are fast but don’t always give fully reduced outputs. In the case of ML-KEM, data modulo q = 3,329 is typically stored in signed 16-bit integers. When dealing with lazy arithmetic across the numerous arithmetic routines in ML-KEM, it is therefore essential to track the worst-case bounds of the data and insert modular reductions where those bounds would exceed the limits of 16-bit integers. Small mistakes in this domain can evade testing — because average bounds tend to be much smaller than worst-case bounds — and then randomly surface in production. Tracking buffer bounds and especially arithmetic bounds is time consuming and error prone: for example, weakening the output bounds of a low-level arithmetic function might lead to a rare arithmetic overflow in an entirely different function. Checking this by hand not only requires meticulous documentation and skilled auditors but also slows down development. In mlkem-native, we use a tool called the C Bounded Model Checker (CBMC) to automatically verify memory safety and type safety at the C level: for every function, we add machine- and human-readable contracts to the source code to specify the bounds of buffers and arithmetic data, and we have CBMC automatically verify that, with respect to those bounds, no buffer overflow or arithmetic overflow can happen. Let’s look at a simple example of modular reduction: Focusing on the relevant parts one at a time: First, note the __contract__( ... ) . Slightly simplified, the memory_no_alias and memory_slice lines specify which memory the code can read and write; this relates to memory safety. The ensures(array_bound(...)) clause relates to type safety: it specifies that the function will guarantee that upon return, the data is within the interval [0, 1, …, q). In the proof, you see the __loop__(invariant(...)), specifying how the loop gradually establishes this bound: in the ith iteration, it holds up to the ith coefficient. Finally, the implementation effectively composes mlk_barrett_reduce and mlk_scalar_signed_to_unsigned_q. CBMC does not look inside these but replaces them with their contracts: You can see that mlk_barrett_reduce first establishes a symmetric output interval (-q/2, …, q/2), and then mlk_scalar_signed_to_unsigned_q maps it to [0,1, …, q). In this instance, it is easy to confirm by eye that the specifications line up in the desired way, but for more complex examples, this is less obvious. Either way, CBMC checks it for us automatically. Going fast, staying safe The CBMC proofs described above establish memory safety and type safety for mlkem-native's C code. However, the most performance-critical parts of mlkem-native — the Keccak permutation and number theoretic transform — are implemented in hand-optimized assembly for AArch64 and x86_64. To gain assurance for the assembly implementations in mlkem-native while maintaining high performance, we use three components: SLOTHY, an assembly superoptimizer; HOL Light, a theorem prover; and s2n-bignum, a verification infrastructure for assembly built on HOL Light. Together, they enable a workflow where developers write clean, maintainable assembly, while deployed code achieves peak performance with formal guarantees of correctness. Writing high-performance assembly by hand creates a fundamental tension: clean, auditable code that clearly expresses the computation is slow, while fast code is dense, microarchitecture specific, and difficult to maintain. SLOTHY resolves this tension by automating microarchitecture-specific optimizations: it converts an assembly program into a constraint satisfaction problem, finds optimal instruction schedules and register allocations using a constraint solver, and outputs optimized assembly. Developers write clean code emphasizing the logic of the computation, and SLOTHY generates the fast code. We prove functional correctness for all AArch64 and x86_64 assembly routines using HOL Light and s2n-bignum. Where SLOTHY is used, the proofs are written to be agnostic to the specific instruction ordering and register allocation; we can therefore reoptimize the code for a specific microarchitecture without having to adjust the proofs. This “post-hoc” verification approach establishes the mathematical correctness of the computation represented by the assembly regardless of how it came about; in particular, SLOTHY is removed from the trusted computing base. Keeping it honest Formal verification is never absolute. Every proof links formal objects — specifications and models — to informal, real-world requirements and systems, and these links introduce gaps. Does the formal specification capture what we actually need? Does the formal model faithfully reflect the real system? Is the proof infrastructure itself sound? Earning and maintaining customer trust requires being transparent about these limits. We therefore developed and published a document titled SOUNDNESS.md, where we map out what is proved in mlkem-native, what is assumed, and where the residual risks lie — from the fidelity of the hardware models used in HOL Light proofs, to the larger trusted computing base of CBMC, to the manual bridge between the two verification stacks. For each gap, we describe mitigations in place and outline future work. Our goal is not to claim perfection but to earn trust through transparency. We encourage the community to read SOUNDNESS.md critically, challenge our assumptions, and help us close the remaining gaps. Getting on the road Mlkem-native is integrated into AWS-LC, Amazon's open-source cryptographic library, which underpins secure communication across AWS services. The integration uses an automated importer that pulls mlkem-native source code directly from the upstream repository, ensuring that AWS-LC stays synchronized with the latest verified implementation. The integration is designed for minimal friction: mlkem-native's modular architecture allows AWS-LC to import the core ML-KEM logic while providing its own implementations of platform-specific components. For example, AWS-LC maps mlkem-native's cryptographic primitives to its existing FIPS-202 (SHA-3) implementation, uses AWS-LC's random-number generation and memory zeroization functions, and enables FIPS-mode features like pairwise consistency tests when required. Enabling this is a thin compatibility layer that bridges mlkem-native's API to AWS-LC's infrastructure without modifying the verified code. Critically, the CBMC contracts that prove memory safety and type safety are preserved in the imported source code. While the preprocessor removes them from compiled binaries, they remain in the source as machine-checkable documentation of the code's guarantees — a form of "living proof" that travels with the implementation. Moreover, because both mlkem-native and AWS-LC are open source and permissively licensed, their benefits extend beyond AWS. Anyone can integrate mlkem-native into their systems and gain the same combination of performance and assurance. The formal verification artifacts — CBMC contracts and HOL Light proofs — are part of the repository, all tools involved are open source, and scripts are provided for setup and proof checking, inviting an independent validation of our security claims. Impact The development of mlkem-native demonstrates that the three goals of cryptographic engineering — security, performance, and maintainability — are not in conflict when automated reasoning is applied systematically. CBMC freed us from manually tracking bounds through complex arithmetic, catching errors that would evade testing and surface randomly in production. The annotations stay in the source code as machine-checkable documentation, making the code simultaneously more maintainable and more secure. HOL Light and s2n-bignum allowed us to deploy aggressive assembly optimizations with mathematical certainty of correctness. SLOTHY let us write clean, auditable code while achieving peak performance for specific microarchitectures. And because the proofs are written to be optimization agnostic, we can retarget the code without redoing the verification. The result is an implementation that is simultaneously more secure, faster, and easier to maintain than what traditional development could achieve. We didn't compromise between customer security, customer experience, and our ability to innovate: automated reasoning delivered all three. AWS-LC-FIPS releasePlatformOperation3.14.0Ratioc7iKeygen30899651462.1Encaps30623612332.0Decaps25141515452.0c7gKeygen29617711342.4Encaps28482668742.3Decaps23919647652.3Performance impact of switching from the ML-KEM reference implementation to mlkem-native in Amazon’s cryptography library AWS-LC. ML-KEM-768 performance is measured on c7i and c7g EC2 instances. The numbers represent operations per second (higher is better). The baseline is an AWS-LC-FIPS 3.1 release that contains the ML-KEM C reference implementation. The AWS-LC-FIPS 4 release is built with mlkem-native. The platforms are c7i with Intel(R) Xeon(R) Platinum 8488C and c7g with Graviton 3 processor. Acknowledgments We thank our colleague John Harrison, senior principal applied scientist at the Automated Reasoning Group, for providing the bulk of the AArch64 assembly proofs in HOL Light and for maintaining the HOL Light interactive theorem prover and the s2n-bignum verification infrastructure. Mlkem-native is a collaborative effort involving not only AWS but many members of the open-source community. Foremost, we thank our co-maintainer Matthias Kannwischer from zeroRISC, who started mlkem-native with us and has since been instrumental in the success of the project.

この記事をシェア

関連記事

Cloudflare Blog★42026年4月30日 23:00

Cloudflare の IPsec におけるポスト量子暗号化が一般利用可能に

Cloudflare は、サイト間ネットワーク向けにポスト量子暗号化を備えた IPsec プロトコルの一般提供を開始した。これにより、従来のハードルだった相互運用性と特殊なハードウェア要件のギャップが解消され、2029 年までの完全なセキュリティ目標達成に向けた一歩となった。

AWS Machine Learning Blog★42026年4月17日 02:34

Amazon Bedrockの自動推論チェックが生成AIのコンプライアンスを変える方法

AmazonはBedrock Guardrailsに自動推論チェックを導入し、確率的なAI検証を数学的検証に置き換えることで、規制対象業界のコンプライアンスチームの手動レビュー負担を軽減し、監査ギャップを解消する。

Cloudflare Blog★42026年4月8日 06:00

Cloudflare、完全な耐量子セキュリティを2029年までに実現を目指す

Cloudflareは、量子コンピュータ時代のセキュリティ対策である「耐量子暗号」への移行を加速しており、2029年までに認証を含む完全な耐量子セキュリティの実現を目標としている。同社は2019年から準備を開始し、2022年には全ウェブサイトとAPIで耐量子暗号化を有効化した。

ニュース一覧に戻る元記事を読む