digest-kangarootwelve 0.0.2 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +71 -37
- data/Rakefile +7 -9
- data/digest-kangarootwelve.gemspec +323 -14
- data/ext/digest/kangarootwelve/ext.c +228 -177
- data/ext/digest/kangarootwelve/extconf.rb +15 -1
- data/ext/digest/kangarootwelve/keccak/armv6m/KangarooTwelve.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/armv6m/KeccakDuplexWidth1600.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/armv6m/KeccakP-1600-SnP.h +36 -0
- data/ext/digest/kangarootwelve/{KeccakP-1600-times2-SnP.h → keccak/armv6m/KeccakP-1600-times2-SnP.h} +10 -10
- data/ext/digest/kangarootwelve/{KeccakP-1600-times2-on1.c → keccak/armv6m/KeccakP-1600-times2-on1.c} +13 -7
- data/ext/digest/kangarootwelve/{KeccakP-1600-times4-SnP.h → keccak/armv6m/KeccakP-1600-times4-SnP.h} +10 -10
- data/ext/digest/kangarootwelve/{KeccakP-1600-times4-on1.c → keccak/armv6m/KeccakP-1600-times4-on1.c} +13 -7
- data/ext/digest/kangarootwelve/{KeccakP-1600-times8-SnP.h → keccak/armv6m/KeccakP-1600-times8-SnP.h} +10 -10
- data/ext/digest/kangarootwelve/{KeccakP-1600-times8-on1.c → keccak/armv6m/KeccakP-1600-times8-on1.c} +13 -7
- data/ext/digest/kangarootwelve/keccak/armv6m/KeccakP-1600-u2-32bi-armv6m-le-gcc.s +1334 -0
- data/ext/digest/kangarootwelve/keccak/armv6m/KeccakSpongeWidth1600.link.c +1 -0
- data/ext/digest/kangarootwelve/{PlSnP-Fallback.inc → keccak/armv6m/PlSnP-Fallback.inc} +11 -7
- data/ext/digest/kangarootwelve/keccak/armv6m/ext.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/armv7a/KangarooTwelve.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/armv7a/KeccakDuplexWidth1600.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/armv7a/KeccakP-1600-SnP.h +37 -0
- data/ext/digest/kangarootwelve/keccak/armv7a/KeccakP-1600-armv7a-le-neon-gcc.s +826 -0
- data/ext/digest/kangarootwelve/keccak/armv7a/KeccakP-1600-inplace-pl2-armv7a-neon-le-gcc.s +1245 -0
- data/ext/digest/kangarootwelve/keccak/armv7a/KeccakP-1600-times2-SnP.h +38 -0
- data/ext/digest/kangarootwelve/keccak/armv7a/KeccakP-1600-times4-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/armv7a/KeccakP-1600-times4-on2.c +38 -0
- data/ext/digest/kangarootwelve/keccak/armv7a/KeccakP-1600-times8-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/armv7a/KeccakP-1600-times8-on2.c +38 -0
- data/ext/digest/kangarootwelve/keccak/armv7a/KeccakSpongeWidth1600.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/armv7a/PlSnP-Fallback.inc +287 -0
- data/ext/digest/kangarootwelve/keccak/armv7a/ext.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/armv7m/KangarooTwelve.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/armv7m/KeccakDuplexWidth1600.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/armv7m/KeccakP-1600-SnP.h +36 -0
- data/ext/digest/kangarootwelve/keccak/armv7m/KeccakP-1600-inplace-32bi-armv7m-le-gcc.s +1170 -0
- data/ext/digest/kangarootwelve/keccak/armv7m/KeccakP-1600-times2-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/armv7m/KeccakP-1600-times2-on1.c +37 -0
- data/ext/digest/kangarootwelve/keccak/armv7m/KeccakP-1600-times4-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/armv7m/KeccakP-1600-times4-on1.c +37 -0
- data/ext/digest/kangarootwelve/keccak/armv7m/KeccakP-1600-times8-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/armv7m/KeccakP-1600-times8-on1.c +37 -0
- data/ext/digest/kangarootwelve/keccak/armv7m/KeccakSpongeWidth1600.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/armv7m/PlSnP-Fallback.inc +287 -0
- data/ext/digest/kangarootwelve/keccak/armv7m/ext.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/armv8a/KangarooTwelve.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/armv8a/KeccakDuplexWidth1600.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/armv8a/KeccakP-1600-SnP.h +28 -0
- data/ext/digest/kangarootwelve/keccak/armv8a/KeccakP-1600-armv8a-neon.s +537 -0
- data/ext/digest/kangarootwelve/keccak/armv8a/KeccakP-1600-times2-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/armv8a/KeccakP-1600-times2-on1.c +37 -0
- data/ext/digest/kangarootwelve/keccak/armv8a/KeccakP-1600-times4-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/armv8a/KeccakP-1600-times4-on1.c +37 -0
- data/ext/digest/kangarootwelve/keccak/armv8a/KeccakP-1600-times8-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/armv8a/KeccakP-1600-times8-on1.c +37 -0
- data/ext/digest/kangarootwelve/keccak/armv8a/KeccakSpongeWidth1600.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/armv8a/PlSnP-Fallback.inc +287 -0
- data/ext/digest/kangarootwelve/keccak/armv8a/ext.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/asmx86-64/KangarooTwelve.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/asmx86-64/KeccakDuplexWidth1600.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/asmx86-64/KeccakP-1600-SnP.h +37 -0
- data/ext/digest/kangarootwelve/keccak/asmx86-64/KeccakP-1600-times2-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/asmx86-64/KeccakP-1600-times2-on1.c +37 -0
- data/ext/digest/kangarootwelve/keccak/asmx86-64/KeccakP-1600-times4-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/asmx86-64/KeccakP-1600-times4-on1.c +37 -0
- data/ext/digest/kangarootwelve/keccak/asmx86-64/KeccakP-1600-times8-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/asmx86-64/KeccakP-1600-times8-on1.c +37 -0
- data/ext/digest/kangarootwelve/keccak/asmx86-64/KeccakP-1600-x86-64-gas.s +1190 -0
- data/ext/digest/kangarootwelve/keccak/asmx86-64/KeccakSpongeWidth1600.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/asmx86-64/PlSnP-Fallback.inc +287 -0
- data/ext/digest/kangarootwelve/keccak/asmx86-64/ext.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/asmx86-64shld/KangarooTwelve.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/asmx86-64shld/KeccakDuplexWidth1600.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/asmx86-64shld/KeccakP-1600-SnP.h +37 -0
- data/ext/digest/kangarootwelve/keccak/asmx86-64shld/KeccakP-1600-times2-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/asmx86-64shld/KeccakP-1600-times2-on1.c +37 -0
- data/ext/digest/kangarootwelve/keccak/asmx86-64shld/KeccakP-1600-times4-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/asmx86-64shld/KeccakP-1600-times4-on1.c +37 -0
- data/ext/digest/kangarootwelve/keccak/asmx86-64shld/KeccakP-1600-times8-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/asmx86-64shld/KeccakP-1600-times8-on1.c +37 -0
- data/ext/digest/kangarootwelve/keccak/asmx86-64shld/KeccakP-1600-x86-64-shld-gas.s +1190 -0
- data/ext/digest/kangarootwelve/keccak/asmx86-64shld/KeccakSpongeWidth1600.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/asmx86-64shld/PlSnP-Fallback.inc +287 -0
- data/ext/digest/kangarootwelve/keccak/asmx86-64shld/ext.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/avr8/KangarooTwelve.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/avr8/KeccakDuplexWidth1600.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/avr8/KeccakP-1600-SnP.h +37 -0
- data/ext/digest/kangarootwelve/keccak/avr8/KeccakP-1600-avr8-fast.s +1116 -0
- data/ext/digest/kangarootwelve/keccak/avr8/KeccakP-1600-times2-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/avr8/KeccakP-1600-times2-on1.c +37 -0
- data/ext/digest/kangarootwelve/keccak/avr8/KeccakP-1600-times4-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/avr8/KeccakP-1600-times4-on1.c +37 -0
- data/ext/digest/kangarootwelve/keccak/avr8/KeccakP-1600-times8-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/avr8/KeccakP-1600-times8-on1.c +37 -0
- data/ext/digest/kangarootwelve/keccak/avr8/KeccakSpongeWidth1600.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/avr8/PlSnP-Fallback.inc +287 -0
- data/ext/digest/kangarootwelve/keccak/avr8/ext.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/bulldozer/KangarooTwelve.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/bulldozer/KeccakDuplexWidth1600.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/bulldozer/KeccakP-1600-SnP.h +39 -0
- data/ext/digest/kangarootwelve/keccak/bulldozer/KeccakP-1600-XOP-config.h +6 -0
- data/ext/digest/kangarootwelve/keccak/bulldozer/KeccakP-1600-XOP.c +473 -0
- data/ext/digest/kangarootwelve/keccak/bulldozer/KeccakP-1600-times2-SIMD128.c +954 -0
- data/ext/digest/kangarootwelve/keccak/bulldozer/KeccakP-1600-times2-SnP.h +47 -0
- data/ext/digest/kangarootwelve/keccak/bulldozer/KeccakP-1600-times4-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/bulldozer/KeccakP-1600-times4-on2.c +38 -0
- data/ext/digest/kangarootwelve/keccak/bulldozer/KeccakP-1600-times8-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/bulldozer/KeccakP-1600-times8-on2.c +38 -0
- data/ext/digest/kangarootwelve/keccak/bulldozer/KeccakP-1600-unrolling.macros +302 -0
- data/ext/digest/kangarootwelve/keccak/bulldozer/KeccakSpongeWidth1600.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/bulldozer/PlSnP-Fallback.inc +287 -0
- data/ext/digest/kangarootwelve/keccak/bulldozer/SIMD128-config.h +9 -0
- data/ext/digest/kangarootwelve/{SnP-Relaned.h → keccak/bulldozer/SnP-Relaned.h} +13 -7
- data/ext/digest/kangarootwelve/keccak/bulldozer/ext.link.c +1 -0
- data/ext/digest/kangarootwelve/{KangarooTwelve.c → keccak/common/KangarooTwelve.c} +6 -10
- data/ext/digest/kangarootwelve/{KangarooTwelve.h → keccak/common/KangarooTwelve.h} +3 -7
- data/ext/digest/kangarootwelve/keccak/common/KeccakDuplex-common.h +37 -0
- data/ext/digest/kangarootwelve/keccak/common/KeccakDuplex.inc +192 -0
- data/ext/digest/kangarootwelve/keccak/common/KeccakDuplexWidth1600.c +34 -0
- data/ext/digest/kangarootwelve/keccak/common/KeccakDuplexWidth1600.h +25 -0
- data/ext/digest/kangarootwelve/{KeccakSponge-common.h → keccak/common/KeccakSponge-common.h} +5 -7
- data/ext/digest/kangarootwelve/{KeccakSponge.inc → keccak/common/KeccakSponge.inc} +6 -8
- data/ext/digest/kangarootwelve/{KeccakSpongeWidth1600.c → keccak/common/KeccakSpongeWidth1600.c} +6 -8
- data/ext/digest/kangarootwelve/{KeccakSpongeWidth1600.h → keccak/common/KeccakSpongeWidth1600.h} +5 -7
- data/ext/digest/kangarootwelve/{Phases.h → keccak/common/Phases.h} +3 -7
- data/ext/digest/kangarootwelve/{align.h → keccak/common/align.h} +5 -7
- data/ext/digest/kangarootwelve/{brg_endian.h → keccak/common/brg_endian.h} +0 -0
- data/ext/digest/kangarootwelve/keccak/compact/KangarooTwelve.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/compact/KeccakDuplexWidth1600.link.c +1 -0
- data/ext/digest/kangarootwelve/{KeccakP-1600-SnP.h → keccak/compact/KeccakP-1600-SnP.h} +7 -10
- data/ext/digest/kangarootwelve/{KeccakP-1600-compact64.c → keccak/compact/KeccakP-1600-compact64.c} +11 -7
- data/ext/digest/kangarootwelve/keccak/compact/KeccakP-1600-times2-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/compact/KeccakP-1600-times2-on1.c +37 -0
- data/ext/digest/kangarootwelve/keccak/compact/KeccakP-1600-times4-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/compact/KeccakP-1600-times4-on1.c +37 -0
- data/ext/digest/kangarootwelve/keccak/compact/KeccakP-1600-times8-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/compact/KeccakP-1600-times8-on1.c +37 -0
- data/ext/digest/kangarootwelve/keccak/compact/KeccakSpongeWidth1600.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/compact/PlSnP-Fallback.inc +287 -0
- data/ext/digest/kangarootwelve/keccak/compact/SnP-Relaned.h +140 -0
- data/ext/digest/kangarootwelve/keccak/compact/ext.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/generic32/KangarooTwelve.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/generic32/KeccakDuplexWidth1600.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/generic32/KeccakP-1600-SnP.h +38 -0
- data/ext/digest/kangarootwelve/keccak/generic32/KeccakP-1600-inplace32BI.c +1162 -0
- data/ext/digest/kangarootwelve/keccak/generic32/KeccakP-1600-times2-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/generic32/KeccakP-1600-times2-on1.c +37 -0
- data/ext/digest/kangarootwelve/keccak/generic32/KeccakP-1600-times4-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/generic32/KeccakP-1600-times4-on1.c +37 -0
- data/ext/digest/kangarootwelve/keccak/generic32/KeccakP-1600-times8-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/generic32/KeccakP-1600-times8-on1.c +37 -0
- data/ext/digest/kangarootwelve/keccak/generic32/KeccakSpongeWidth1600.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/generic32/PlSnP-Fallback.inc +287 -0
- data/ext/digest/kangarootwelve/keccak/generic32/SnP-Relaned.h +140 -0
- data/ext/digest/kangarootwelve/keccak/generic32/ext.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/generic32lc/KangarooTwelve.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/generic32lc/KeccakDuplexWidth1600.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/generic32lc/KeccakP-1600-SnP.h +38 -0
- data/ext/digest/kangarootwelve/keccak/generic32lc/KeccakP-1600-inplace32BI.c +1162 -0
- data/ext/digest/kangarootwelve/keccak/generic32lc/KeccakP-1600-times2-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/generic32lc/KeccakP-1600-times2-on1.c +37 -0
- data/ext/digest/kangarootwelve/keccak/generic32lc/KeccakP-1600-times4-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/generic32lc/KeccakP-1600-times4-on1.c +37 -0
- data/ext/digest/kangarootwelve/keccak/generic32lc/KeccakP-1600-times8-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/generic32lc/KeccakP-1600-times8-on1.c +37 -0
- data/ext/digest/kangarootwelve/keccak/generic32lc/KeccakSpongeWidth1600.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/generic32lc/PlSnP-Fallback.inc +287 -0
- data/ext/digest/kangarootwelve/keccak/generic32lc/SnP-Relaned.h +140 -0
- data/ext/digest/kangarootwelve/keccak/generic32lc/ext.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/generic64/KangarooTwelve.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/generic64/KeccakDuplexWidth1600.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/generic64/KeccakP-1600-64.macros +2195 -0
- data/ext/digest/kangarootwelve/keccak/generic64/KeccakP-1600-SnP.h +49 -0
- data/ext/digest/kangarootwelve/keccak/generic64/KeccakP-1600-opt64-config.h +6 -0
- data/ext/digest/kangarootwelve/keccak/generic64/KeccakP-1600-opt64.c +541 -0
- data/ext/digest/kangarootwelve/keccak/generic64/KeccakP-1600-times2-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/generic64/KeccakP-1600-times2-on1.c +37 -0
- data/ext/digest/kangarootwelve/keccak/generic64/KeccakP-1600-times4-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/generic64/KeccakP-1600-times4-on1.c +37 -0
- data/ext/digest/kangarootwelve/keccak/generic64/KeccakP-1600-times8-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/generic64/KeccakP-1600-times8-on1.c +37 -0
- data/ext/digest/kangarootwelve/keccak/generic64/KeccakP-1600-unrolling.macros +302 -0
- data/ext/digest/kangarootwelve/keccak/generic64/KeccakSpongeWidth1600.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/generic64/PlSnP-Fallback.inc +287 -0
- data/ext/digest/kangarootwelve/keccak/generic64/SnP-Relaned.h +140 -0
- data/ext/digest/kangarootwelve/keccak/generic64/ext.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/generic64lc/KangarooTwelve.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/generic64lc/KeccakDuplexWidth1600.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/generic64lc/KeccakP-1600-64.macros +2195 -0
- data/ext/digest/kangarootwelve/keccak/generic64lc/KeccakP-1600-SnP.h +49 -0
- data/ext/digest/kangarootwelve/keccak/generic64lc/KeccakP-1600-opt64-config.h +7 -0
- data/ext/digest/kangarootwelve/keccak/generic64lc/KeccakP-1600-opt64.c +541 -0
- data/ext/digest/kangarootwelve/keccak/generic64lc/KeccakP-1600-times2-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/generic64lc/KeccakP-1600-times2-on1.c +37 -0
- data/ext/digest/kangarootwelve/keccak/generic64lc/KeccakP-1600-times4-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/generic64lc/KeccakP-1600-times4-on1.c +37 -0
- data/ext/digest/kangarootwelve/keccak/generic64lc/KeccakP-1600-times8-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/generic64lc/KeccakP-1600-times8-on1.c +37 -0
- data/ext/digest/kangarootwelve/keccak/generic64lc/KeccakP-1600-unrolling.macros +302 -0
- data/ext/digest/kangarootwelve/keccak/generic64lc/KeccakSpongeWidth1600.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/generic64lc/PlSnP-Fallback.inc +287 -0
- data/ext/digest/kangarootwelve/keccak/generic64lc/SnP-Relaned.h +140 -0
- data/ext/digest/kangarootwelve/keccak/generic64lc/ext.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/haswell/KangarooTwelve.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/haswell/KeccakDuplexWidth1600.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/haswell/KeccakP-1600-AVX2.s +993 -0
- data/ext/digest/kangarootwelve/keccak/haswell/KeccakP-1600-SnP.h +41 -0
- data/ext/digest/kangarootwelve/keccak/haswell/KeccakP-1600-times2-SIMD128.c +954 -0
- data/ext/digest/kangarootwelve/keccak/haswell/KeccakP-1600-times2-SnP.h +47 -0
- data/ext/digest/kangarootwelve/keccak/haswell/KeccakP-1600-times4-SIMD256.c +1303 -0
- data/ext/digest/kangarootwelve/keccak/haswell/KeccakP-1600-times4-SnP.h +53 -0
- data/ext/digest/kangarootwelve/keccak/haswell/KeccakP-1600-times8-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/haswell/KeccakP-1600-times8-on4.c +38 -0
- data/ext/digest/kangarootwelve/keccak/haswell/KeccakP-1600-unrolling.macros +302 -0
- data/ext/digest/kangarootwelve/keccak/haswell/KeccakSpongeWidth1600.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/haswell/PlSnP-Fallback.inc +287 -0
- data/ext/digest/kangarootwelve/keccak/haswell/SIMD128-config.h +8 -0
- data/ext/digest/kangarootwelve/keccak/haswell/SIMD256-config.h +7 -0
- data/ext/digest/kangarootwelve/keccak/haswell/ext.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/nehalem/KangarooTwelve.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/nehalem/KeccakDuplexWidth1600.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/nehalem/KeccakP-1600-64.macros +2195 -0
- data/ext/digest/kangarootwelve/keccak/nehalem/KeccakP-1600-SnP.h +49 -0
- data/ext/digest/kangarootwelve/keccak/nehalem/KeccakP-1600-opt64-config.h +7 -0
- data/ext/digest/kangarootwelve/keccak/nehalem/KeccakP-1600-opt64.c +541 -0
- data/ext/digest/kangarootwelve/keccak/nehalem/KeccakP-1600-times2-SIMD128.c +954 -0
- data/ext/digest/kangarootwelve/keccak/nehalem/KeccakP-1600-times2-SnP.h +47 -0
- data/ext/digest/kangarootwelve/keccak/nehalem/KeccakP-1600-times4-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/nehalem/KeccakP-1600-times4-on2.c +38 -0
- data/ext/digest/kangarootwelve/keccak/nehalem/KeccakP-1600-times8-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/nehalem/KeccakP-1600-times8-on2.c +38 -0
- data/ext/digest/kangarootwelve/keccak/nehalem/KeccakP-1600-unrolling.macros +302 -0
- data/ext/digest/kangarootwelve/keccak/nehalem/KeccakSpongeWidth1600.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/nehalem/PlSnP-Fallback.inc +287 -0
- data/ext/digest/kangarootwelve/keccak/nehalem/SIMD128-config.h +8 -0
- data/ext/digest/kangarootwelve/keccak/nehalem/SnP-Relaned.h +140 -0
- data/ext/digest/kangarootwelve/keccak/nehalem/ext.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/reference/KangarooTwelve.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/reference/KeccakDuplexWidth1600.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/reference/KeccakP-1600-SnP.h +41 -0
- data/ext/digest/kangarootwelve/keccak/reference/KeccakP-1600-reference.c +424 -0
- data/ext/digest/kangarootwelve/keccak/reference/KeccakP-1600-reference.h +20 -0
- data/ext/digest/kangarootwelve/keccak/reference/KeccakP-1600-times2-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/reference/KeccakP-1600-times2-on1.c +37 -0
- data/ext/digest/kangarootwelve/keccak/reference/KeccakP-1600-times4-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/reference/KeccakP-1600-times4-on1.c +37 -0
- data/ext/digest/kangarootwelve/keccak/reference/KeccakP-1600-times8-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/reference/KeccakP-1600-times8-on1.c +37 -0
- data/ext/digest/kangarootwelve/keccak/reference/KeccakSpongeWidth1600.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/reference/PlSnP-Fallback.inc +287 -0
- data/ext/digest/kangarootwelve/keccak/reference/displayIntermediateValues.c +176 -0
- data/ext/digest/kangarootwelve/keccak/reference/displayIntermediateValues.h +29 -0
- data/ext/digest/kangarootwelve/keccak/reference/ext.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/reference32bits/KangarooTwelve.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/reference32bits/KeccakDuplexWidth1600.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/reference32bits/KeccakP-1600-SnP.h +41 -0
- data/ext/digest/kangarootwelve/keccak/reference32bits/KeccakP-1600-reference.h +20 -0
- data/ext/digest/kangarootwelve/keccak/reference32bits/KeccakP-1600-reference32BI.c +612 -0
- data/ext/digest/kangarootwelve/keccak/reference32bits/KeccakP-1600-times2-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/reference32bits/KeccakP-1600-times2-on1.c +37 -0
- data/ext/digest/kangarootwelve/keccak/reference32bits/KeccakP-1600-times4-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/reference32bits/KeccakP-1600-times4-on1.c +37 -0
- data/ext/digest/kangarootwelve/keccak/reference32bits/KeccakP-1600-times8-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/reference32bits/KeccakP-1600-times8-on1.c +37 -0
- data/ext/digest/kangarootwelve/keccak/reference32bits/KeccakSpongeWidth1600.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/reference32bits/PlSnP-Fallback.inc +287 -0
- data/ext/digest/kangarootwelve/keccak/reference32bits/displayIntermediateValues.c +176 -0
- data/ext/digest/kangarootwelve/keccak/reference32bits/displayIntermediateValues.h +29 -0
- data/ext/digest/kangarootwelve/keccak/reference32bits/ext.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/sandybridge/KangarooTwelve.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/sandybridge/KeccakDuplexWidth1600.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/sandybridge/KeccakP-1600-64.macros +2195 -0
- data/ext/digest/kangarootwelve/keccak/sandybridge/KeccakP-1600-SnP.h +49 -0
- data/ext/digest/kangarootwelve/keccak/sandybridge/KeccakP-1600-opt64-config.h +8 -0
- data/ext/digest/kangarootwelve/keccak/sandybridge/KeccakP-1600-opt64.c +541 -0
- data/ext/digest/kangarootwelve/keccak/sandybridge/KeccakP-1600-times2-SIMD128.c +954 -0
- data/ext/digest/kangarootwelve/keccak/sandybridge/KeccakP-1600-times2-SnP.h +47 -0
- data/ext/digest/kangarootwelve/keccak/sandybridge/KeccakP-1600-times4-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/sandybridge/KeccakP-1600-times4-on2.c +38 -0
- data/ext/digest/kangarootwelve/keccak/sandybridge/KeccakP-1600-times8-SnP.h +45 -0
- data/ext/digest/kangarootwelve/keccak/sandybridge/KeccakP-1600-times8-on2.c +38 -0
- data/ext/digest/kangarootwelve/keccak/sandybridge/KeccakP-1600-unrolling.macros +302 -0
- data/ext/digest/kangarootwelve/keccak/sandybridge/KeccakSpongeWidth1600.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/sandybridge/PlSnP-Fallback.inc +287 -0
- data/ext/digest/kangarootwelve/keccak/sandybridge/SIMD128-config.h +8 -0
- data/ext/digest/kangarootwelve/keccak/sandybridge/SnP-Relaned.h +140 -0
- data/ext/digest/kangarootwelve/keccak/sandybridge/ext.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/skylakex/KangarooTwelve.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/skylakex/KeccakDuplexWidth1600.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/skylakex/KeccakP-1600-AVX512-config.h +6 -0
- data/ext/digest/kangarootwelve/keccak/skylakex/KeccakP-1600-AVX512.c +621 -0
- data/ext/digest/kangarootwelve/keccak/skylakex/KeccakP-1600-SnP.h +42 -0
- data/ext/digest/kangarootwelve/keccak/skylakex/KeccakP-1600-times2-SIMD512.c +852 -0
- data/ext/digest/kangarootwelve/keccak/skylakex/KeccakP-1600-times2-SnP.h +49 -0
- data/ext/digest/kangarootwelve/keccak/skylakex/KeccakP-1600-times4-SIMD512.c +883 -0
- data/ext/digest/kangarootwelve/keccak/skylakex/KeccakP-1600-times4-SnP.h +49 -0
- data/ext/digest/kangarootwelve/keccak/skylakex/KeccakP-1600-times8-SIMD512.c +1473 -0
- data/ext/digest/kangarootwelve/keccak/skylakex/KeccakP-1600-times8-SnP.h +53 -0
- data/ext/digest/kangarootwelve/keccak/skylakex/KeccakSpongeWidth1600.link.c +1 -0
- data/ext/digest/kangarootwelve/keccak/skylakex/SIMD512-2-config.h +7 -0
- data/ext/digest/kangarootwelve/keccak/skylakex/SIMD512-4-config.h +7 -0
- data/ext/digest/kangarootwelve/keccak/skylakex/SIMD512-config.h +7 -0
- data/ext/digest/kangarootwelve/keccak/skylakex/ext.link.c +1 -0
- data/ext/digest/kangarootwelve/utils.h +101 -0
- data/lib/digest/kangarootwelve/version.rb +2 -2
- data/test/test.rb +68 -31
- metadata +305 -27
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* Copyright (c) 2017 konsolebox
|
2
|
+
* Copyright (c) 2017-2018 konsolebox
|
3
3
|
*
|
4
4
|
* MIT License
|
5
5
|
*
|
@@ -23,14 +23,15 @@
|
|
23
23
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
24
24
|
*/
|
25
25
|
|
26
|
-
#include "KangarooTwelve.h"
|
27
26
|
#include <ruby.h>
|
28
27
|
#include <ruby/digest.h>
|
29
28
|
|
29
|
+
#include "KangarooTwelve.h"
|
30
|
+
#include "utils.h"
|
31
|
+
|
30
32
|
#define KT_DEFAULT_DIGEST_LENGTH 64 /* 512 bits */
|
31
|
-
#define
|
33
|
+
#define KT_BLOCK_LENGTH 8192 /* chunkSize */
|
32
34
|
#define KT_MIN_DIGEST_LENGTH 1
|
33
|
-
#define KT_MIN_BLOCK_LENGTH 64
|
34
35
|
|
35
36
|
#define KT_DIGEST_API_VERSION_IS_SUPPORTED(version) (version == 3)
|
36
37
|
|
@@ -44,7 +45,9 @@ static ID _id_auto;
|
|
44
45
|
static ID _id_block_length;
|
45
46
|
static ID _id_b;
|
46
47
|
static ID _id_customization;
|
48
|
+
static ID _id_customization_hex;
|
47
49
|
static ID _id_c;
|
50
|
+
static ID _id_ch;
|
48
51
|
static ID _id_default;
|
49
52
|
static ID _id_digest_length;
|
50
53
|
static ID _id_d;
|
@@ -55,11 +58,10 @@ static ID _id_new;
|
|
55
58
|
static ID _id_n;
|
56
59
|
static ID _id_unpack;
|
57
60
|
|
58
|
-
static VALUE
|
59
|
-
static VALUE
|
60
|
-
static VALUE
|
61
|
-
static VALUE
|
62
|
-
static VALUE _class_Digest_KangarooTwelve_Metadata;
|
61
|
+
static VALUE _Digest;
|
62
|
+
static VALUE _Digest_KangarooTwelve;
|
63
|
+
static VALUE _Digest_KangarooTwelve_Impl;
|
64
|
+
static VALUE _Digest_KangarooTwelve_Metadata;
|
63
65
|
|
64
66
|
typedef struct {
|
65
67
|
KangarooTwelve_Instance instance;
|
@@ -69,38 +71,63 @@ typedef struct {
|
|
69
71
|
#define KT_CONTEXT kangarootwelve_context_t
|
70
72
|
#define KT_CONTEXT_PTR(void_ctx_ptr) ((KT_CONTEXT *) void_ctx_ptr)
|
71
73
|
|
74
|
+
#define _RSTRING_PTR_U(x) (unsigned char *)RSTRING_PTR(x)
|
75
|
+
|
72
76
|
static void check_digest_length(int digest_length)
|
73
77
|
{
|
74
78
|
if (!(digest_length >= KT_MIN_DIGEST_LENGTH))
|
75
79
|
rb_raise(rb_eArgError, "Digest length lesser than minimum (%d): %d", KT_MIN_DIGEST_LENGTH, digest_length);
|
76
80
|
}
|
77
81
|
|
78
|
-
static
|
82
|
+
static VALUE hex_encode_str(VALUE str)
|
83
|
+
{
|
84
|
+
int len;
|
85
|
+
VALUE hex;
|
86
|
+
|
87
|
+
len = RSTRING_LEN(str);
|
88
|
+
hex = rb_str_new(0, len * 2);
|
89
|
+
hex_encode_str_implied(_RSTRING_PTR_U(str), len, _RSTRING_PTR_U(hex));
|
90
|
+
return hex;
|
91
|
+
}
|
92
|
+
|
93
|
+
static VALUE hex_decode_str(VALUE str)
|
79
94
|
{
|
80
|
-
|
81
|
-
|
95
|
+
int len;
|
96
|
+
VALUE decoded;
|
97
|
+
|
98
|
+
len = RSTRING_LEN(str);
|
99
|
+
decoded = rb_str_new(0, calc_hex_decoded_str_length(len));
|
100
|
+
|
101
|
+
if (! hex_decode_str_implied(_RSTRING_PTR_U(str), len, _RSTRING_PTR_U(decoded))) {
|
102
|
+
VALUE inspect = rb_inspect(str);
|
103
|
+
rb_raise(rb_eArgError, "Failed to decode hex string %s.", RSTRING_PTR(inspect));
|
104
|
+
}
|
105
|
+
|
106
|
+
return decoded;
|
82
107
|
}
|
83
108
|
|
84
109
|
static int kangarootwelve_init(void *ctx)
|
85
110
|
{
|
111
|
+
VALUE klass_or_instance, digest_length, digest_length_int, customization;
|
112
|
+
|
86
113
|
if (ctx == NULL)
|
87
114
|
rb_raise(rb_eRuntimeError, "Context pointer is NULL.");
|
88
115
|
|
89
|
-
|
116
|
+
klass_or_instance = rb_current_receiver();
|
90
117
|
|
91
|
-
if (TYPE(klass_or_instance) == T_CLASS && klass_or_instance ==
|
118
|
+
if (TYPE(klass_or_instance) == T_CLASS && klass_or_instance == _Digest_KangarooTwelve_Impl)
|
92
119
|
rb_raise(rb_eStandardError, "Digest::KangarooTwelve::Impl is a base class and cannot be instantiated.");
|
93
120
|
|
94
|
-
|
121
|
+
digest_length = rb_funcall(klass_or_instance, _id_digest_length, 0);
|
95
122
|
|
96
123
|
if (TYPE(digest_length) != T_FIXNUM)
|
97
124
|
rb_raise(rb_eTypeError, "Invalid object type for digest length.");
|
98
125
|
|
99
|
-
|
126
|
+
digest_length_int = FIX2INT(digest_length);
|
100
127
|
|
101
128
|
check_digest_length(digest_length_int);
|
102
129
|
|
103
|
-
|
130
|
+
customization = rb_funcall(klass_or_instance, _id_customization, 0);
|
104
131
|
|
105
132
|
if (TYPE(customization) != T_NIL && TYPE(customization) != T_STRING)
|
106
133
|
rb_raise(rb_eTypeError, "Invalid object type for a customization string.");
|
@@ -127,34 +154,34 @@ static void kangarootwelve_update(void *ctx, unsigned char *data, size_t length)
|
|
127
154
|
|
128
155
|
static int kangarootwelve_finish(void *ctx, unsigned char *data)
|
129
156
|
{
|
157
|
+
VALUE customization;
|
158
|
+
|
130
159
|
if (ctx == NULL)
|
131
160
|
rb_raise(rb_eRuntimeError, "Context pointer is NULL.");
|
132
161
|
|
133
|
-
|
162
|
+
customization = KT_CONTEXT_PTR(ctx)->customization;
|
134
163
|
|
135
164
|
switch (TYPE(customization)) {
|
136
165
|
case T_NIL:
|
137
166
|
return KangarooTwelve_Final(&KT_CONTEXT_PTR(ctx)->instance, data, 0, 0) == 0;
|
138
167
|
case T_STRING:
|
139
|
-
return KangarooTwelve_Final(&KT_CONTEXT_PTR(ctx)->instance, data,
|
140
|
-
RSTRING_LEN(customization)) == 0;
|
168
|
+
return KangarooTwelve_Final(&KT_CONTEXT_PTR(ctx)->instance, data,
|
169
|
+
_RSTRING_PTR_U(customization), RSTRING_LEN(customization)) == 0;
|
141
170
|
default:
|
142
171
|
rb_raise(rb_eRuntimeError, "Object type of customization string became invalid.");
|
143
172
|
}
|
144
173
|
}
|
145
174
|
|
146
|
-
static VALUE
|
175
|
+
static VALUE implement(VALUE name, VALUE digest_length, VALUE customization)
|
147
176
|
{
|
148
|
-
|
149
|
-
|
177
|
+
VALUE impl_class, impl_class_name, prev_digest_length, metadata_obj;
|
178
|
+
ID impl_class_name_id, id;
|
179
|
+
int digest_length_int, prev_digest_length_int;
|
180
|
+
rb_digest_metadata_t *metadata;
|
150
181
|
|
151
|
-
static VALUE implement(VALUE name, VALUE digest_length, VALUE block_length, VALUE customization)
|
152
|
-
{
|
153
182
|
if (!KT_DIGEST_API_VERSION_IS_SUPPORTED(RUBY_DIGEST_API_VERSION))
|
154
183
|
rb_raise(rb_eRuntimeError, "Digest API version is not supported.");
|
155
184
|
|
156
|
-
int digest_length_int, block_length_int;
|
157
|
-
|
158
185
|
switch (TYPE(digest_length)) {
|
159
186
|
case T_NIL:
|
160
187
|
digest_length_int = KT_DEFAULT_DIGEST_LENGTH;
|
@@ -167,18 +194,6 @@ static VALUE implement(VALUE name, VALUE digest_length, VALUE block_length, VALU
|
|
167
194
|
rb_raise(rb_eTypeError, "Invalid value type for digest length.");
|
168
195
|
}
|
169
196
|
|
170
|
-
switch (TYPE(block_length)) {
|
171
|
-
case T_NIL:
|
172
|
-
block_length_int = KT_DEFAULT_BLOCK_LENGTH;
|
173
|
-
break;
|
174
|
-
case T_FIXNUM:
|
175
|
-
block_length_int = FIX2INT(block_length);
|
176
|
-
check_block_length(block_length_int);
|
177
|
-
break;
|
178
|
-
default:
|
179
|
-
rb_raise(rb_eTypeError, "Invalid value type for block length.");
|
180
|
-
}
|
181
|
-
|
182
197
|
switch (TYPE(customization)) {
|
183
198
|
case T_NIL:
|
184
199
|
case T_STRING:
|
@@ -187,8 +202,7 @@ static VALUE implement(VALUE name, VALUE digest_length, VALUE block_length, VALU
|
|
187
202
|
rb_raise(rb_eTypeError, "Invalid value type for customization string.");
|
188
203
|
}
|
189
204
|
|
190
|
-
|
191
|
-
ID impl_class_name_id, id;
|
205
|
+
impl_class_name = Qnil;
|
192
206
|
|
193
207
|
switch (TYPE(name)) {
|
194
208
|
case T_NIL:
|
@@ -198,12 +212,7 @@ static VALUE implement(VALUE name, VALUE digest_length, VALUE block_length, VALU
|
|
198
212
|
|
199
213
|
if (id == _id_auto) {
|
200
214
|
if (customization != Qnil) {
|
201
|
-
|
202
|
-
VALUE customization_hex = rb_ary_pop(customization_hex_in_array);
|
203
|
-
impl_class_name = rb_sprintf("KangarooTwelve_%d_%d_%s", digest_length_int, block_length_int,
|
204
|
-
StringValueCStr(customization_hex));
|
205
|
-
} else if (block_length_int != KT_DEFAULT_BLOCK_LENGTH) {
|
206
|
-
impl_class_name = rb_sprintf("KangarooTwelve_%d_%d", digest_length_int, block_length_int);
|
215
|
+
impl_class_name = hex_encode_str(customization);
|
207
216
|
} else {
|
208
217
|
impl_class_name = rb_sprintf("KangarooTwelve_%d", digest_length_int);
|
209
218
|
}
|
@@ -228,13 +237,11 @@ static VALUE implement(VALUE name, VALUE digest_length, VALUE block_length, VALU
|
|
228
237
|
rb_raise(rb_eTypeError, "Invalid argument type for class name.");
|
229
238
|
}
|
230
239
|
|
231
|
-
VALUE impl_class;
|
232
|
-
|
233
240
|
if (impl_class_name == Qnil) {
|
234
|
-
impl_class = rb_funcall(rb_cClass, _id_new, 1,
|
241
|
+
impl_class = rb_funcall(rb_cClass, _id_new, 1, _Digest_KangarooTwelve_Impl);
|
235
242
|
} else {
|
236
|
-
if (rb_const_defined(
|
237
|
-
impl_class = rb_const_get(
|
243
|
+
if (rb_const_defined(_Digest, impl_class_name_id)) {
|
244
|
+
impl_class = rb_const_get(_Digest, impl_class_name_id);
|
238
245
|
|
239
246
|
if (TYPE(impl_class) != T_CLASS) {
|
240
247
|
rb_raise(rb_eTypeError,
|
@@ -242,13 +249,13 @@ static VALUE implement(VALUE name, VALUE digest_length, VALUE block_length, VALU
|
|
242
249
|
StringValueCStr(impl_class_name));
|
243
250
|
}
|
244
251
|
|
245
|
-
if (rb_class_superclass(impl_class) !=
|
252
|
+
if (rb_class_superclass(impl_class) != _Digest_KangarooTwelve_Impl) {
|
246
253
|
rb_raise(rb_eTypeError,
|
247
254
|
"Digest::%s was already defined but not derived from Digest::KangarooTwelve::Impl.",
|
248
255
|
StringValueCStr(impl_class_name));
|
249
256
|
}
|
250
257
|
|
251
|
-
|
258
|
+
prev_digest_length = rb_ivar_get(impl_class, _id_digest_length);
|
252
259
|
|
253
260
|
if (TYPE(prev_digest_length) != T_FIXNUM) {
|
254
261
|
rb_raise(rb_eRuntimeError,
|
@@ -256,7 +263,7 @@ static VALUE implement(VALUE name, VALUE digest_length, VALUE block_length, VALU
|
|
256
263
|
StringValueCStr(impl_class_name));
|
257
264
|
}
|
258
265
|
|
259
|
-
|
266
|
+
prev_digest_length_int = FIX2INT(prev_digest_length);
|
260
267
|
|
261
268
|
if (prev_digest_length_int != digest_length_int) {
|
262
269
|
rb_raise(rb_eTypeError,
|
@@ -266,37 +273,17 @@ static VALUE implement(VALUE name, VALUE digest_length, VALUE block_length, VALU
|
|
266
273
|
digest_length_int);
|
267
274
|
}
|
268
275
|
|
269
|
-
VALUE prev_block_length = rb_ivar_get(impl_class, _id_block_length);
|
270
|
-
|
271
|
-
if (TYPE(prev_block_length) != T_FIXNUM) {
|
272
|
-
rb_raise(rb_eRuntimeError,
|
273
|
-
"Previous definition of Digest::%s has invalid block length value type.",
|
274
|
-
StringValueCStr(impl_class_name));
|
275
|
-
}
|
276
|
-
|
277
|
-
int prev_block_length_int = FIX2INT(prev_block_length);
|
278
|
-
|
279
|
-
if (prev_block_length_int != block_length_int) {
|
280
|
-
rb_raise(rb_eTypeError,
|
281
|
-
"Digest::%s was already defined but has different block length (%d instead of %d).",
|
282
|
-
StringValueCStr(impl_class_name),
|
283
|
-
prev_block_length_int,
|
284
|
-
block_length_int);
|
285
|
-
}
|
286
|
-
|
287
276
|
return impl_class;
|
288
277
|
}
|
289
278
|
|
290
|
-
impl_class = rb_define_class_id_under(
|
279
|
+
impl_class = rb_define_class_id_under(_Digest, impl_class_name_id, _Digest_KangarooTwelve_Impl);
|
291
280
|
}
|
292
281
|
|
293
|
-
|
294
|
-
rb_digest_metadata_t *metadata;
|
295
|
-
metadata_obj = Data_Make_Struct(_class_Digest_KangarooTwelve_Metadata, rb_digest_metadata_t, 0, -1, metadata);
|
282
|
+
metadata_obj = Data_Make_Struct(_Digest_KangarooTwelve_Metadata, rb_digest_metadata_t, 0, -1, metadata);
|
296
283
|
|
297
284
|
metadata->api_version = RUBY_DIGEST_API_VERSION;
|
298
285
|
metadata->digest_len = digest_length_int;
|
299
|
-
metadata->block_len =
|
286
|
+
metadata->block_len = KT_BLOCK_LENGTH;
|
300
287
|
metadata->ctx_size = sizeof(KT_CONTEXT);
|
301
288
|
metadata->init_func = kangarootwelve_init;
|
302
289
|
metadata->update_func = kangarootwelve_update;
|
@@ -304,7 +291,7 @@ static VALUE implement(VALUE name, VALUE digest_length, VALUE block_length, VALU
|
|
304
291
|
|
305
292
|
rb_ivar_set(impl_class, _id_metadata, metadata_obj);
|
306
293
|
rb_ivar_set(impl_class, _id_digest_length, INT2FIX(digest_length_int));
|
307
|
-
rb_ivar_set(impl_class, _id_block_length, INT2FIX(
|
294
|
+
rb_ivar_set(impl_class, _id_block_length, INT2FIX(KT_BLOCK_LENGTH));
|
308
295
|
rb_ivar_set(impl_class, _id_customization, customization);
|
309
296
|
|
310
297
|
return impl_class;
|
@@ -314,16 +301,25 @@ static VALUE implement(VALUE name, VALUE digest_length, VALUE block_length, VALU
|
|
314
301
|
* Document-module: Digest::KangarooTwelve
|
315
302
|
*
|
316
303
|
* The Digest::KangarooTwelve module is the main component of the KangarooTwelve
|
317
|
-
* extension.
|
304
|
+
* extension for Ruby.
|
318
305
|
*
|
319
|
-
*
|
320
|
-
*
|
321
|
-
*
|
306
|
+
* It contains singleton methods that can be used to create implementation
|
307
|
+
* classes. These implementation classes can then be used to create instances
|
308
|
+
* for producing hashes.
|
322
309
|
*
|
323
|
-
*
|
310
|
+
* Example:
|
324
311
|
*
|
325
|
-
*
|
326
|
-
*
|
312
|
+
* <tt>Digest::KangarooTwelve[32].new.update("one").update("two").digest</tt>
|
313
|
+
*
|
314
|
+
* The implementation classes can also be used to directly produce hashes.
|
315
|
+
*
|
316
|
+
* Example:
|
317
|
+
*
|
318
|
+
* <tt>Digest::KangarooTwelve[32].hexdigest("1234")</tt>
|
319
|
+
*
|
320
|
+
* The produced implementation classes and their instances can be used just like
|
321
|
+
* any other classes and instances in the Digest namespace that's based on
|
322
|
+
* Digest::Base.
|
327
323
|
*/
|
328
324
|
|
329
325
|
/*
|
@@ -332,12 +328,15 @@ static VALUE implement(VALUE name, VALUE digest_length, VALUE block_length, VALU
|
|
332
328
|
* Returns the default implementation class which has a digest length of 64
|
333
329
|
* bytes, and doesn't have a customization string.
|
334
330
|
*/
|
335
|
-
VALUE
|
331
|
+
static VALUE _Digest_KangarooTwelve_singleton_default(VALUE self)
|
336
332
|
{
|
337
|
-
VALUE default_ =
|
333
|
+
VALUE default_ = Qnil;
|
334
|
+
|
335
|
+
if (rb_ivar_defined(self, _id_default) == Qtrue)
|
336
|
+
default_ = rb_ivar_get(self, _id_default);
|
338
337
|
|
339
338
|
if (NIL_P(default_)) {
|
340
|
-
default_ = implement(ID2SYM(_id_auto), INT2FIX(KT_DEFAULT_DIGEST_LENGTH), Qnil
|
339
|
+
default_ = implement(ID2SYM(_id_auto), INT2FIX(KT_DEFAULT_DIGEST_LENGTH), Qnil);
|
341
340
|
rb_ivar_set(self, _id_default, default_);
|
342
341
|
}
|
343
342
|
|
@@ -360,15 +359,12 @@ VALUE rbx_Digest_KangarooTwelve_singleton_default(VALUE self)
|
|
360
359
|
* module.
|
361
360
|
*
|
362
361
|
* The default value for this option is +:auto+, and it implies automatic
|
363
|
-
* generation of the name. The generated name is in the
|
364
|
-
* Digest::KangarooTwelve_<digest_length> if
|
365
|
-
*
|
362
|
+
* generation of the name. The generated name is in the form of
|
363
|
+
* Digest::KangarooTwelve_<digest_length> if a customization string is not
|
364
|
+
* specified.
|
366
365
|
*
|
367
|
-
* If a customization string is specified, the format would
|
368
|
-
* Digest::KangarooTwelve_<digest_length>_<
|
369
|
-
*
|
370
|
-
* If no customization string is specified but a custom block is, the format
|
371
|
-
* would be Digest::KangarooTwelve_<digest_length>_<block_length>.
|
366
|
+
* If a customization string is specified, the format would be
|
367
|
+
* Digest::KangarooTwelve_<digest_length>_<cust_str_hex>.
|
372
368
|
*
|
373
369
|
* Specifying a string would make the method produce Digest::<string>.
|
374
370
|
*
|
@@ -381,30 +377,25 @@ VALUE rbx_Digest_KangarooTwelve_singleton_default(VALUE self)
|
|
381
377
|
*
|
382
378
|
* See Digest::KangarooTwelve::DEFAULT_DIGEST_LENGTH for the default value.
|
383
379
|
*
|
384
|
-
* :b, :block_length ::
|
385
|
-
* Specifies a custom block length. This doesn't affect the digest results
|
386
|
-
* and is mostly just used for tweaking performance or memory usage. Examine
|
387
|
-
* the update function in KangarooTwelve.c to know if this is needed to be
|
388
|
-
* configured.
|
389
|
-
*
|
390
|
-
* See Digest::KangarooTwelve::DEFAULT_BLOCK_LENGTH for the default value.
|
391
|
-
*
|
392
380
|
* :c, :customization ::
|
393
381
|
* Specifies the customization string. Adding a customization string changes
|
394
382
|
* the resulting digest of every input.
|
395
383
|
*
|
396
|
-
*
|
384
|
+
* :ch, :customization_hex ::
|
385
|
+
* Specifies the customization string in hex mode.
|
386
|
+
*
|
387
|
+
* Calling the method with no argument is the same as calling the
|
397
388
|
* Digest::KangarooTwelve::default method.
|
398
389
|
*/
|
399
|
-
VALUE
|
390
|
+
static VALUE _Digest_KangarooTwelve_singleton_implement(int argc, VALUE *argv, VALUE self)
|
400
391
|
{
|
401
|
-
VALUE opts, name, digest_length,
|
392
|
+
VALUE opts, name, digest_length, customization;
|
402
393
|
|
403
394
|
rb_scan_args(argc, argv, "0:", &opts);
|
404
395
|
|
405
396
|
if (NIL_P(opts)) {
|
406
397
|
name = ID2SYM(_id_auto);
|
407
|
-
digest_length =
|
398
|
+
digest_length = customization = Qnil;
|
408
399
|
} else {
|
409
400
|
name = rb_hash_lookup2(opts, ID2SYM(_id_n), Qundef);
|
410
401
|
|
@@ -416,18 +407,29 @@ VALUE rbx_Digest_KangarooTwelve_singleton_implement(int argc, VALUE *argv, VALUE
|
|
416
407
|
if (digest_length == Qundef)
|
417
408
|
digest_length = rb_hash_lookup2(opts, ID2SYM(_id_digest_length), Qnil);
|
418
409
|
|
419
|
-
block_length = rb_hash_lookup2(opts, ID2SYM(_id_b), Qundef);
|
420
|
-
|
421
|
-
if (block_length == Qundef)
|
422
|
-
block_length = rb_hash_lookup2(opts, ID2SYM(_id_block_length), Qnil);
|
423
|
-
|
424
410
|
customization = rb_hash_lookup2(opts, ID2SYM(_id_c), Qundef);
|
425
411
|
|
426
412
|
if (customization == Qundef)
|
427
|
-
customization = rb_hash_lookup2(opts, ID2SYM(_id_customization),
|
413
|
+
customization = rb_hash_lookup2(opts, ID2SYM(_id_customization), Qundef);
|
414
|
+
|
415
|
+
if (customization == Qundef) {
|
416
|
+
VALUE customization_hex = rb_hash_lookup2(opts, ID2SYM(_id_customization_hex), Qundef);
|
417
|
+
|
418
|
+
if (customization_hex == Qundef)
|
419
|
+
customization_hex = rb_hash_lookup2(opts, ID2SYM(_id_ch), Qundef);
|
420
|
+
|
421
|
+
if (customization_hex == Qundef) {
|
422
|
+
customization = Qnil;
|
423
|
+
} else {
|
424
|
+
if (TYPE(customization_hex) != T_STRING)
|
425
|
+
rb_raise(rb_eTypeError, "Customization argument not a string.");
|
426
|
+
|
427
|
+
customization = hex_decode_str(customization_hex);
|
428
|
+
}
|
429
|
+
}
|
428
430
|
}
|
429
431
|
|
430
|
-
return implement(name, digest_length,
|
432
|
+
return implement(name, digest_length, customization);
|
431
433
|
}
|
432
434
|
|
433
435
|
/*
|
@@ -440,9 +442,9 @@ VALUE rbx_Digest_KangarooTwelve_singleton_implement(int argc, VALUE *argv, VALUE
|
|
440
442
|
* Digest::KangarooTwelve_<digest_length>, and can be directly referenced after
|
441
443
|
* this method is called.
|
442
444
|
*/
|
443
|
-
VALUE
|
445
|
+
static VALUE _Digest_KangarooTwelve_singleton_implement_simple(VALUE self, VALUE digest_length)
|
444
446
|
{
|
445
|
-
return implement(ID2SYM(_id_auto), digest_length, Qnil
|
447
|
+
return implement(ID2SYM(_id_auto), digest_length, Qnil);
|
446
448
|
}
|
447
449
|
|
448
450
|
/*
|
@@ -459,12 +461,12 @@ VALUE rbx_Digest_KangarooTwelve_singleton_implement_simple(VALUE self, VALUE dig
|
|
459
461
|
*
|
460
462
|
* Creates a new object instance of the implementation class.
|
461
463
|
*/
|
462
|
-
VALUE
|
464
|
+
static VALUE _Digest_KangarooTwelve_Impl_singleton_new(VALUE self)
|
463
465
|
{
|
464
|
-
if (self ==
|
466
|
+
if (self == _Digest_KangarooTwelve_Impl)
|
465
467
|
rb_raise(rb_eRuntimeError, "Digest::KangarooTwelve::Impl is an abstract class.");
|
466
468
|
|
467
|
-
if (rb_obj_class(rb_ivar_get(self, _id_metadata)) !=
|
469
|
+
if (rb_ivar_defined(self, _id_metadata) == Qfalse || rb_obj_class(rb_ivar_get(self, _id_metadata)) != _Digest_KangarooTwelve_Metadata)
|
468
470
|
rb_raise(rb_eRuntimeError, "Metadata not set or invalid. Please do not manually inherit KangarooTwelve.");
|
469
471
|
|
470
472
|
return rb_call_super(0, 0);
|
@@ -475,9 +477,9 @@ VALUE rbx_Digest_KangarooTwelve_Impl_singleton_new(VALUE self)
|
|
475
477
|
*
|
476
478
|
* Returns configured digest length of the implementation class.
|
477
479
|
*/
|
478
|
-
VALUE
|
480
|
+
static VALUE _Digest_KangarooTwelve_Impl_singleton_digest_length(VALUE self)
|
479
481
|
{
|
480
|
-
if (self ==
|
482
|
+
if (self == _Digest_KangarooTwelve_Impl)
|
481
483
|
rb_raise(rb_eRuntimeError, "Digest::KangarooTwelve::Impl is an abstract class.");
|
482
484
|
|
483
485
|
return rb_ivar_get(self, _id_digest_length);
|
@@ -486,14 +488,11 @@ VALUE rbx_Digest_KangarooTwelve_Impl_singleton_digest_length(VALUE self)
|
|
486
488
|
/*
|
487
489
|
* call-seq: block_length -> int
|
488
490
|
*
|
489
|
-
* Returns
|
491
|
+
* Returns 8192.
|
490
492
|
*/
|
491
|
-
VALUE
|
493
|
+
static VALUE _Digest_KangarooTwelve_Impl_singleton_block_length(VALUE self)
|
492
494
|
{
|
493
|
-
|
494
|
-
rb_raise(rb_eRuntimeError, "Digest::KangarooTwelve::Impl is an abstract class.");
|
495
|
-
|
496
|
-
return rb_ivar_get(self, _id_block_length);
|
495
|
+
return INT2FIX(KT_BLOCK_LENGTH);
|
497
496
|
}
|
498
497
|
|
499
498
|
/*
|
@@ -501,12 +500,36 @@ VALUE rbx_Digest_KangarooTwelve_Impl_singleton_block_length(VALUE self)
|
|
501
500
|
*
|
502
501
|
* Returns configured customization string of the implementation class.
|
503
502
|
*/
|
504
|
-
VALUE
|
503
|
+
static VALUE _Digest_KangarooTwelve_Impl_singleton_customization(VALUE self)
|
505
504
|
{
|
506
|
-
if (self ==
|
505
|
+
if (self == _Digest_KangarooTwelve_Impl)
|
507
506
|
rb_raise(rb_eRuntimeError, "Digest::KangarooTwelve::Impl is an abstract class.");
|
508
507
|
|
509
|
-
return rb_ivar_get(self, _id_customization);
|
508
|
+
return rb_ivar_defined(self, _id_customization) == Qtrue ? rb_ivar_get(self, _id_customization) : Qnil;
|
509
|
+
}
|
510
|
+
|
511
|
+
/*
|
512
|
+
* call-seq: customization_hex -> string or nil
|
513
|
+
*
|
514
|
+
* Returns configured customization string of the implementation class in hex.
|
515
|
+
*/
|
516
|
+
static VALUE _Digest_KangarooTwelve_Impl_singleton_customization_hex(VALUE self)
|
517
|
+
{
|
518
|
+
if (self == _Digest_KangarooTwelve_Impl)
|
519
|
+
rb_raise(rb_eRuntimeError, "Digest::KangarooTwelve::Impl is an abstract class.");
|
520
|
+
|
521
|
+
if (rb_ivar_defined(self, _id_customization)) {
|
522
|
+
VALUE customization = rb_ivar_get(self, _id_customization);
|
523
|
+
|
524
|
+
if (!NIL_P(customization)) {
|
525
|
+
if (TYPE(customization) != T_STRING)
|
526
|
+
rb_raise(rb_eTypeError, "Unexpected class for a customization string.");
|
527
|
+
|
528
|
+
return hex_encode_str(customization);
|
529
|
+
}
|
530
|
+
}
|
531
|
+
|
532
|
+
return Qnil;
|
510
533
|
}
|
511
534
|
|
512
535
|
/*
|
@@ -514,7 +537,7 @@ VALUE rbx_Digest_KangarooTwelve_Impl_singleton_customization(VALUE self)
|
|
514
537
|
*
|
515
538
|
* Returns configured customization string of the implementation object.
|
516
539
|
*/
|
517
|
-
VALUE
|
540
|
+
static VALUE _Digest_KangarooTwelve_Impl_customization(VALUE self)
|
518
541
|
{
|
519
542
|
VALUE customization;
|
520
543
|
|
@@ -529,26 +552,41 @@ VALUE rbx_Digest_KangarooTwelve_Impl_customization(VALUE self)
|
|
529
552
|
return customization;
|
530
553
|
}
|
531
554
|
|
555
|
+
/*
|
556
|
+
* call-seq: customization_hex -> string or nil
|
557
|
+
*
|
558
|
+
* Returns configured customization string of the implementation object in hex.
|
559
|
+
*/
|
560
|
+
static VALUE _Digest_KangarooTwelve_Impl_customization_hex(VALUE self)
|
561
|
+
{
|
562
|
+
VALUE customization = rb_funcall(self, _id_customization, 0);
|
563
|
+
return hex_encode_str(customization);
|
564
|
+
}
|
565
|
+
|
532
566
|
/*
|
533
567
|
* call-seq: inspect -> string
|
534
568
|
*
|
535
|
-
* Returns a string in the
|
569
|
+
* Returns a string in the form of #<impl_class_name|digest_length|hex_cust_string|hex_digest>
|
536
570
|
*/
|
537
|
-
VALUE
|
571
|
+
static VALUE _Digest_KangarooTwelve_Impl_inspect(VALUE self)
|
538
572
|
{
|
539
|
-
VALUE klass
|
540
|
-
|
573
|
+
VALUE klass, klass_name, digest_length, customization_hex, hexdigest, args[4];
|
574
|
+
|
575
|
+
klass = rb_obj_class(self);
|
576
|
+
klass_name = rb_class_name(klass);
|
541
577
|
|
542
578
|
if (klass_name == Qnil)
|
543
579
|
klass_name = rb_inspect(klass);
|
544
580
|
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
VALUE hexdigest = rb_funcall(self, _id_hexdigest, 0);
|
581
|
+
digest_length = rb_funcall(self, _id_digest_length, 0);
|
582
|
+
customization_hex = rb_funcall(self, _id_customization_hex, 0);
|
583
|
+
hexdigest = rb_funcall(self, _id_hexdigest, 0);
|
549
584
|
|
550
|
-
|
551
|
-
|
585
|
+
args[0] = klass_name;
|
586
|
+
args[1] = digest_length;
|
587
|
+
args[2] = customization_hex;
|
588
|
+
args[3] = hexdigest;
|
589
|
+
return rb_str_format(sizeof(args), args, rb_str_new_literal("#<%s:%d|%s|%s>"));
|
552
590
|
}
|
553
591
|
|
554
592
|
/*
|
@@ -562,7 +600,9 @@ void Init_kangarootwelve()
|
|
562
600
|
DEFINE_ID(auto)
|
563
601
|
DEFINE_ID(block_length)
|
564
602
|
DEFINE_ID(b)
|
603
|
+
DEFINE_ID(ch)
|
565
604
|
DEFINE_ID(customization)
|
605
|
+
DEFINE_ID(customization_hex)
|
566
606
|
DEFINE_ID(c)
|
567
607
|
DEFINE_ID(default)
|
568
608
|
DEFINE_ID(digest_length)
|
@@ -575,66 +615,77 @@ void Init_kangarootwelve()
|
|
575
615
|
DEFINE_ID(unpack)
|
576
616
|
|
577
617
|
rb_require("digest");
|
578
|
-
|
579
|
-
_class_Digest_Base = rb_path2class("Digest::Base");
|
618
|
+
_Digest = rb_path2class("Digest");
|
580
619
|
|
581
620
|
#if 0
|
582
|
-
|
621
|
+
_Digest = rb_define_module("Digest"); /* Tell RDoc about Digest since it doesn't recognize rb_path2class. */
|
583
622
|
#endif
|
584
623
|
|
585
624
|
/*
|
586
|
-
* module Digest::KangarooTwelve
|
625
|
+
* Document-module: Digest::KangarooTwelve
|
587
626
|
*/
|
588
627
|
|
589
|
-
|
628
|
+
_Digest_KangarooTwelve = rb_define_module_under(_Digest, "KangarooTwelve");
|
590
629
|
|
591
|
-
rb_define_singleton_method(
|
592
|
-
|
593
|
-
rb_define_singleton_method(
|
594
|
-
|
595
|
-
rb_define_singleton_method(
|
596
|
-
|
630
|
+
rb_define_singleton_method(_Digest_KangarooTwelve, "default",
|
631
|
+
_Digest_KangarooTwelve_singleton_default, 0);
|
632
|
+
rb_define_singleton_method(_Digest_KangarooTwelve, "implement",
|
633
|
+
_Digest_KangarooTwelve_singleton_implement, -1);
|
634
|
+
rb_define_singleton_method(_Digest_KangarooTwelve, "[]",
|
635
|
+
_Digest_KangarooTwelve_singleton_implement_simple, 1);
|
597
636
|
|
598
637
|
/*
|
599
|
-
*
|
638
|
+
* Document-const: Digest::KangarooTwelve::BLOCK_LENGTH
|
639
|
+
*
|
640
|
+
* 8192 bytes
|
600
641
|
*/
|
601
642
|
|
602
|
-
|
643
|
+
/* 8192 bytes */
|
644
|
+
|
645
|
+
rb_define_const(_Digest_KangarooTwelve, "BLOCK_LENGTH", INT2FIX(KT_BLOCK_LENGTH));
|
603
646
|
|
604
647
|
/*
|
648
|
+
* Document-const: Digest::KangarooTwelve::DEFAULT_DIGEST_LENGTH
|
649
|
+
*
|
605
650
|
* 64 bytes (512 bits)
|
606
651
|
*/
|
607
652
|
|
608
|
-
|
653
|
+
/* 64 bytes (512 bits) */
|
654
|
+
|
655
|
+
rb_define_const(_Digest_KangarooTwelve, "DEFAULT_DIGEST_LENGTH", INT2FIX(KT_DEFAULT_DIGEST_LENGTH));
|
609
656
|
|
610
657
|
/*
|
611
|
-
* class Digest::KangarooTwelve::Impl
|
658
|
+
* Document-class: Digest::KangarooTwelve::Impl
|
612
659
|
*/
|
613
660
|
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
rb_define_singleton_method(
|
618
|
-
|
619
|
-
rb_define_singleton_method(
|
620
|
-
|
621
|
-
rb_define_singleton_method(
|
622
|
-
|
623
|
-
rb_define_singleton_method(
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
rb_define_method(
|
629
|
-
|
661
|
+
_Digest_KangarooTwelve_Impl = rb_define_class_under(_Digest_KangarooTwelve, "Impl",
|
662
|
+
rb_path2class("Digest::Base"));
|
663
|
+
|
664
|
+
rb_define_singleton_method(_Digest_KangarooTwelve_Impl, "new",
|
665
|
+
_Digest_KangarooTwelve_Impl_singleton_new, 0);
|
666
|
+
rb_define_singleton_method(_Digest_KangarooTwelve_Impl, "block_length",
|
667
|
+
_Digest_KangarooTwelve_Impl_singleton_block_length, 0);
|
668
|
+
rb_define_singleton_method(_Digest_KangarooTwelve_Impl, "digest_length",
|
669
|
+
_Digest_KangarooTwelve_Impl_singleton_digest_length, 0);
|
670
|
+
rb_define_singleton_method(_Digest_KangarooTwelve_Impl, "customization",
|
671
|
+
_Digest_KangarooTwelve_Impl_singleton_customization, 0);
|
672
|
+
rb_define_singleton_method(_Digest_KangarooTwelve_Impl, "customization_hex",
|
673
|
+
_Digest_KangarooTwelve_Impl_singleton_customization_hex, 0);
|
674
|
+
|
675
|
+
rb_define_method(_Digest_KangarooTwelve_Impl, "customization",
|
676
|
+
_Digest_KangarooTwelve_Impl_customization, 0);
|
677
|
+
rb_define_method(_Digest_KangarooTwelve_Impl, "customization_hex",
|
678
|
+
_Digest_KangarooTwelve_Impl_customization_hex, 0);
|
679
|
+
rb_define_method(_Digest_KangarooTwelve_Impl, "inspect",
|
680
|
+
_Digest_KangarooTwelve_Impl_inspect, 0);
|
630
681
|
|
631
682
|
/*
|
632
|
-
* class Digest::KangarooTwelve::Metadata
|
683
|
+
* Document-class: Digest::KangarooTwelve::Metadata
|
633
684
|
*
|
634
685
|
* This class represents the internal metadata produced for the
|
635
686
|
* implementation classes.
|
636
687
|
*/
|
637
688
|
|
638
|
-
|
639
|
-
|
689
|
+
_Digest_KangarooTwelve_Metadata = rb_define_class_under(_Digest_KangarooTwelve, "Metadata",
|
690
|
+
rb_cObject);
|
640
691
|
}
|