This commit is contained in:
gingerBill
2021-11-08 12:16:04 +00:00
3 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -68,14 +68,14 @@ use_odin :: #force_inline proc() {
@(private) @(private)
_create_groestl_ctx :: #force_inline proc(size: _ctx.Hash_Size) { _create_groestl_ctx :: #force_inline proc(size: _ctx.Hash_Size) {
ctx: Groestl_Context ctx: Groestl_Context
_hash_impl.internal_ctx = ctx
_hash_impl.hash_size = size
#partial switch size { #partial switch size {
case ._28: ctx.hashbitlen = 224 case ._28: ctx.hashbitlen = 224
case ._32: ctx.hashbitlen = 256 case ._32: ctx.hashbitlen = 256
case ._48: ctx.hashbitlen = 384 case ._48: ctx.hashbitlen = 384
case ._64: ctx.hashbitlen = 512 case ._64: ctx.hashbitlen = 512
} }
_hash_impl.internal_ctx = ctx
_hash_impl.hash_size = size
} }
/* /*
+3 -3
View File
@@ -73,9 +73,6 @@ use_odin :: #force_inline proc() {
@(private) @(private)
_create_haval_ctx :: #force_inline proc(size: _ctx.Hash_Size, rounds: u32) { _create_haval_ctx :: #force_inline proc(size: _ctx.Hash_Size, rounds: u32) {
ctx: Haval_Context ctx: Haval_Context
ctx.rounds = rounds
_hash_impl.internal_ctx = ctx
_hash_impl.hash_size = size
#partial switch size { #partial switch size {
case ._16: ctx.hashbitlen = 128 case ._16: ctx.hashbitlen = 128
case ._20: ctx.hashbitlen = 160 case ._20: ctx.hashbitlen = 160
@@ -83,6 +80,9 @@ _create_haval_ctx :: #force_inline proc(size: _ctx.Hash_Size, rounds: u32) {
case ._28: ctx.hashbitlen = 224 case ._28: ctx.hashbitlen = 224
case ._32: ctx.hashbitlen = 256 case ._32: ctx.hashbitlen = 256
} }
ctx.rounds = rounds
_hash_impl.internal_ctx = ctx
_hash_impl.hash_size = size
} }
/* /*
+2 -2
View File
@@ -68,14 +68,14 @@ use_odin :: #force_inline proc() {
@(private) @(private)
_create_jh_ctx :: #force_inline proc(size: _ctx.Hash_Size) { _create_jh_ctx :: #force_inline proc(size: _ctx.Hash_Size) {
ctx: Jh_Context ctx: Jh_Context
_hash_impl.internal_ctx = ctx
_hash_impl.hash_size = size
#partial switch size { #partial switch size {
case ._28: ctx.hashbitlen = 224 case ._28: ctx.hashbitlen = 224
case ._32: ctx.hashbitlen = 256 case ._32: ctx.hashbitlen = 256
case ._48: ctx.hashbitlen = 384 case ._48: ctx.hashbitlen = 384
case ._64: ctx.hashbitlen = 512 case ._64: ctx.hashbitlen = 512
} }
_hash_impl.internal_ctx = ctx
_hash_impl.hash_size = size
} }
/* /*