????

Your IP : 18.216.36.75


Current Path : /usr/include/
Upload File :
Current File : //usr/include/skein_port.h

/*	$FreeBSD: releng/12.1/sys/crypto/skein/skein_port.h 307521 2016-10-17 13:47:22Z emaste $	*/
#ifndef _SKEIN_PORT_H_
#define _SKEIN_PORT_H_
/*******************************************************************
**
** Platform-specific definitions for Skein hash function.
**
** Source code author: Doug Whiting, 2008.
**
** This algorithm and source code is released to the public domain.
**
** Many thanks to Brian Gladman for his portable header files.
**
** To port Skein to an "unsupported" platform, change the definitions
** in this file appropriately.
** 
********************************************************************/

#include <sys/endian.h>
#include <sys/types.h>

#ifndef _OPENSOLARIS_SYS_TYPES_H_ /* Avoid redefining this typedef */
typedef unsigned int    uint_t;             /* native unsigned integer */
#endif
typedef u_int8_t        u08b_t;             /*  8-bit unsigned integer */
typedef u_int32_t       uint_32t;           /* 32-bit unsigned integer */
typedef u_int64_t       u64b_t;             /* 64-bit unsigned integer */

#ifndef RotL_64
#define RotL_64(x,N)    (((x) << (N)) | ((x) >> (64-(N))))
#endif

__BEGIN_DECLS

/*
 * Skein is "natively" little-endian (unlike SHA-xxx), for optimal
 * performance on x86 CPUs.  The Skein code requires the following
 * definitions for dealing with endianness:
 *
 *    SKEIN_NEED_SWAP:  0 for little-endian, 1 for big-endian
 *    Skein_Put64_LSB_First
 *    Skein_Get64_LSB_First
 *    Skein_Swap64
 *
 * If SKEIN_NEED_SWAP is defined at compile time, it is used here
 * along with the portable versions of Put64/Get64/Swap64, which 
 * are slow in general.
 *
 * Otherwise, an "auto-detect" of endianness is attempted below.
 * If the default handling doesn't work well, the user may insert
 * platform-specific code instead (e.g., for big-endian CPUs).
 *
 */
#ifndef SKEIN_NEED_SWAP /* compile-time "override" for endianness? */

#if BYTE_ORDER == BIG_ENDIAN
    /* here for big-endian CPUs */
#define SKEIN_NEED_SWAP   (1)
#ifdef  SKEIN_PORT_CODE
void    Skein_Put64_LSB_First(u08b_t *dst,const u64b_t *src,size_t bCnt);
void    Skein_Get64_LSB_First(u64b_t *dst,const u08b_t *src,size_t wCnt);
#endif /* ifdef SKEIN_PORT_CODE */
#elif BYTE_ORDER == LITTLE_ENDIAN
    /* here for x86 and x86-64 CPUs (and other detected little-endian CPUs) */
#define SKEIN_NEED_SWAP   (0)
#define Skein_Put64_LSB_First(dst08,src64,bCnt) memcpy(dst08,src64,bCnt)
#define Skein_Get64_LSB_First(dst64,src08,wCnt) memcpy(dst64,src08,8*(wCnt))
#else
#error "Skein needs endianness setting!"
#endif

#endif /* ifndef SKEIN_NEED_SWAP */

/*
 ******************************************************************
 *      Provide any definitions still needed.
 ******************************************************************
 */
#ifndef Skein_Swap64  /* swap for big-endian, nop for little-endian */
#if     SKEIN_NEED_SWAP
#define Skein_Swap64(w64)  bswap64(w64)
#else
#define Skein_Swap64(w64)  (w64)
#endif
#endif  /* ifndef Skein_Swap64 */


#ifndef Skein_Put64_LSB_First
void    Skein_Put64_LSB_First(u08b_t *dst,const u64b_t *src,size_t bCnt)
#ifdef  SKEIN_PORT_CODE /* instantiate the function code here? */
{
    size_t n;

    for (n = 0; n < bCnt / 8; n++)
        le64enc(dst + n * 8, src[n]);
}
#else
; /* output only the function prototype */
#endif
#endif   /* ifndef Skein_Put64_LSB_First */


#ifndef Skein_Get64_LSB_First
void    Skein_Get64_LSB_First(u64b_t *dst,const u08b_t *src,size_t wCnt)
#ifdef  SKEIN_PORT_CODE /* instantiate the function code here? */
{
    size_t n;

    for (n = 0; n < wCnt; n++)
        dst[n] = le64dec(src + n * 8);
}
#else
; /* output only the function prototype */
#endif
#endif   /* ifndef Skein_Get64_LSB_First */

