the hash function hamsi ozgu¨l ku¨c¸u¨k - ritspr/gdn2010/hamsi0.pdf · 2010-10-20 ·...

65
Hamsi Specification Design Choices and Analysis Implementation Conclusion The Hash Function Hamsi ¨ Ozg¨ ul K¨ uk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC February 27, 2009 ¨ Ozg¨ ul K¨ uk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC The Hash Function Hamsi

Upload: others

Post on 12-Aug-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

The Hash Function Hamsi

Ozgul Kucuk

Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

February 27, 2009

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 2: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

Outline

Hamsi SpecificationGeneral DesignMessage ExpansionHamsi-256

Design Choices and AnalysisHow to Analyze Hamsi?

ImplementationSoftware-Hardware

Conclusion

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 3: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

General Design

Outline

Hamsi SpecificationGeneral DesignMessage ExpansionHamsi-256

Design Choices and AnalysisHow to Analyze Hamsi?

ImplementationSoftware-Hardware

Conclusion

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 4: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

General Design

General Design

message blockchain value

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 5: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

General Design

General Design

message blockchain valueexpanded message

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 6: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

General Design

General Design

message blockchain valueexpanded message

Concatenation

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 7: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

General Design

General Design

message blockchain valueexpanded message

Concatenation

Truncated non-linear

Permutation P

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 8: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

General Design

General Design

message blockchain valueexpanded message

Concatenation

Truncated non-linear

Permutation P

chain value

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 9: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

General Design

General Design

message blockchain valueexpanded message

Concatenation

Truncated non-linear

Permutation P

chain value⊕

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 10: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

General Design

General DesignM

1

M2

Ml

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 11: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

General Design

General DesignM

1

M2

Ml

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 12: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

General Design

General DesignM

1

M2

Ml

h0

Con

cate

nat

ion

P

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 13: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

General Design

General DesignM

1

M2

Ml

h0

Con

cate

nat

ion

P

h1

Con

cate

nat

ion

P

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 14: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

General Design

General DesignM

1

M2

Ml

h0

Con

cate

nat

ion

P

h1

Con

cate

nat

ion

P

. . . . .

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 15: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

General Design

General DesignM

1

M2

Ml

h0

Con

cate

nat

ion

P

h1

Con

cate

nat

ion

P

. . . . .

hl−

1

Con

cate

nat

ion

Pf

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 16: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

General Design

General DesignM

1

M2

Ml

h0

Con

cate

nat

ion

P

h1

Con

cate

nat

ion

P

. . . . .

hl−

1

Con

cate

nat

ion

Pf

h

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 17: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

General Design

General Design

◮ General design is a sponge-like construction and influenced byGrindahl

◮ Message expansion◮ Feedforward of the previous chaining value◮ 2 different non-linear permutations; P , Pf

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 18: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

General Design

General Design

◮ General design is a sponge-like construction and influenced byGrindahl

◮ Message expansion◮ Feedforward of the previous chaining value◮ 2 different non-linear permutations; P , Pf

◮ Hamsi iteration operates over small message blocks◮ 32-bit → Hamsi-256◮ 64-bit → Hamsi-512

◮ Hamsi-256 → 512-bit internal state size◮ Hamsi-512 → 1024-bit internal state size

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 19: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

Message Expansion

Outline

Hamsi SpecificationGeneral DesignMessage ExpansionHamsi-256

Design Choices and AnalysisHow to Analyze Hamsi?

ImplementationSoftware-Hardware

Conclusion

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 20: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

Message Expansion

Message Expansion

Hamsi-256

Hamsi-512

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 21: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

Message Expansion

Message Expansion

Hamsi-256

Hamsi-512

32-bit

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 22: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

Message Expansion

Message Expansion

Hamsi-256

Hamsi-512

32-bit

Linear code [128,16,70] over F4

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 23: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

Message Expansion

Message Expansion

Hamsi-256

Hamsi-512

32-bit

Linear code [128,16,70] over F4

256-bit

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 24: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

Message Expansion

Message Expansion

Hamsi-256

Hamsi-512

32-bit

Linear code [128,16,70] over F4

256-bit

64-bit

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 25: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

Message Expansion

Message Expansion

Hamsi-256

Hamsi-512

32-bit

Linear code [128,16,70] over F4

256-bit

64-bit 512-bit

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 26: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

Message Expansion

Message Expansion

Hamsi-256

Hamsi-512

32-bit

Linear code [128,16,70] over F4

256-bit

64-bit

Linear code [256,32,131] over F4

512-bit

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 27: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

Message Expansion

Message Expansion

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 28: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

Message Expansion

Message Expansion

◮ Best Known Linear Codes; optimal choice for given parameters

◮ Minimum distance → active Sboxes for one round◮ 70 for Hamsi-256◮ 131 for Hamsi-512

◮ Provides strong diffusion against differential type attacks

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 29: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

Message Expansion

Message Expansion

◮ Best Known Linear Codes; optimal choice for given parameters

