Code Monkey home page Code Monkey logo

keccak-js's Introduction

Dependencies

KMAC -> cSHAKE -> SHAKE -> KECCAK[c]
HMAC -> SHAKE -> KECCAK[c]

KECCAK-p[b, nr] (S)

θ, ρ, π, χ, ι分别为5个不同的函数,在[NIST FIPS-202]Sec 3.2.1 - 3.2.5中给出

Rnd(A, ir) = ι(χ(π(ρ(θ(A)))), ir)

{
  input: {
    string S,
    number nr
  }
  output: {
    string S' `length b`
  }
  step: {
    1. 将S转换为state array A,如Sec 3.1.2中的定义
    2. for (let ir = 12+2l-nr; i <= 12+2l-1;) A = Rnd(A, ir)
    3. 将A转换成长度为b的字符串S',如Sec 3.1.3中定义
    4. 返回S'
  }
}

KECCAK-f

KECCAK-f[b] = KECCAK-p[b, 12+2l]
KECCAK-f[1600] = KECCAP-p[1600, 24]

KECCAK

underlying function: KECCAK-p[b, 12+2l] (Sec 3.3)
padding rule: pad10*1 (Sec 5.1)

rate r, capacity c
b = r + c -> {25, 50, 100, 200, 400, 800, 1600}

KECCAK[c]

b = 1600
KECCAK[c] = SPONGE[ KECCAK-p[1600,24], pad10*1, 1600-c ]
KECCAK[c](N, d) = SPONGE[ KECCAK-p[1600,24], pad10*1, 1600-c ](N, d)

SHA-3

message M
SHA3-224(M) = KECCAK[448] (M || 01, 224)
SHA3-256(M) = KECCAK[512] (M || 01, 256)
SHA3-384(M) = KECCAK[768] (M || 01, 384)
SHA3-512(M) = KECCAK[1024](M || 01, 512)

keccak-js's People

Contributors

chaosbreaking avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.