Wiki
Download
Manual
Eggs
API
Tests
Bugs
show
edit
history
You can edit this page using
wiki syntax
for markup.
Article contents:
[[tags: egg]] == sha2 [[toc:]] == Documentation Computes SHA2 checksums See [[message-digest-primitive]] for more information. === SHA256 API Component export ==== Usage <enscript language=scheme> (import sha256-api) </enscript> ==== Constants ; name : algorithm name ; {{symbol}} ; version : algorithm version ; {{string}} ; context-size : context byte length ; {{fixnum}} ; digest-length : final byte length ; {{fixnum}} ; block-length : buffer byte length ; {{fixnum}} Note that {{block-length}} is informational only. ==== init <procedure>(init CTX)</procedure> Initializes a SHA256 {{CTX}}, with at least {{context-size}} byte size. ==== update <procedure>(update CTX OBJ LEN)</procedure> Accumulate {{LEN}} bytes from the Scheme {{OBJ}} into {{CTX}}. ==== raw-update <procedure>(raw-update CTX PTR LEN)</procedure> Accumulate {{LEN}} bytes from the byte {{PTR}} into {{CTX}}. ==== final <procedure>(final CTX OBJ)</procedure> Finalize the {{CTX}} into a Scheme {{OBJ}} with at least {{digest-length}} byte size. The target is usually a {{blob}}, {{u8vector}}, or {{string}}. === SHA256 Primitive Packaged export ==== Usage <enscript language=scheme> (import sha256-primitive) </enscript> ==== sha256-primitive <procedure>(sha256-primitive) -> message-digest-primitive</procedure> Returns the SHA256 checksum digest primitive object. === SHA384 API Component export ==== Usage <enscript language=scheme> (import sha384-api) </enscript> ==== Constants ; name : algorithm name ; {{symbol}} ; version : algorithm version ; {{string}} ; context-size : context byte length ; {{fixnum}} ; digest-length : final byte length ; {{fixnum}} ; block-length : buffer byte length ; {{fixnum}} Note that {{block-length}} is informational only. ==== init <procedure>(init CTX)</procedure> Initializes a SHA384 {{CTX}}, with at least {{context-size}} byte size. ==== update <procedure>(update CTX OBJ LEN)</procedure> Accumulate {{LEN}} bytes from the Scheme {{OBJ}} into {{CTX}}. ==== raw-update <procedure>(raw-update CTX PTR LEN)</procedure> Accumulate {{LEN}} bytes from the byte {{PTR}} into {{CTX}}. ==== final <procedure>(final CTX OBJ)</procedure> Finalize the {{CTX}} into a Scheme {{OBJ}} with at least {{digest-length}} byte size. The target is usually a {{blob}}, {{u8vector}}, or {{string}}. === SHA384 Primitive Packaged export ==== Usage <enscript language=scheme> (import sha384-primitive) </enscript> ==== sha384-primitive <procedure>(sha384-primitive) -> message-digest-primitive</procedure> Returns the SHA384 checksum digest primitive object. === SHA512 API Component export ==== Usage <enscript language=scheme> (import sha512-api) </enscript> ==== Constants ; name : algorithm name ; {{symbol}} ; version : algorithm version ; {{string}} ; context-size : context byte length ; {{fixnum}} ; digest-length : final byte length ; {{fixnum}} ; block-length : buffer byte length ; {{fixnum}} Note that {{block-length}} is informational only. ==== init <procedure>(init CTX)</procedure> Initializes a SHA512 {{CTX}}, with at least {{context-size}} byte size. ==== update <procedure>(update CTX OBJ LEN)</procedure> Accumulate {{LEN}} bytes from the Scheme {{OBJ}} into {{CTX}}. ==== raw-update <procedure>(raw-update CTX PTR LEN)</procedure> Accumulate {{LEN}} bytes from the byte {{PTR}} into {{CTX}}. ==== final <procedure>(final CTX OBJ)</procedure> Finalize the {{CTX}} into a Scheme {{OBJ}} with at least {{digest-length}} byte size. The target is usually a {{blob}}, {{u8vector}}, or {{string}}. === SHA512 Primitive Packaged export ==== Usage <enscript language=scheme> (import sha512-primitive) </enscript> ==== sha512-primitive <procedure>(sha512-primitive) -> message-digest-primitive</procedure> Returns the SHA512 checksum digest primitive object. == Usage <enscript language=scheme> (import sha2) </enscript> == Examples * '''Note''' the {{message-digest-utils}} egg is a dependency for the example. <enscript highlight="scheme"> (import sha256-primitive message-digest-byte-vector) (message-digest-string (sha256-primitive) "abc") ;=> "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad" </enscript> == Notes * The {{...-primitive}} API is for use with the [[message-digest]] extensions. And the {{...-api}} API implements the {{...-primitive}} API. One packages the algorithm as a record, the other a module. * From the ''4.2.0'' version importing/loading any combination of {{sha2}} modules increases the allocation. The assumption is one or the other but not both. == Requirements [[message-digest-primitive]] * '''Note''' test dependencies only. The egg runtime does not depend on these. [[srfi-1]] [[srfi-13]] [[message-digest-utils]] [[test]] == Author * Aaron D. Gifford, wrapped for Chicken by Daishi Kato * C5 by [[/users/kon-lovett|Kon Lovett]] == Repository This egg is hosted on the CHICKEN Subversion repository: [[https://anonymous@code.call-cc.org/svn/chicken-eggs/release/5/sha2|https://anonymous@code.call-cc.org/svn/chicken-eggs/release/5/sha2]] If you want to check out the source code repository of this egg and you are not familiar with Subversion, see [[/egg-svn-checkout|this page]]. == Version history ; 4.2.3 : Add SHA2 testvectors test. ; 4.2.2 : Upstream SHA2 1.0.1 integration. ; 4.2.1 : Update test runner. ; 4.2.0 : Separate api & primitive binaries per bit-count. ; 4.1.0 : Split into api & primitive modules. ; 4.0.0 : CHICKEN 5 release. ; 3.2.0 : Add raw-update. [[/users/kon-lovett|Kon Lovett]] ; 3.1.0 : Add block-length. [[/users/kon-lovett|Kon Lovett]] ; 3.0.0 : Remove deprecated procedures. [[/users/kon-lovett|Kon Lovett]] ; 2.1.1 : Change deprecated {{pointer}} foreign type specifier to {{scheme-pointer}} to make it work under chickens newer than 4.6.0. ; 2.0.1 : a {{message-digest-primitive}} has no "state". [[/users/kon-lovett|Kon Lovett]] ; 2.0.1 : fix for [[http://www.irp.oist.jp/trac/chicken/ticket/163|#163]] ([[/users/mario-domenech-goulart|Mario Domenech Goulart]]) ; 2.0.0 : Initial Chicken 4 release [[/users/kon-lovett|Kon Lovett]] == License Copyright (c) 2000-2001, Aaron D. Gifford and Daishi Kato All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTOR(S) ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Description of your changes:
I would like to authenticate
Authentication
Username:
Password:
Spam control
What do you get when you multiply 8 by 4?