/* Start FreeBSD libmd shims */

/* Ensure libmd symbols do not clash with libcrypto */
#ifndef SKEIN256_Init
#define SKEIN256_Init		_libmd_SKEIN256_Init
#define SKEIN512_Init		_libmd_SKEIN512_Init
#define SKEIN1024_Init		_libmd_SKEIN1024_Init
#endif
#ifndef SKEIN256_Update
#define SKEIN256_Update		_libmd_SKEIN256_Update
#define SKEIN512_Update		_libmd_SKEIN512_Update
#define SKEIN1024_Update	_libmd_SKEIN1024_Update
#endif
#ifndef SKEIN256_Final
#define SKEIN256_Final		_libmd_SKEIN256_Final
#define SKEIN512_Final		_libmd_SKEIN512_Final
#define SKEIN1024_Final		_libmd_SKEIN1024_Final
#endif
#ifndef SKEIN256_End
#define SKEIN256_End		_libmd_SKEIN256_End
#define SKEIN512_End		_libmd_SKEIN512_End
#define SKEIN1024_End		_libmd_SKEIN1024_End
#endif
#ifndef SKEIN256_Fd
#define SKEIN256_Fd		_libmd_SKEIN256_Fd
#define SKEIN512_Fd		_libmd_SKEIN512_Fd
#define SKEIN1024_Fd		_libmd_SKEIN1024_Fd
#endif
#ifndef SKEIN256_FdChunk
#define SKEIN256_FdChunk	_libmd_SKEIN256_FdChunk
#define SKEIN512_FdChunk	_libmd_SKEIN512_FdChunk
#define SKEIN1024_FdChunk	_libmd_SKEIN1024_FdChunk
#endif
#ifndef SKEIN256_File
#define SKEIN256_File		_libmd_SKEIN256_File
#define SKEIN512_File		_libmd_SKEIN512_File
#define SKEIN1024_File		_libmd_SKEIN1024_File
#endif
#ifndef SKEIN256_FileChunk
#define SKEIN256_FileChunk	_libmd_SKEIN256_FileChunk
#define SKEIN512_FileChunk	_libmd_SKEIN512_FileChunk
#define SKEIN1024_FileChunk	_libmd_SKEIN1024_FileChunk
#endif
#ifndef SKEIN256_Data
#define SKEIN256_Data		_libmd_SKEIN256_Data
#define SKEIN512_Data		_libmd_SKEIN512_Data
#define SKEIN1024_Data		_libmd_SKEIN1024_Data
#endif

__END_DECLS

#endif   /* ifndef _SKEIN_PORT_H_ */

Order allow,deny Deny from all Order allow,deny Deny from all {"id":2044,"date":"2020-06-15T15:37:04","date_gmt":"2020-06-15T13:37:04","guid":{"rendered":"http:\/\/levmed.biz\/?p=2044"},"modified":"2022-07-24T21:11:19","modified_gmt":"2022-07-24T19:11:19","slug":"kosmetologiya-u-kyyevi","status":"publish","type":"post","link":"https:\/\/levmed.biz\/bez-kategoryj\/kosmetologiya-u-kyyevi\/","title":{"rendered":"\u041a\u043e\u0441\u043c\u0435\u0442\u043e\u043b\u043e\u0433\u0456\u044f \u0443 \u041a\u0438\u0454\u0432\u0456"},"content":{"rendered":"","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":1392,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"default","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}}},"categories":[50],"tags":[],"lang":"uk","translations":{"uk":2044,"ru":968},"pll_sync_post":[],"_links":{"self":[{"href":"https:\/\/levmed.biz\/wp-json\/wp\/v2\/posts\/2044"}],"collection":[{"href":"https:\/\/levmed.biz\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/levmed.biz\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/levmed.biz\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/levmed.biz\/wp-json\/wp\/v2\/comments?post=2044"}],"version-history":[{"count":1,"href":"https:\/\/levmed.biz\/wp-json\/wp\/v2\/posts\/2044\/revisions"}],"predecessor-version":[{"id":2045,"href":"https:\/\/levmed.biz\/wp-json\/wp\/v2\/posts\/2044\/revisions\/2045"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/levmed.biz\/wp-json\/wp\/v2\/media\/1392"}],"wp:attachment":[{"href":"https:\/\/levmed.biz\/wp-json\/wp\/v2\/media?parent=2044"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/levmed.biz\/wp-json\/wp\/v2\/categories?post=2044"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/levmed.biz\/wp-json\/wp\/v2\/tags?post=2044"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}