◮ Minimum distance → active Sboxes for one round◮ 70 for Hamsi-256◮ 131 for Hamsi-512

◮ Provides strong diffusion against differential type attacks

◮ Can be computed in parallel

◮ Can be implemented efficiently in software and hardware

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 30: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

Hamsi-256

Outline

Hamsi SpecificationGeneral DesignMessage ExpansionHamsi-256

Design Choices and AnalysisHow to Analyze Hamsi?

ImplementationSoftware-Hardware

Conclusion

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 31: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

Hamsi-256

Permutations P and Pf

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 32: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

Hamsi-256

Permutations P and Pf

◮ XOR of constants and a counter

◮ Substitution is by 4 × 4-bit Sboxes

◮ Diffusion is by a linear transformation L

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 33: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

Hamsi-256

Permutations P and Pf

◮ XOR of constants and a counter

◮ Substitution is by 4 × 4-bit Sboxes

◮ Diffusion is by a linear transformation L

◮ Sbox and L are from the block cipher Serpent

◮ P and Pf only differ in the number of rounds and constants◮ P has 3 rounds, Pf has 6 rounds◮ Pf is only applied at the finalization

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 34: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

Hamsi-256

Concatenation

(m0,m1, . . . ,m7, c0, c1, . . . , c7)

Hamsi-256 state

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 35: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

Hamsi-256

Concatenation

(m0,m1, . . . ,m7, c0, c1, . . . , c7)

Hamsi-256 state

C

m0 m1 c0 c1

c2 c3 m2 m3

m4 m5 c4 c5

c6 c7 m6 m7

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 36: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

Hamsi-256

Concatenation

(m0,m1, . . . ,m7, c0, c1, . . . , c7)

Hamsi-256 state

C

m0 m1 c0 c1

c2 c3 m2 m3

m4 m5 c4 c5

c6 c7 m6 m7

◮ Each Sbox inputs 2-bits from the chain value and theexpanded message.

◮ Chaining value and expanded message words appear in all bitpositions of the Sboxes.

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 37: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

Hamsi-256

SubstitutionHamsi-256 state

s0 s1 s2 s3

s4 s5 s6 s7

s8 s9 s10 s11

s12 s13 s14 s15

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 38: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

Hamsi-256

SubstitutionHamsi-256 state

s0 s1 s2 s3

s4 s5 s6 s7

s8 s9 s10 s11

s12 s13 s14 s15

S

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 39: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

Hamsi-256

SubstitutionHamsi-256 state

s0 s1 s2 s3

s4 s5 s6 s7

s8 s9 s10 s11

s12 s13 s14 s15

S

◮ 4 × 4 Serpent Sbox

◮ Confusion/diffusion across the rows

◮ Can be processed in parallel, word size up to 128-bits

◮ Suitable for bitsliced implementation

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 40: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

Hamsi-256

Diffusion

Hamsi-256 state

A0 B0 C0 D0

D1 A1 B1 C1

C2 D2 A2 B2

B3 C3 D3 A3

L

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 41: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

Hamsi-256

Diffusion

Hamsi-256 state

A0 B0 C0 D0

D1 A1 B1 C1

C2 D2 A2 B2

B3 C3 D3 A3

L

Diffusion by L

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 42: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

Hamsi-256

Diffusion

Hamsi-256 state

A0 B0 C0 D0

D1 A1 B1 C1

C2 D2 A2 B2

B3 C3 D3 A3

L

Diffusion by L

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 43: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

Hamsi-256

Diffusion

Hamsi-256 state

A0 B0 C0 D0

D1 A1 B1 C1

C2 D2 A2 B2

B3 C3 D3 A3

L

Diffusion by L

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 44: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

Hamsi-256

Diffusion

Hamsi-256 state

A0 B0 C0 D0

D1 A1 B1 C1

C2 D2 A2 B2

B3 C3 D3 A3

L

Diffusion by L

◮ L consists of XOR, rotation and shift operations

◮ L operates on 32-bit words; inputs and outputs 4 words

◮ Any single bit difference amplified by L affects a different Sbox

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 45: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

Hamsi-256

Truncation

Hamsi-256 state

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 46: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

Hamsi-256

Truncation

Hamsi-256 state After truncation

T

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 47: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

Design Choices and Analysis

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 48: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

Design Choices and Analysis

◮ Design choices are due to preliminary analysis

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 49: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

Design Choices and Analysis

◮ Design choices are due to preliminary analysis◮ Strong message expansion◮ Concatenation can be viewed as an initial mixing

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 50: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

Design Choices and Analysis

◮ Design choices are due to preliminary analysis◮ Strong message expansion◮ Concatenation can be viewed as an initial mixing◮ Sboxes have good differential/linear and avalanche properties

◮ Algebraic degree of all but one output bit is 3; we are not

aware of any attacks based on this.

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 51: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

Design Choices and Analysis

◮ Design choices are due to preliminary analysis◮ Strong message expansion◮ Concatenation can be viewed as an initial mixing◮ Sboxes have good differential/linear and avalanche properties

