From aba901473befa3bc0e2e08f957506a07114f4d14 Mon Sep 17 00:00:00 2001 From: CY Han Date: Sat, 14 Dec 2024 19:21:07 +0800 Subject: [PATCH] Fix type mismatch for `shake/digest!` and setup x86 ci (#117) * ci: set julia version * ci: fix type mismatch --- .github/workflows/CI.yml | 1 + src/shake.jl | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 032195b..aa3d119 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -38,6 +38,7 @@ jobs: - uses: julia-actions/setup-julia@latest with: version: ${{ matrix.julia-version }} + arch: ${{ matrix.julia-arch }} # Alter the UUID so that we test this package instead of loading # the version that is already built into a Julia's system image. - run: julia --color=yes .ci/test_and_change_uuid.jl diff --git a/src/shake.jl b/src/shake.jl index 18b7ac4..272ce51 100644 --- a/src/shake.jl +++ b/src/shake.jl @@ -99,10 +99,12 @@ function digest!(context::T,d::UInt,p::Ptr{UInt8}) where {T<:SHAKE} end context.used = true p+=blocklen(T) - digest!(context,d-blocklen(T),p) + next_d_len = UInt(d - blocklen(T)) + digest!(context, next_d_len, p) return end end + """ shake128(data::AbstractBytes,d::UInt)