[BACK]Return to crypto_api.h CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Annotation of src/usr.bin/ssh/crypto_api.h, Revision 1.8

1.8     ! djm         1: /* $OpenBSD: crypto_api.h,v 1.7 2021/01/08 02:33:13 dtucker Exp $ */
1.1       markus      2:
1.3       markus      3: /*
                      4:  * Assembled from generated headers and source files by Markus Friedl.
                      5:  * Placed in the public domain.
                      6:  */
1.1       markus      7:
                      8: #ifndef crypto_api_h
                      9: #define crypto_api_h
                     10:
                     11: #include <stdint.h>
                     12: #include <stdlib.h>
                     13:
1.5       djm        14: typedef int8_t crypto_int8;
                     15: typedef uint8_t crypto_uint8;
                     16: typedef int16_t crypto_int16;
                     17: typedef uint16_t crypto_uint16;
1.1       markus     18: typedef int32_t crypto_int32;
                     19: typedef uint32_t crypto_uint32;
1.7       dtucker    20: typedef int64_t crypto_int64;
                     21: typedef uint64_t crypto_uint64;
1.1       markus     22:
                     23: #define randombytes(buf, buf_len) arc4random_buf((buf), (buf_len))
1.5       djm        24: #define small_random32() arc4random()
1.1       markus     25:
                     26: #define crypto_hash_sha512_BYTES 64U
                     27:
                     28: int    crypto_hash_sha512(unsigned char *, const unsigned char *,
                     29:     unsigned long long);
                     30:
                     31: #define crypto_sign_ed25519_SECRETKEYBYTES 64U
                     32: #define crypto_sign_ed25519_PUBLICKEYBYTES 32U
                     33: #define crypto_sign_ed25519_BYTES 64U
                     34:
                     35: int    crypto_sign_ed25519(unsigned char *, unsigned long long *,
                     36:     const unsigned char *, unsigned long long, const unsigned char *);
                     37: int    crypto_sign_ed25519_open(unsigned char *, unsigned long long *,
                     38:     const unsigned char *, unsigned long long, const unsigned char *);
                     39: int    crypto_sign_ed25519_keypair(unsigned char *, unsigned char *);
1.5       djm        40:
1.6       djm        41: #define crypto_kem_sntrup761_PUBLICKEYBYTES 1158
                     42: #define crypto_kem_sntrup761_SECRETKEYBYTES 1763
                     43: #define crypto_kem_sntrup761_CIPHERTEXTBYTES 1039
                     44: #define crypto_kem_sntrup761_BYTES 32
1.5       djm        45:
1.6       djm        46: int    crypto_kem_sntrup761_enc(unsigned char *cstr, unsigned char *k,
1.5       djm        47:     const unsigned char *pk);
1.6       djm        48: int    crypto_kem_sntrup761_dec(unsigned char *k,
1.5       djm        49:     const unsigned char *cstr, const unsigned char *sk);
1.6       djm        50: int    crypto_kem_sntrup761_keypair(unsigned char *pk, unsigned char *sk);
1.1       markus     51:
                     52: #endif /* crypto_api_h */