◮ Algebraic degree of all but one output bit is 3; we are not

aware of any attacks based on this.

◮ Feedforward is added against generic preimage attacks◮ L is applied in such a way to destroy symmetry◮ Pf is to prevent against length extension and slide attacks

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 52: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

How to Analyze Hamsi?

Outline

Hamsi SpecificationGeneral DesignMessage ExpansionHamsi-256

Design Choices and AnalysisHow to Analyze Hamsi?

ImplementationSoftware-Hardware

Conclusion

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 53: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

How to Analyze Hamsi?

How to break Hamsi?

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 54: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

How to Analyze Hamsi?

How to break Hamsi?

◮ Internal collisions

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 55: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

How to Analyze Hamsi?

How to break Hamsi?

◮ Internal collisions◮ Any difference on the message very quickly activates many

Sboxes (thanks to message expansion. . . )◮ Message modification can not help to cancel difference

propagation (message block is concatenated to the chainvalue)

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 56: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

How to Analyze Hamsi?

How to break Hamsi?

◮ Internal collisions◮ Any difference on the message very quickly activates many

Sboxes (thanks to message expansion. . . )◮ Message modification can not help to cancel difference

propagation (message block is concatenated to the chainvalue)

◮ External collision seems much harder to find. . . (Pf has 6rounds)

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 57: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

How to Analyze Hamsi?

How to break Hamsi?

◮ Analyze the following:

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 58: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

How to Analyze Hamsi?

How to break Hamsi?

◮ Analyze the following:◮ Apply a difference only on the chain value◮ Propagate as far as you find a collision◮ Work backwards to find a matching difference on the message◮ Show that overall complexity is lower than the birthday bound

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 59: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

How to Analyze Hamsi?

How to break Hamsi?

◮ Analyze the following:◮ Apply a difference only on the chain value◮ Propagate as far as you find a collision◮ Work backwards to find a matching difference on the message◮ Show that overall complexity is lower than the birthday bound

◮ break 1 round of Hamsi-256; appreciated! (easy. . . ?)

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 60: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

How to Analyze Hamsi?

How to break Hamsi?

◮ Analyze the following:◮ Apply a difference only on the chain value◮ Propagate as far as you find a collision◮ Work backwards to find a matching difference on the message◮ Show that overall complexity is lower than the birthday bound

◮ break 1 round of Hamsi-256; appreciated! (easy. . . ?)

◮ break 2 rounds of Hamsi-256; very much appreciated!

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 61: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

How to Analyze Hamsi?

How to break Hamsi?

◮ Analyze the following:◮ Apply a difference only on the chain value◮ Propagate as far as you find a collision◮ Work backwards to find a matching difference on the message◮ Show that overall complexity is lower than the birthday bound

◮ break 1 round of Hamsi-256; appreciated! (easy. . . ?)

◮ break 2 rounds of Hamsi-256; very much appreciated!

◮ break 3 rounds of Hamsi-256; (well. . . will be good toknow. . . )

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 62: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

How to Analyze Hamsi?

How to break Hamsi?

◮ Analyze the following:◮ Apply a difference only on the chain value◮ Propagate as far as you find a collision◮ Work backwards to find a matching difference on the message◮ Show that overall complexity is lower than the birthday bound

◮ break 1 round of Hamsi-256; appreciated! (easy. . . ?)

◮ break 2 rounds of Hamsi-256; very much appreciated!

◮ break 3 rounds of Hamsi-256; (well. . . will be good toknow. . . )

◮ Use your imagination!

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 63: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

Software-Hardware

Outline

Hamsi SpecificationGeneral DesignMessage ExpansionHamsi-256

Design Choices and AnalysisHow to Analyze Hamsi?

ImplementationSoftware-Hardware

Conclusion

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 64: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

Software-Hardware

Software-Hardware

◮ Hamsi is a software and hardware friendly algorithm

◮ Hamsi-256 runs at 25cpb on Intel Core2 (in C using SSE2instructions)

◮ Further improvements are in progress

◮ Hardware results for Hamsi-256:◮ Area: 14.5KGate, UMC 130 nm library, typical case◮ Timing: 3.2ns as critical path delay, 310MHz◮ Throughput: 3.3Gbps

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi

Page 65: The Hash Function Hamsi Ozgu¨l Ku¨c¸u¨k - RITspr/gdn2010/hamsi0.pdf · 2010-10-20 · Substitution is by 4 ×4-bit Sboxes Diffusion is by a linear transformation L Sbox and L

Hamsi Specification Design Choices and Analysis Implementation Conclusion

Conclusion

◮ Hamsi is a secure and fast hash function

◮ Feel free to analyze it

◮ Feel free to make it faster

◮ http://homes.esat.kuleuven.be/~okucuk/hamsi/

Ozgul Kucuk Katholieke Universiteit Leuven, Dept. ESAT/SCD-COSIC

The Hash Function Hamsi