Subversion Repositories Kolibri OS

Rev

Rev 7698 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
9216 dunkaist 1
; libcrash -- cryptographic hash (and other) functions
7698 dunkaist 2
;
9216 dunkaist 3
; Copyright (C) <2012-2014,2016,2019,2021> Ivan Baravy
7698 dunkaist 4
;
9216 dunkaist 5
; SPDX-License-Identifier: GPL-2.0-or-later
7698 dunkaist 6
;
9216 dunkaist 7
; This program is free software: you can redistribute it and/or modify it under
8
; the terms of the GNU General Public License as published by the Free Software
9
; Foundation, either version 2 of the License, or (at your option) any later
10
; version.
7698 dunkaist 11
;
9216 dunkaist 12
; This program is distributed in the hope that it will be useful, but WITHOUT
13
; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14
; FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
15
;
16
; You should have received a copy of the GNU General Public License along with
17
; this program. If not, see .
7698 dunkaist 18
 
9216 dunkaist 19
LIBCRASH_ALIGN = 16     ; align your data for speed
7698 dunkaist 20
 
9216 dunkaist 21
; hash IDs
7698 dunkaist 22
LIBCRASH_CRC32          = 0
9216 dunkaist 23
LIBCRASH_MD5            = 1
24
LIBCRASH_SHA1           = 2
25
LIBCRASH_SHA2_224       = 3
26
LIBCRASH_SHA2_256       = 4
27
LIBCRASH_SHA2_384       = 5
28
LIBCRASH_SHA2_512       = 6
29
LIBCRASH_SHA3_224       = 7
30
LIBCRASH_SHA3_256       = 8
31
LIBCRASH_SHA3_384       = 9
32
LIBCRASH_SHA3_512       = 10
7698 dunkaist 33
 
9216 dunkaist 34
; mac IDs
35
LIBCRASH_POLY1305       = 0
36
LIBCRASH_HMAC_SHA2_256  = 1
37
LIBCRASH_HMAC_SHA2_512  = 2
7698 dunkaist 38
 
9216 dunkaist 39
; cipher IDs
40
LIBCRASH_CHACHA20       = 0
41
LIBCRASH_AES_256_CTR    = 1
42
LIBCRASH_AES_256_CBC    = 2
7698 dunkaist 43
 
9216 dunkaist 44
; cipher flags for crash_crypt
45
LIBCRASH_CIPHER_ENCRYPT = 0000b
46
LIBCRASH_CIPHER_DECRYPT = 0001b
47
LIBCRASH_CIPHER_PADDING = 0010b ; PKCS#5
7698 dunkaist 48
 
9216 dunkaist 49
; cipher output can be larger than input, e.g. for CBC mode with padding
50
CBC128_MAX_PAD_LEN = 128/8
51
LIBCRASH_MAX_PAD_LEN = CBC128_MAX_PAD_LEN
7698 dunkaist 52
 
9216 dunkaist 53
CRC32_LEN    = 4
54
MD5_LEN      = 16
55
SHA1_LEN     = 20
56
SHA2_224_LEN = 28
57
SHA2_256_LEN = 32
58
SHA2_384_LEN = 48
59
SHA2_512_LEN = 64
60
SHA3_224_LEN = 28
61
SHA3_256_LEN = 32
62
SHA3_384_LEN = 48
63
SHA3_512_LEN = 64
64
MAX_HASH_LEN = SHA3_512_LEN
7698 dunkaist 65
 
9216 dunkaist 66
POLY1305_LEN = 16
67
HMAC_SHA2_256_LEN = SHA2_256_LEN
68
HMAC_SHA2_512_LEN = SHA2_512_LEN
7698 dunkaist 69
 
9216 dunkaist 70
LIBCRASH_CTX_LEN = 0x500