| 1 |
/* Copyright 2013 Donald Stufft and individual contributors |
| 2 |
* |
| 3 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 |
* you may not use this file except in compliance with the License. |
| 5 |
* You may obtain a copy of the License at |
| 6 |
* |
| 7 |
* http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
* |
| 9 |
* Unless required by applicable law or agreed to in writing, software |
| 10 |
* distributed under the License is distributed on an "AS IS" BASIS, |
| 11 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 |
* See the License for the specific language governing permissions and |
| 13 |
* limitations under the License. |
| 14 |
*/ |
| 15 |
|
| 16 |
size_t crypto_sign_bytes(); |
| 17 |
// size_t crypto_sign_seedbytes(); |
| 18 |
size_t crypto_sign_publickeybytes(); |
| 19 |
size_t crypto_sign_secretkeybytes(); |
| 20 |
size_t crypto_sign_ed25519ph_statebytes(); |
| 21 |
|
| 22 |
|
| 23 |
int crypto_sign_keypair(unsigned char *pk, unsigned char *sk); |
| 24 |
|
| 25 |
int crypto_sign_seed_keypair(unsigned char *pk, unsigned char *sk, |
| 26 |
const unsigned char *seed); |
| 27 |
|
| 28 |
int crypto_sign(unsigned char *sm, unsigned long long *smlen, |
| 29 |
const unsigned char *m, unsigned long long mlen, |
| 30 |
const unsigned char *sk); |
| 31 |
|
| 32 |
int crypto_sign_open(unsigned char *m, unsigned long long *mlen, |
| 33 |
const unsigned char *sm, unsigned long long smlen, |
| 34 |
const unsigned char *pk); |
| 35 |
|
| 36 |
int crypto_sign_ed25519_pk_to_curve25519(unsigned char *curve25519_pk, |
| 37 |
const unsigned char *ed25519_pk); |
| 38 |
|
| 39 |
int crypto_sign_ed25519_sk_to_curve25519(unsigned char *curve25519_sk, |
| 40 |
const unsigned char *ed25519_sk); |
| 41 |
|
| 42 |
/* |
| 43 |
* We use crypto_sign_ed25519ph_state * as |
| 44 |
* a pointer to a opaque buffer, |
| 45 |
* therefore the following typedef makes sense: |
| 46 |
*/ |
| 47 |
|
| 48 |
typedef void crypto_sign_ed25519ph_state; |
| 49 |
|
| 50 |
int crypto_sign_ed25519ph_init(crypto_sign_ed25519ph_state *state); |
| 51 |
|
| 52 |
int crypto_sign_ed25519ph_update(crypto_sign_ed25519ph_state *state, |
| 53 |
const unsigned char *m, |
| 54 |
unsigned long long mlen); |
| 55 |
|
| 56 |
int crypto_sign_ed25519ph_final_create(crypto_sign_ed25519ph_state *state, |
| 57 |
unsigned char *sig, |
| 58 |
unsigned long long *siglen_p, |
| 59 |
const unsigned char *sk); |
| 60 |
|
| 61 |
int crypto_sign_ed25519ph_final_verify(crypto_sign_ed25519ph_state *state, |
| 62 |
unsigned char *sig, |
| 63 |
const unsigned char *pk); |