sm3: Instructions file for Claude Code

CLAUDE.md

sm3 CLAUDE.md is an instructions file for Claude Code from ekscrypto/sm3. It costs 3,860 tokens per session, scanned A, original, MIT.

A set of project instructions for building SM3, a cryptographic hash function, as a Swift package. It describes the required Swift version, implementation limits, and official algorithm details.

In plain words
What is it for?
Use it when developing or reviewing an all-Swift SM3 implementation, including its 256-bit hash output and standard-defined constants.
Why use it?
It gives the coding agent the rules needed to keep the implementation compatible with the SM3 standard and the project's technical requirements.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md.

This is ekscrypto/sm3's own configuration. It tells Claude Code how to work on sm3 itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything sm3 configures →

Reuse

Borrowing it

Nothing to install: this file belongs to ekscrypto/sm3. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/ekscrypto/sm3/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/ekscrypto/sm3

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sm3 CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/ekscrypto/sm3/claude-md/github.svg)](https://agentmods.dev/instructions/ekscrypto/sm3/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/ekscrypto/sm3/claude-md"><img src="https://agentmods.dev/badge/instructions/ekscrypto/sm3/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for sm3 CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/ekscrypto/sm3/claude-md"><img src="https://agentmods.dev/badge/instructions/ekscrypto/sm3/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 3,860 This file is loaded in full into every session.
When invoked 3,860 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.03860 $0.03860
Opus 5.5 $0.01544 $0.01544
Sonnet 5.5 $0.00772 $0.00772
Haiku 4.5 $0.00386 $0.00386

Measured 2mo ago against content hash 7f8c30a899fe, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

sm3 CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 436 lines

How it starts

The opening of the file, as written. The whole thing — 436 lines — stays where its author put it; the contents beside it link to each section on GitHub.

SM3 Swift Implementation Project

Project Description

This project implements the ShangMi 3 (SM3) cryptographic hash algorithm as a Swift Package. The implementation must:

  • Use Swift 6.2
  • Be entirely implemented in Swift (no C or Objective-C)
  • No third-party libraries
  • Produce 256-bit hash values
  • Be compatible with official SM3 specifications

SM3 Algorithm Overview

SM3 is a cryptographic hash function published by the Chinese National Cryptography Administration on 2010-12-17 as GM/T 0004-2012: SM3 cryptographic hash algorithm. It is also standardized in:

  • GB/T 32905-2016 (Chinese standard)
  • ISO/IEC 10118-3:2018 (International standard)
  • IETF Draft: draft-sca-cfrg-sm3

Key Characteristics

  • Output Size: 256 bits (32 bytes)
  • Block Size: 512 bits (64 bytes)
  • Input Limit: Messages up to 2^64 bits
  • Construction: Merkle-Damgård with Davies-Meyer compression function
  • Security Level: Similar to SHA-256

Technical Specification

Constants

Initial Hash Value (IV)
0x7380166f, 0x4914b2b9, 0x172442d7, 0xda8a0600,
0xa96f30bc, 0x163138aa, 0xe38dee4d, 0xb0fb0e4e
Step Constants (T_j)
  • For j = 0 to 15: 0x79cc4519
  • For j = 16 to 63: 0x7a879d8a

Boolean Functions

FF_j (Message Schedule Function)
  • For j = 0 to 15: FF_j(X,Y,Z) = X ⊕ Y ⊕ Z
  • For j = 16 to 63: FF_j(X,Y,Z) = (X ∧ Y) ∨ (X ∧ Z) ∨ (Y ∧ Z)
GG_j (Compression Function)
  • For j = 0 to 15: GG_j(X,Y,Z) = X ⊕ Y ⊕ Z
  • For j = 16 to 63: GG_j(X,Y,Z) = (X ∧ Y) ∨ (¬X ∧ Z)

Permutation Functions

P₀(X)
P₀(X) = X ⊕ (X <<< 9) ⊕ (X <<< 17)

Where <<< denotes circular left shift (rotate left).

P₁(X)
P₁(X) = X ⊕ (X <<< 15) ⊕ (X <<< 23)

Algorithm Steps

1. Message Padding

Given a message M of length l bits:

  1. Append a single "1" bit to the message
  2. Append k "0" bits where k is the smallest non-negative solution to:
    l + 1 + k ≡ 448 (mod 512)
    
  3. Append the 64-bit big-endian representation of l
  4. Result: padded message with length ≡ 0 (mod 512)

Read the full file on GitHub · 436 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 436 lines · 3,860 tokens per session scan A 7f8c30a899fe

Subscribe to this mod's changes

sm3 CLAUDE.md is an instructions file published in the GitHub repository ekscrypto/sm3 (10 stars, last pushed 12mo ago), licensed MIT. It adds 3,860 tokens to every session, about $0.0154 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

sm3 CLAUDE.md compared with instructions from other repositories

sm3 CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
sm3 CLAUDE.mdekscrypto/sm3Instructions file1012mo agoMITA3,860Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,685GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,086GitHub Copilot
vscode model-prompts.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA2,022GitHub Copilot