Android-cuttlefish cvd tool
pairing_auth.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2020 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
19#include <stddef.h>
20#include <stdint.h>
21#include <sys/cdefs.h>
22
23#if !defined(__INTRODUCED_IN)
24#define __INTRODUCED_IN(__api_level) /* nothing */
25#endif
26
27__BEGIN_DECLS
28
43struct PairingAuthCtx;
45
55PairingAuthCtx* pairing_auth_server_new(const uint8_t* pswd, size_t len) __INTRODUCED_IN(30);
56
66PairingAuthCtx* pairing_auth_client_new(const uint8_t* pswd, size_t len) __INTRODUCED_IN(30);
67
74
85
98void pairing_auth_get_spake2_msg(PairingAuthCtx* ctx, uint8_t* out_buf) __INTRODUCED_IN(30);
99
118bool pairing_auth_init_cipher(PairingAuthCtx* ctx, const uint8_t* their_msg, size_t msg_len)
119 __INTRODUCED_IN(30);
120
133
148bool pairing_auth_encrypt(PairingAuthCtx* ctx, const uint8_t* inbuf, size_t inlen, uint8_t* outbuf,
149 size_t* outlen) __INTRODUCED_IN(30);
150
163size_t pairing_auth_safe_decrypted_size(PairingAuthCtx* ctx, const uint8_t* buf, size_t len)
164 __INTRODUCED_IN(30);
165
181bool pairing_auth_decrypt(PairingAuthCtx* ctx, const uint8_t* inbuf, size_t inlen, uint8_t* outbuf,
182 size_t* outlen) __INTRODUCED_IN(30);
183
184__END_DECLS
bool pairing_auth_decrypt(PairingAuthCtx *ctx, const uint8_t *inbuf, size_t inlen, uint8_t *outbuf, size_t *outlen) __INTRODUCED_IN(30)
Definition: pairing_auth.cpp:280
size_t pairing_auth_msg_size(PairingAuthCtx *ctx) __INTRODUCED_IN(30)
Definition: pairing_auth.cpp:227
void pairing_auth_get_spake2_msg(PairingAuthCtx *ctx, uint8_t *out_buf) __INTRODUCED_IN(30)
Definition: pairing_auth.cpp:232
bool pairing_auth_encrypt(PairingAuthCtx *ctx, const uint8_t *inbuf, size_t inlen, uint8_t *outbuf, size_t *outlen) __INTRODUCED_IN(30)
Definition: pairing_auth.cpp:253
PairingAuthCtx * pairing_auth_server_new(const uint8_t *pswd, size_t len) __INTRODUCED_IN(30)
Definition: pairing_auth.cpp:209
void pairing_auth_destroy(PairingAuthCtx *ctx) __INTRODUCED_IN(30)
Definition: pairing_auth.cpp:299
bool pairing_auth_init_cipher(PairingAuthCtx *ctx, const uint8_t *their_msg, size_t msg_len) __INTRODUCED_IN(30)
Definition: pairing_auth.cpp:239
PairingAuthCtx * pairing_auth_client_new(const uint8_t *pswd, size_t len) __INTRODUCED_IN(30)
Definition: pairing_auth.cpp:218
#define __INTRODUCED_IN(__api_level)
Definition: pairing_auth.h:24
size_t pairing_auth_safe_decrypted_size(PairingAuthCtx *ctx, const uint8_t *buf, size_t len) __INTRODUCED_IN(30)
Definition: pairing_auth.cpp:272
size_t pairing_auth_safe_encrypted_size(PairingAuthCtx *ctx, size_t len) __INTRODUCED_IN(30)
Definition: pairing_auth.cpp:248
Definition: pairing_auth.cpp:42