diff options
207 files changed, 12358 insertions, 6827 deletions
diff --git a/COPYRIGHT.txt b/COPYRIGHT.txt index 326581a492..94e182e47e 100644 --- a/COPYRIGHT.txt +++ b/COPYRIGHT.txt @@ -165,12 +165,12 @@ License: Expat and Bitstream Vera Fonts Copyright Files: ./thirdparty/freetype/ Comment: The FreeType Project -Copyright: 1996-2018, David Turner, Robert Wilhelm, and Werner Lemberg. +Copyright: 1996-2019, David Turner, Robert Wilhelm, and Werner Lemberg. License: FTL Files: ./thirdparty/glad/ Comment: glad -Copyright: 2013-2018, David Herberth +Copyright: 2013-2019, David Herberth License: Expat Files: ./thirdparty/jpeg_compressor/ @@ -301,7 +301,7 @@ License: BSD-3-clause Files: ./thirdparty/misc/stb_truetype.h ./thirdparty/misc/stb_vorbis.c Comment: stb libraries -Copyright: 2007-2017, Sean Barrett +Copyright: 2007-2019, Sean Barrett License: public-domain Files: ./thirdparty/misc/triangulator.cpp @@ -330,8 +330,8 @@ License: BSD-3-clause Files: ./thirdparty/pcre2/ Comment: PCRE2 -Copyright: 1997-2018, University of Cambridge, - 2009-2018, Zoltan Herczeg +Copyright: 1997-2019, University of Cambridge, + 2009-2019, Zoltan Herczeg License: BSD-3-clause Files: ./thirdparty/pvrtccompressor/ @@ -351,7 +351,7 @@ License: Expat Files: ./thirdparty/tinyexr/ Comment: TinyEXR -Copyright: 2014-2018, Syoyo Fujita +Copyright: 2014-2019, Syoyo Fujita 2002, Industrial Light & Magic, a division of Lucas Digital Ltd. LLC License: BSD-3-clause diff --git a/modules/regex/SCsub b/modules/regex/SCsub index acbe4a5a01..1be5af02a5 100644 --- a/modules/regex/SCsub +++ b/modules/regex/SCsub @@ -33,6 +33,7 @@ if env['builtin_pcre2']: "pcre2_newline.c", "pcre2_ord2utf.c", "pcre2_pattern_info.c", + "pcre2_script_run.c", "pcre2_serialize.c", "pcre2_string_utils.c", "pcre2_study.c", diff --git a/thirdparty/README.md b/thirdparty/README.md index dbdf9bbf4f..8ade4024bb 100644 --- a/thirdparty/README.md +++ b/thirdparty/README.md @@ -122,20 +122,20 @@ Use UI font variant if available, because it has tight vertical metrics and good ## freetype - Upstream: https://www.freetype.org -- Version: 2.10.0 +- Version: 2.10.1 - License: FreeType License (BSD-like) Files extracted from upstream source: -- the src/ folder, stripped of the `Jamfile` files -- the include/ folder +- the `src/` folder, stripped of the `Jamfile` files and the `tools` subfolder +- the `include/` folder - `docs/{FTL.TXT,LICENSE.TXT}` ## glad - Upstream: https://github.com/Dav1dde/glad -- Version: 0.1.29 +- Version: 0.1.31 - License: MIT The files we package are automatically generated. @@ -268,7 +268,7 @@ changes are marked with `// -- GODOT --` comments. - Version: 1.1.0 - License: MIT -File extracted from upstream releaze tarball: +File extracted from upstream release tarball: - All `*.c` and `*.h` in `lib/` and `lib/includes/` - `wslay.h` has a small Godot addition to fix MSVC build. @@ -277,10 +277,10 @@ File extracted from upstream releaze tarball: ## mbedtls - Upstream: https://tls.mbed.org/ -- Version: 2.16.0 +- Version: 2.16.2 - License: Apache 2.0 -File extracted from upstream release tarball `mbedtls-2.16.0-apache.tgz`: +File extracted from upstream release tarball (`-apache.tgz` variant): - All `*.h` from `include/mbedtls/` to `thirdparty/mbedtls/include/mbedtls/` - All `*.c` from `library/` to `thirdparty/mbedtls/library/` - Applied the patch in `thirdparty/mbedtls/1453.diff` (PR 1453). @@ -391,7 +391,7 @@ Collection of single-file libraries used in Godot components. * License: Public Domain (Unlicense) or MIT - `stb_vorbis.c` * Upstream: https://github.com/nothings/stb - * Version: 1.15 + * Version: 1.16 * License: Public Domain (Unlicense) or MIT @@ -426,8 +426,8 @@ Files extracted from upstream source: ## pcre2 -- Upstream: http://www.pcre.org/ -- Version: 10.32 +- Upstream: http://www.pcre.org +- Version: 10.33 - License: BSD-3-Clause Files extracted from upstream source: diff --git a/thirdparty/freetype/include/freetype/freetype.h b/thirdparty/freetype/include/freetype/freetype.h index 4f2eaca691..a6bb667e3a 100644 --- a/thirdparty/freetype/include/freetype/freetype.h +++ b/thirdparty/freetype/include/freetype/freetype.h @@ -645,7 +645,7 @@ FT_BEGIN_HEADER * FT_ENCODING_MS_SYMBOL :: * Microsoft Symbol encoding, used to encode mathematical symbols and * wingdings. For more information, see - * 'https://www.microsoft.com/typography/otspec/recom.htm', + * 'https://www.microsoft.com/typography/otspec/recom.htm#non-standard-symbol-fonts', * 'http://www.kostis.net/charsets/symbol.htm', and * 'http://www.kostis.net/charsets/wingding.htm'. * @@ -1766,6 +1766,13 @@ FT_BEGIN_HEADER * transformed, distorted, emboldened, etc. However, it must not be * freed. * + * [Since 2.10.1] If @FT_LOAD_NO_SCALE is set, outline coordinates of + * OpenType variation fonts for a selected instance are internally + * handled as 26.6 fractional font units but returned as (rounded) + * integers, as expected. To get unrounded font units, don't use + * @FT_LOAD_NO_SCALE but load the glyph with @FT_LOAD_NO_HINTING and + * scale it, using the font's `units_per_EM` value as the ppem. + * * num_subglyphs :: * The number of subglyphs in a composite glyph. This field is only * valid for the composite glyph format that should normally only be @@ -3932,8 +3939,8 @@ FT_BEGIN_HEADER * The glyph index. 0~means 'undefined character code'. */ FT_EXPORT( FT_UInt ) - FT_Get_Name_Index( FT_Face face, - FT_String* glyph_name ); + FT_Get_Name_Index( FT_Face face, + const FT_String* glyph_name ); /************************************************************************** @@ -4774,7 +4781,7 @@ FT_BEGIN_HEADER */ #define FREETYPE_MAJOR 2 #define FREETYPE_MINOR 10 -#define FREETYPE_PATCH 0 +#define FREETYPE_PATCH 1 /************************************************************************** diff --git a/thirdparty/freetype/include/freetype/fterrors.h b/thirdparty/freetype/include/freetype/fterrors.h index 58f5a3ead1..2b47eb2096 100644 --- a/thirdparty/freetype/include/freetype/fterrors.h +++ b/thirdparty/freetype/include/freetype/fterrors.h @@ -244,6 +244,8 @@ #define FT_ERR_PROTOS_DEFINED +FT_BEGIN_HEADER + /************************************************************************** * * @function: @@ -274,6 +276,8 @@ FT_EXPORT( const char* ) FT_Error_String( FT_Error error_code ); +FT_END_HEADER + #endif /* FT_ERR_PROTOS_DEFINED */ diff --git a/thirdparty/freetype/include/freetype/ftglyph.h b/thirdparty/freetype/include/freetype/ftglyph.h index 4067c2e62f..fedab8491e 100644 --- a/thirdparty/freetype/include/freetype/ftglyph.h +++ b/thirdparty/freetype/include/freetype/ftglyph.h @@ -210,7 +210,7 @@ FT_BEGIN_HEADER * * As the outline is extracted from a glyph slot, its coordinates are * expressed normally in 26.6 pixels, unless the flag @FT_LOAD_NO_SCALE - * was used in @FT_Load_Glyph() or @FT_Load_Char(). + * was used in @FT_Load_Glyph or @FT_Load_Char. * * The outline's tables are always owned by the object and are destroyed * with it. diff --git a/thirdparty/freetype/include/freetype/ftimage.h b/thirdparty/freetype/include/freetype/ftimage.h index d640b0b0aa..face34fe49 100644 --- a/thirdparty/freetype/include/freetype/ftimage.h +++ b/thirdparty/freetype/include/freetype/ftimage.h @@ -869,7 +869,7 @@ FT_BEGIN_HEADER * * @input: * y :: - * The scanline's y~coordinate. + * The scanline's upward y~coordinate. * * count :: * The number of spans to draw on this scanline. @@ -945,19 +945,16 @@ FT_BEGIN_HEADER * This flag is set to indicate direct rendering. In this mode, client * applications must provide their own span callback. This lets them * directly draw or compose over an existing bitmap. If this bit is - * not set, the target pixmap's buffer _must_ be zeroed before - * rendering. + * _not_ set, the target pixmap's buffer _must_ be zeroed before + * rendering and the output will be clipped to its size. * * Direct rendering is only possible with anti-aliased glyphs. * * FT_RASTER_FLAG_CLIP :: * This flag is only used in direct rendering mode. If set, the output * will be clipped to a box specified in the `clip_box` field of the - * @FT_Raster_Params structure. - * - * Note that by default, the glyph bitmap is clipped to the target - * pixmap, except in direct rendering mode where all spans are - * generated if no clipping box is set. + * @FT_Raster_Params structure. Otherwise, the `clip_box` is + * effectively set to the bounding box and all spans are generated. */ #define FT_RASTER_FLAG_DEFAULT 0x0 #define FT_RASTER_FLAG_AA 0x1 @@ -978,7 +975,8 @@ FT_BEGIN_HEADER * FT_Raster_Params * * @description: - * A structure to hold the arguments used by a raster's render function. + * A structure to hold the parameters used by a raster's render function, + * passed as an argument to @FT_Outline_Render. * * @fields: * target :: diff --git a/thirdparty/freetype/include/freetype/ftmodapi.h b/thirdparty/freetype/include/freetype/ftmodapi.h index 88488bfe89..8d039c4f3a 100644 --- a/thirdparty/freetype/include/freetype/ftmodapi.h +++ b/thirdparty/freetype/include/freetype/ftmodapi.h @@ -623,7 +623,7 @@ FT_BEGIN_HEADER * it is bytecode interpreter's execution context, `TT_ExecContext`, * which is declared in FreeType's internal header file `tttypes.h`. */ - typedef void + typedef FT_Error (*FT_DebugHook_Func)( void* arg ); diff --git a/thirdparty/freetype/include/freetype/ftoutln.h b/thirdparty/freetype/include/freetype/ftoutln.h index 75c3d01596..b72327b703 100644 --- a/thirdparty/freetype/include/freetype/ftoutln.h +++ b/thirdparty/freetype/include/freetype/ftoutln.h @@ -466,8 +466,6 @@ FT_BEGIN_HEADER * * @description: * Render an outline within a bitmap using the current scan-convert. - * This function uses an @FT_Raster_Params structure as an argument, - * allowing advanced features like direct composition, translucency, etc. * * @input: * library :: @@ -485,8 +483,10 @@ FT_BEGIN_HEADER * FreeType error code. 0~means success. * * @note: - * You should know what you are doing and how @FT_Raster_Params works to - * use this function. + * This advanced function uses @FT_Raster_Params as an argument, + * allowing FreeType rasterizer to be used for direct composition, + * translucency, etc. You should know how to set up @FT_Raster_Params + * for this function to work. * * The field `params.source` will be set to `outline` before the scan * converter is called, which means that the value you give to it is diff --git a/thirdparty/freetype/include/freetype/ftwinfnt.h b/thirdparty/freetype/include/freetype/ftwinfnt.h index 3437913d53..a2fba903d2 100644 --- a/thirdparty/freetype/include/freetype/ftwinfnt.h +++ b/thirdparty/freetype/include/freetype/ftwinfnt.h @@ -58,7 +58,7 @@ FT_BEGIN_HEADER * @description: * A list of valid values for the `charset` byte in @FT_WinFNT_HeaderRec. * Exact mapping tables for the various 'cpXXXX' encodings (except for - * 'cp1361') can be found at 'ftp://ftp.unicode.org/Public' in the + * 'cp1361') can be found at 'ftp://ftp.unicode.org/Public/' in the * `MAPPINGS/VENDORS/MICSFT/WINDOWS` subdirectory. 'cp1361' is roughly a * superset of `MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT`. * diff --git a/thirdparty/freetype/include/freetype/internal/ftcalc.h b/thirdparty/freetype/include/freetype/internal/ftcalc.h index 2986ec359b..1811fcd1ea 100644 --- a/thirdparty/freetype/include/freetype/internal/ftcalc.h +++ b/thirdparty/freetype/include/freetype/internal/ftcalc.h @@ -378,6 +378,7 @@ FT_BEGIN_HEADER #if FT_SIZEOF_INT == 4 #include <intrin.h> +#pragma intrinsic( _BitScanReverse ) static __inline FT_Int32 FT_MSB_i386( FT_UInt32 x ) @@ -385,7 +386,6 @@ FT_BEGIN_HEADER unsigned long where; - /* not available in older VC versions */ _BitScanReverse( &where, x ); return (FT_Int32)where; diff --git a/thirdparty/freetype/include/freetype/internal/ftobjs.h b/thirdparty/freetype/include/freetype/internal/ftobjs.h index f3a41b35ab..0c1d3e5bf2 100644 --- a/thirdparty/freetype/include/freetype/internal/ftobjs.h +++ b/thirdparty/freetype/include/freetype/internal/ftobjs.h @@ -278,14 +278,12 @@ FT_BEGIN_HEADER #ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING typedef void (*FT_Bitmap_LcdFilterFunc)( FT_Bitmap* bitmap, - FT_Render_Mode render_mode, FT_Byte* weights ); /* This is the default LCD filter, an in-place, 5-tap FIR filter. */ FT_BASE( void ) ft_lcd_filter_fir( FT_Bitmap* bitmap, - FT_Render_Mode mode, FT_LcdFiveTapFilter weights ); #endif /* FT_CONFIG_OPTION_SUBPIXEL_RENDERING */ @@ -941,8 +939,8 @@ FT_BEGIN_HEADER FT_UInt buffer_max ); typedef FT_UInt - (*FT_Face_GetGlyphNameIndexFunc)( FT_Face face, - FT_String* glyph_name ); + (*FT_Face_GetGlyphNameIndexFunc)( FT_Face face, + const FT_String* glyph_name ); #ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM diff --git a/thirdparty/freetype/include/freetype/internal/ftstream.h b/thirdparty/freetype/include/freetype/internal/ftstream.h index e4dca0b0a5..a579a039b9 100644 --- a/thirdparty/freetype/include/freetype/internal/ftstream.h +++ b/thirdparty/freetype/include/freetype/internal/ftstream.h @@ -166,6 +166,17 @@ FT_BEGIN_HEADER /* + * function acts on increases does range for emits + * pointer checking frames error + * ------------------------------------------------------------------- + * FT_PEEK_XXX buffer pointer no no no no + * FT_NEXT_XXX buffer pointer yes no no no + * FT_GET_XXX stream->cursor yes yes yes no + * FT_READ_XXX stream->pos yes yes no yes + */ + + + /* * `FT_PEEK_XXX' are generic macros to get data from a buffer position. No * safety checks are performed. */ diff --git a/thirdparty/freetype/include/freetype/internal/fttrace.h b/thirdparty/freetype/include/freetype/internal/fttrace.h index 8089babfb6..f5f9598046 100644 --- a/thirdparty/freetype/include/freetype/internal/fttrace.h +++ b/thirdparty/freetype/include/freetype/internal/fttrace.h @@ -48,6 +48,7 @@ FT_TRACE_DEF( cache ) /* cache sub-system (ftcache.c, etc.) */ /* SFNT driver components */ FT_TRACE_DEF( sfdriver ) /* SFNT font driver (sfdriver.c) */ FT_TRACE_DEF( sfobjs ) /* SFNT object handler (sfobjs.c) */ +FT_TRACE_DEF( sfwoff ) /* WOFF format handler (sfwoff.c) */ FT_TRACE_DEF( ttbdf ) /* TrueType embedded BDF (ttbdf.c) */ FT_TRACE_DEF( ttcmap ) /* charmap handler (ttcmap.c) */ FT_TRACE_DEF( ttcolr ) /* glyph layer table (ttcolr.c) */ diff --git a/thirdparty/freetype/include/freetype/internal/internal.h b/thirdparty/freetype/include/freetype/internal/internal.h index 173d8ad906..3c8830f7e4 100644 --- a/thirdparty/freetype/include/freetype/internal/internal.h +++ b/thirdparty/freetype/include/freetype/internal/internal.h @@ -40,6 +40,7 @@ #define FT_INTERNAL_TRUETYPE_TYPES_H <freetype/internal/tttypes.h> #define FT_INTERNAL_TYPE1_TYPES_H <freetype/internal/t1types.h> +#define FT_INTERNAL_WOFF_TYPES_H <freetype/internal/wofftypes.h> #define FT_INTERNAL_POSTSCRIPT_AUX_H <freetype/internal/psaux.h> #define FT_INTERNAL_POSTSCRIPT_HINTS_H <freetype/internal/pshints.h> diff --git a/thirdparty/freetype/include/freetype/internal/psaux.h b/thirdparty/freetype/include/freetype/internal/psaux.h index 3ab01c3e68..f962a973de 100644 --- a/thirdparty/freetype/include/freetype/internal/psaux.h +++ b/thirdparty/freetype/include/freetype/internal/psaux.h @@ -96,10 +96,10 @@ FT_BEGIN_HEADER (*done)( PS_Table table ); FT_Error - (*add)( PS_Table table, - FT_Int idx, - void* object, - FT_UInt length ); + (*add)( PS_Table table, + FT_Int idx, + const void* object, + FT_UInt length ); void (*release)( PS_Table table ); diff --git a/thirdparty/freetype/include/freetype/internal/services/svgldict.h b/thirdparty/freetype/include/freetype/internal/services/svgldict.h index ca8edf0eb5..0949621835 100644 --- a/thirdparty/freetype/include/freetype/internal/services/svgldict.h +++ b/thirdparty/freetype/include/freetype/internal/services/svgldict.h @@ -41,8 +41,8 @@ FT_BEGIN_HEADER FT_UInt buffer_max ); typedef FT_UInt - (*FT_GlyphDict_NameIndexFunc)( FT_Face face, - FT_String* glyph_name ); + (*FT_GlyphDict_NameIndexFunc)( FT_Face face, + const FT_String* glyph_name ); FT_DEFINE_SERVICE( GlyphDict ) diff --git a/thirdparty/freetype/include/freetype/internal/sfnt.h b/thirdparty/freetype/include/freetype/internal/sfnt.h index 225f40df6e..b19241c306 100644 --- a/thirdparty/freetype/include/freetype/internal/sfnt.h +++ b/thirdparty/freetype/include/freetype/internal/sfnt.h @@ -23,6 +23,7 @@ #include <ft2build.h> #include FT_INTERNAL_DRIVER_H #include FT_INTERNAL_TRUETYPE_TYPES_H +#include FT_INTERNAL_WOFF_TYPES_H FT_BEGIN_HEADER diff --git a/thirdparty/freetype/include/freetype/internal/t1types.h b/thirdparty/freetype/include/freetype/internal/t1types.h index e197a1afca..d94c8c1284 100644 --- a/thirdparty/freetype/include/freetype/internal/t1types.h +++ b/thirdparty/freetype/include/freetype/internal/t1types.h @@ -76,8 +76,8 @@ FT_BEGIN_HEADER FT_Int code_first; FT_Int code_last; - FT_UShort* char_index; - FT_String** char_name; + FT_UShort* char_index; + const FT_String** char_name; } T1_EncodingRec, *T1_Encoding; diff --git a/thirdparty/freetype/include/freetype/internal/tttypes.h b/thirdparty/freetype/include/freetype/internal/tttypes.h index 5e9f40ec3f..23db240e7c 100644 --- a/thirdparty/freetype/include/freetype/internal/tttypes.h +++ b/thirdparty/freetype/include/freetype/internal/tttypes.h @@ -153,81 +153,6 @@ FT_BEGIN_HEADER /************************************************************************** * * @struct: - * WOFF_HeaderRec - * - * @description: - * WOFF file format header. - * - * @fields: - * See - * - * https://www.w3.org/TR/WOFF/#WOFFHeader - */ - typedef struct WOFF_HeaderRec_ - { - FT_ULong signature; - FT_ULong flavor; - FT_ULong length; - FT_UShort num_tables; - FT_UShort reserved; - FT_ULong totalSfntSize; - FT_UShort majorVersion; - FT_UShort minorVersion; - FT_ULong metaOffset; - FT_ULong metaLength; - FT_ULong metaOrigLength; - FT_ULong privOffset; - FT_ULong privLength; - - } WOFF_HeaderRec, *WOFF_Header; - - - /************************************************************************** - * - * @struct: - * WOFF_TableRec - * - * @description: - * This structure describes a given table of a WOFF font. - * - * @fields: - * Tag :: - * A four-bytes tag describing the table. - * - * Offset :: - * The offset of the table from the start of the WOFF font in its - * resource. - * - * CompLength :: - * Compressed table length (in bytes). - * - * OrigLength :: - * Uncompressed table length (in bytes). - * - * CheckSum :: - * The table checksum. This value can be ignored. - * - * OrigOffset :: - * The uncompressed table file offset. This value gets computed while - * constructing the (uncompressed) SFNT header. It is not contained in - * the WOFF file. - */ - typedef struct WOFF_TableRec_ - { - FT_ULong Tag; /* table ID */ - FT_ULong Offset; /* table file offset */ - FT_ULong CompLength; /* compressed table length */ - FT_ULong OrigLength; /* uncompressed table length */ - FT_ULong CheckSum; /* uncompressed checksum */ - - FT_ULong OrigOffset; /* uncompressed table file offset */ - /* (not in the WOFF file) */ - } WOFF_TableRec, *WOFF_Table; - - - /************************************************************************** - * - * @struct: * TT_LongMetricsRec * * @description: @@ -1395,8 +1320,10 @@ FT_BEGIN_HEADER * * cvt :: * The face's original control value table. Coordinates are expressed - * in unscaled font units. Comes from the 'cvt~' table. Ignored for - * Type 2 fonts. + * in unscaled font units (in 26.6 format). Comes from the 'cvt~' + * table. Ignored for Type 2 fonts. + * + * If varied by the `CVAR' table, non-integer values are possible. * * interpreter :: * A pointer to the TrueType bytecode interpreters field is also used @@ -1633,7 +1560,7 @@ FT_BEGIN_HEADER /* the original, unscaled, control value table */ FT_ULong cvt_size; - FT_Short* cvt; + FT_Int32* cvt; /* A pointer to the bytecode interpreter to use. This is also */ /* used to hook the debugger for the `ttdebug' utility. */ diff --git a/thirdparty/freetype/include/freetype/internal/wofftypes.h b/thirdparty/freetype/include/freetype/internal/wofftypes.h new file mode 100644 index 0000000000..ba55bf883e --- /dev/null +++ b/thirdparty/freetype/include/freetype/internal/wofftypes.h @@ -0,0 +1,112 @@ +/**************************************************************************** + * + * wofftypes.h + * + * Basic WOFF/WOFF2 type definitions and interface (specification + * only). + * + * Copyright (C) 1996-2019 by + * David Turner, Robert Wilhelm, and Werner Lemberg. + * + * This file is part of the FreeType project, and may only be used, + * modified, and distributed under the terms of the FreeType project + * license, LICENSE.TXT. By continuing to use, modify, or distribute + * this file you indicate that you have read the license and + * understand and accept it fully. + * + */ + + +#ifndef WOFFTYPES_H_ +#define WOFFTYPES_H_ + + +#include <ft2build.h> +#include FT_TRUETYPE_TABLES_H +#include FT_INTERNAL_OBJECTS_H + + +FT_BEGIN_HEADER + + + /************************************************************************** + * + * @struct: + * WOFF_HeaderRec + * + * @description: + * WOFF file format header. + * + * @fields: + * See + * + * https://www.w3.org/TR/WOFF/#WOFFHeader + */ + typedef struct WOFF_HeaderRec_ + { + FT_ULong signature; + FT_ULong flavor; + FT_ULong length; + FT_UShort num_tables; + FT_UShort reserved; + FT_ULong totalSfntSize; + FT_UShort majorVersion; + FT_UShort minorVersion; + FT_ULong metaOffset; + FT_ULong metaLength; + FT_ULong metaOrigLength; + FT_ULong privOffset; + FT_ULong privLength; + + } WOFF_HeaderRec, *WOFF_Header; + + + /************************************************************************** + * + * @struct: + * WOFF_TableRec + * + * @description: + * This structure describes a given table of a WOFF font. + * + * @fields: + * Tag :: + * A four-bytes tag describing the table. + * + * Offset :: + * The offset of the table from the start of the WOFF font in its + * resource. + * + * CompLength :: + * Compressed table length (in bytes). + * + * OrigLength :: + * Uncompressed table length (in bytes). + * + * CheckSum :: + * The table checksum. This value can be ignored. + * + * OrigOffset :: + * The uncompressed table file offset. This value gets computed while + * constructing the (uncompressed) SFNT header. It is not contained in + * the WOFF file. + */ + typedef struct WOFF_TableRec_ + { + FT_ULong Tag; /* table ID */ + FT_ULong Offset; /* table file offset */ + FT_ULong CompLength; /* compressed table length */ + FT_ULong OrigLength; /* uncompressed table length */ + FT_ULong CheckSum; /* uncompressed checksum */ + + FT_ULong OrigOffset; /* uncompressed table file offset */ + /* (not in the WOFF file) */ + } WOFF_TableRec, *WOFF_Table; + + +FT_END_HEADER + +#endif /* WOFFTYPES_H_ */ + + +/* END */ diff --git a/thirdparty/freetype/src/autofit/afblue.c b/thirdparty/freetype/src/autofit/afblue.c index 28da159008..b99dbeb19c 100644 --- a/thirdparty/freetype/src/autofit/afblue.c +++ b/thirdparty/freetype/src/autofit/afblue.c @@ -296,6 +296,10 @@ '\0', '\xE0', '\xB4', '\x9F', ' ', '\xE0', '\xB4', '\xA0', ' ', '\xE0', '\xB4', '\xA7', ' ', '\xE0', '\xB4', '\xB6', ' ', '\xE0', '\xB4', '\x98', ' ', '\xE0', '\xB4', '\x9A', ' ', '\xE0', '\xB4', '\xA5', ' ', '\xE0', '\xB4', '\xB2', /* ട ഠ ധ ശ ഘ ച ഥ ല */ '\0', + '\xE1', '\xA0', '\xB3', ' ', '\xE1', '\xA0', '\xB4', ' ', '\xE1', '\xA0', '\xB6', ' ', '\xE1', '\xA0', '\xBD', ' ', '\xE1', '\xA1', '\x82', ' ', '\xE1', '\xA1', '\x8A', ' ', '\xE2', '\x80', '\x8D', '\xE1', '\xA1', '\xA1', '\xE2', '\x80', '\x8D', ' ', '\xE2', '\x80', '\x8D', '\xE1', '\xA1', '\xB3', '\xE2', '\x80', '\x8D', /* ᠳ ᠴ ᠶ ᠽ ᡂ ᡊ ᡡ ᡳ */ + '\0', + '\xE1', '\xA1', '\x83', /* ᡃ */ + '\0', '\xE1', '\x80', '\x81', ' ', '\xE1', '\x80', '\x82', ' ', '\xE1', '\x80', '\x84', ' ', '\xE1', '\x80', '\x92', ' ', '\xE1', '\x80', '\x9D', ' ', '\xE1', '\x81', '\xA5', ' ', '\xE1', '\x81', '\x8A', ' ', '\xE1', '\x81', '\x8B', /* ခ ဂ င ဒ ဝ ၥ ၊ ။ */ '\0', '\xE1', '\x80', '\x84', ' ', '\xE1', '\x80', '\x8E', ' ', '\xE1', '\x80', '\x92', ' ', '\xE1', '\x80', '\x95', ' ', '\xE1', '\x80', '\x97', ' ', '\xE1', '\x80', '\x9D', ' ', '\xE1', '\x81', '\x8A', ' ', '\xE1', '\x81', '\x8B', /* င ဎ ဒ ပ ဗ ဝ ၊ ။ */ @@ -649,6 +653,9 @@ { AF_BLUE_STRING_MALAYALAM_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, { AF_BLUE_STRING_MALAYALAM_BOTTOM, 0 }, { AF_BLUE_STRING_MAX, 0 }, + { AF_BLUE_STRING_MONGOLIAN_TOP_BASE, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_MONGOLIAN_BOTTOM_BASE, 0 }, + { AF_BLUE_STRING_MAX, 0 }, { AF_BLUE_STRING_MYANMAR_TOP, AF_BLUE_PROPERTY_LATIN_TOP | AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, { AF_BLUE_STRING_MYANMAR_BOTTOM, 0 }, diff --git a/thirdparty/freetype/src/autofit/afblue.dat b/thirdparty/freetype/src/autofit/afblue.dat index 14a0993b61..46db43fe22 100644 --- a/thirdparty/freetype/src/autofit/afblue.dat +++ b/thirdparty/freetype/src/autofit/afblue.dat @@ -392,6 +392,11 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN: AF_BLUE_STRING_MALAYALAM_BOTTOM "ട ഠ ധ ശ ഘ ച ഥ ല" + AF_BLUE_STRING_MONGOLIAN_TOP_BASE + "ᠳ ᠴ ᠶ ᠽ ᡂ ᡊ ᡡ ᡳ" + AF_BLUE_STRING_MONGOLIAN_BOTTOM_BASE + "ᡃ" + AF_BLUE_STRING_MYANMAR_TOP "ခ ဂ င ဒ ဝ ၥ ၊ ။" AF_BLUE_STRING_MYANMAR_BOTTOM @@ -947,6 +952,11 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN: { AF_BLUE_STRING_MALAYALAM_BOTTOM, 0 } { AF_BLUE_STRING_MAX, 0 } + AF_BLUE_STRINGSET_MONG + { AF_BLUE_STRING_MONGOLIAN_TOP_BASE, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_MONGOLIAN_BOTTOM_BASE, 0 } + { AF_BLUE_STRING_MAX, 0 } + AF_BLUE_STRINGSET_MYMR { AF_BLUE_STRING_MYANMAR_TOP, AF_BLUE_PROPERTY_LATIN_TOP | AF_BLUE_PROPERTY_LATIN_X_HEIGHT } diff --git a/thirdparty/freetype/src/autofit/afblue.h b/thirdparty/freetype/src/autofit/afblue.h index a2ff597b8e..b69b1df521 100644 --- a/thirdparty/freetype/src/autofit/afblue.h +++ b/thirdparty/freetype/src/autofit/afblue.h @@ -212,56 +212,58 @@ FT_BEGIN_HEADER AF_BLUE_STRING_LISU_BOTTOM = 3506, AF_BLUE_STRING_MALAYALAM_TOP = 3538, AF_BLUE_STRING_MALAYALAM_BOTTOM = 3582, - AF_BLUE_STRING_MYANMAR_TOP = 3614, - AF_BLUE_STRING_MYANMAR_BOTTOM = 3646, - AF_BLUE_STRING_MYANMAR_ASCENDER = 3678, - AF_BLUE_STRING_MYANMAR_DESCENDER = 3706, - AF_BLUE_STRING_NKO_TOP = 3738, - AF_BLUE_STRING_NKO_BOTTOM = 3762, - AF_BLUE_STRING_NKO_SMALL_TOP = 3777, - AF_BLUE_STRING_NKO_SMALL_BOTTOM = 3786, - AF_BLUE_STRING_OL_CHIKI = 3798, - AF_BLUE_STRING_OLD_TURKIC_TOP = 3822, - AF_BLUE_STRING_OLD_TURKIC_BOTTOM = 3837, - AF_BLUE_STRING_OSAGE_CAPITAL_TOP = 3857, - AF_BLUE_STRING_OSAGE_CAPITAL_BOTTOM = 3897, - AF_BLUE_STRING_OSAGE_CAPITAL_DESCENDER = 3927, - AF_BLUE_STRING_OSAGE_SMALL_TOP = 3942, - AF_BLUE_STRING_OSAGE_SMALL_BOTTOM = 3982, - AF_BLUE_STRING_OSAGE_SMALL_ASCENDER = 4022, - AF_BLUE_STRING_OSAGE_SMALL_DESCENDER = 4047, - AF_BLUE_STRING_OSMANYA_TOP = 4062, - AF_BLUE_STRING_OSMANYA_BOTTOM = 4102, - AF_BLUE_STRING_SAURASHTRA_TOP = 4142, - AF_BLUE_STRING_SAURASHTRA_BOTTOM = 4174, - AF_BLUE_STRING_SHAVIAN_TOP = 4194, - AF_BLUE_STRING_SHAVIAN_BOTTOM = 4204, - AF_BLUE_STRING_SHAVIAN_DESCENDER = 4229, - AF_BLUE_STRING_SHAVIAN_SMALL_TOP = 4239, - AF_BLUE_STRING_SHAVIAN_SMALL_BOTTOM = 4274, - AF_BLUE_STRING_SINHALA_TOP = 4289, - AF_BLUE_STRING_SINHALA_BOTTOM = 4321, - AF_BLUE_STRING_SINHALA_DESCENDER = 4353, - AF_BLUE_STRING_SUNDANESE_TOP = 4397, - AF_BLUE_STRING_SUNDANESE_BOTTOM = 4421, - AF_BLUE_STRING_SUNDANESE_DESCENDER = 4453, - AF_BLUE_STRING_TAI_VIET_TOP = 4461, - AF_BLUE_STRING_TAI_VIET_BOTTOM = 4481, - AF_BLUE_STRING_TAMIL_TOP = 4493, - AF_BLUE_STRING_TAMIL_BOTTOM = 4525, - AF_BLUE_STRING_TELUGU_TOP = 4557, - AF_BLUE_STRING_TELUGU_BOTTOM = 4585, - AF_BLUE_STRING_THAI_TOP = 4613, - AF_BLUE_STRING_THAI_BOTTOM = 4637, - AF_BLUE_STRING_THAI_ASCENDER = 4665, - AF_BLUE_STRING_THAI_LARGE_ASCENDER = 4677, - AF_BLUE_STRING_THAI_DESCENDER = 4689, - AF_BLUE_STRING_THAI_LARGE_DESCENDER = 4705, - AF_BLUE_STRING_THAI_DIGIT_TOP = 4713, - AF_BLUE_STRING_TIFINAGH = 4725, - AF_BLUE_STRING_VAI_TOP = 4757, - AF_BLUE_STRING_VAI_BOTTOM = 4789, - af_blue_1_1 = 4820, + AF_BLUE_STRING_MONGOLIAN_TOP_BASE = 3614, + AF_BLUE_STRING_MONGOLIAN_BOTTOM_BASE = 3658, + AF_BLUE_STRING_MYANMAR_TOP = 3662, + AF_BLUE_STRING_MYANMAR_BOTTOM = 3694, + AF_BLUE_STRING_MYANMAR_ASCENDER = 3726, + AF_BLUE_STRING_MYANMAR_DESCENDER = 3754, + AF_BLUE_STRING_NKO_TOP = 3786, + AF_BLUE_STRING_NKO_BOTTOM = 3810, + AF_BLUE_STRING_NKO_SMALL_TOP = 3825, + AF_BLUE_STRING_NKO_SMALL_BOTTOM = 3834, + AF_BLUE_STRING_OL_CHIKI = 3846, + AF_BLUE_STRING_OLD_TURKIC_TOP = 3870, + AF_BLUE_STRING_OLD_TURKIC_BOTTOM = 3885, + AF_BLUE_STRING_OSAGE_CAPITAL_TOP = 3905, + AF_BLUE_STRING_OSAGE_CAPITAL_BOTTOM = 3945, + AF_BLUE_STRING_OSAGE_CAPITAL_DESCENDER = 3975, + AF_BLUE_STRING_OSAGE_SMALL_TOP = 3990, + AF_BLUE_STRING_OSAGE_SMALL_BOTTOM = 4030, + AF_BLUE_STRING_OSAGE_SMALL_ASCENDER = 4070, + AF_BLUE_STRING_OSAGE_SMALL_DESCENDER = 4095, + AF_BLUE_STRING_OSMANYA_TOP = 4110, + AF_BLUE_STRING_OSMANYA_BOTTOM = 4150, + AF_BLUE_STRING_SAURASHTRA_TOP = 4190, + AF_BLUE_STRING_SAURASHTRA_BOTTOM = 4222, + AF_BLUE_STRING_SHAVIAN_TOP = 4242, + AF_BLUE_STRING_SHAVIAN_BOTTOM = 4252, + AF_BLUE_STRING_SHAVIAN_DESCENDER = 4277, + AF_BLUE_STRING_SHAVIAN_SMALL_TOP = 4287, + AF_BLUE_STRING_SHAVIAN_SMALL_BOTTOM = 4322, + AF_BLUE_STRING_SINHALA_TOP = 4337, + AF_BLUE_STRING_SINHALA_BOTTOM = 4369, + AF_BLUE_STRING_SINHALA_DESCENDER = 4401, + AF_BLUE_STRING_SUNDANESE_TOP = 4445, + AF_BLUE_STRING_SUNDANESE_BOTTOM = 4469, + AF_BLUE_STRING_SUNDANESE_DESCENDER = 4501, + AF_BLUE_STRING_TAI_VIET_TOP = 4509, + AF_BLUE_STRING_TAI_VIET_BOTTOM = 4529, + AF_BLUE_STRING_TAMIL_TOP = 4541, + AF_BLUE_STRING_TAMIL_BOTTOM = 4573, + AF_BLUE_STRING_TELUGU_TOP = 4605, + AF_BLUE_STRING_TELUGU_BOTTOM = 4633, + AF_BLUE_STRING_THAI_TOP = 4661, + AF_BLUE_STRING_THAI_BOTTOM = 4685, + AF_BLUE_STRING_THAI_ASCENDER = 4713, + AF_BLUE_STRING_THAI_LARGE_ASCENDER = 4725, + AF_BLUE_STRING_THAI_DESCENDER = 4737, + AF_BLUE_STRING_THAI_LARGE_DESCENDER = 4753, + AF_BLUE_STRING_THAI_DIGIT_TOP = 4761, + AF_BLUE_STRING_TIFINAGH = 4773, + AF_BLUE_STRING_VAI_TOP = 4805, + AF_BLUE_STRING_VAI_BOTTOM = 4837, + af_blue_1_1 = 4868, #ifdef AF_CONFIG_OPTION_CJK AF_BLUE_STRING_CJK_TOP = af_blue_1_1 + 1, AF_BLUE_STRING_CJK_BOTTOM = af_blue_1_1 + 203, @@ -355,24 +357,25 @@ FT_BEGIN_HEADER AF_BLUE_STRINGSET_LATP = 166, AF_BLUE_STRINGSET_LISU = 173, AF_BLUE_STRINGSET_MLYM = 176, - AF_BLUE_STRINGSET_MYMR = 179, - AF_BLUE_STRINGSET_NKOO = 184, - AF_BLUE_STRINGSET_NONE = 189, - AF_BLUE_STRINGSET_OLCK = 190, - AF_BLUE_STRINGSET_ORKH = 193, - AF_BLUE_STRINGSET_OSGE = 196, - AF_BLUE_STRINGSET_OSMA = 204, - AF_BLUE_STRINGSET_SAUR = 207, - AF_BLUE_STRINGSET_SHAW = 210, - AF_BLUE_STRINGSET_SINH = 216, - AF_BLUE_STRINGSET_SUND = 220, - AF_BLUE_STRINGSET_TAML = 224, - AF_BLUE_STRINGSET_TAVT = 227, - AF_BLUE_STRINGSET_TELU = 230, - AF_BLUE_STRINGSET_TFNG = 233, - AF_BLUE_STRINGSET_THAI = 236, - AF_BLUE_STRINGSET_VAII = 244, - af_blue_2_1 = 247, + AF_BLUE_STRINGSET_MONG = 179, + AF_BLUE_STRINGSET_MYMR = 182, + AF_BLUE_STRINGSET_NKOO = 187, + AF_BLUE_STRINGSET_NONE = 192, + AF_BLUE_STRINGSET_OLCK = 193, + AF_BLUE_STRINGSET_ORKH = 196, + AF_BLUE_STRINGSET_OSGE = 199, + AF_BLUE_STRINGSET_OSMA = 207, + AF_BLUE_STRINGSET_SAUR = 210, + AF_BLUE_STRINGSET_SHAW = 213, + AF_BLUE_STRINGSET_SINH = 219, + AF_BLUE_STRINGSET_SUND = 223, + AF_BLUE_STRINGSET_TAML = 227, + AF_BLUE_STRINGSET_TAVT = 230, + AF_BLUE_STRINGSET_TELU = 233, + AF_BLUE_STRINGSET_TFNG = 236, + AF_BLUE_STRINGSET_THAI = 239, + AF_BLUE_STRINGSET_VAII = 247, + af_blue_2_1 = 250, #ifdef AF_CONFIG_OPTION_CJK AF_BLUE_STRINGSET_HANI = af_blue_2_1 + 0, af_blue_2_1_1 = af_blue_2_1 + 2, diff --git a/thirdparty/freetype/src/autofit/afcjk.c b/thirdparty/freetype/src/autofit/afcjk.c index 3b2b1cf24c..a61689bee3 100644 --- a/thirdparty/freetype/src/autofit/afcjk.c +++ b/thirdparty/freetype/src/autofit/afcjk.c @@ -1184,6 +1184,8 @@ seg = edge->first; + if ( !seg ) + goto Skip_Loop; do { @@ -1239,13 +1241,14 @@ edge2->flags |= AF_EDGE_SERIF; } else - edge->link = edge2; + edge->link = edge2; } seg = seg->edge_next; } while ( seg != edge->first ); + Skip_Loop: /* set the round/straight flags */ edge->flags = AF_EDGE_NORMAL; diff --git a/thirdparty/freetype/src/autofit/afglobal.c b/thirdparty/freetype/src/autofit/afglobal.c index 7183ce4a78..6a9a1e5aaa 100644 --- a/thirdparty/freetype/src/autofit/afglobal.c +++ b/thirdparty/freetype/src/autofit/afglobal.c @@ -443,6 +443,7 @@ style = (AF_Style)( globals->glyph_styles[gindex] & AF_STYLE_UNASSIGNED ); + Again: style_class = af_style_classes[style]; writing_system_class = af_writing_system_classes [style_class->writing_system]; @@ -470,6 +471,16 @@ writing_system_class->style_metrics_done( metrics ); FT_FREE( metrics ); + + /* internal error code -1 indicates */ + /* that no blue zones have been found */ + if ( error == -1 ) + { + style = (AF_Style)( globals->glyph_styles[gindex] & + AF_STYLE_UNASSIGNED ); + goto Again; + } + goto Exit; } } diff --git a/thirdparty/freetype/src/autofit/aflatin.c b/thirdparty/freetype/src/autofit/aflatin.c index dccdcaf345..27d4024882 100644 --- a/thirdparty/freetype/src/autofit/aflatin.c +++ b/thirdparty/freetype/src/autofit/aflatin.c @@ -149,7 +149,11 @@ af_shaper_buf_destroy( face, shaper_buf ); if ( !glyph_index ) + { + FT_TRACE5(( "standard character missing;" + " using fallback stem widths\n" )); goto Exit; + } FT_TRACE5(( "standard character: U+%04lX (glyph index %d)\n", ch, glyph_index )); @@ -312,7 +316,7 @@ /* Find all blue zones. Flat segments give the reference points, */ /* round segments the overshoot positions. */ - static void + static int af_latin_metrics_init_blues( AF_LatinMetrics metrics, FT_Face face ) { @@ -981,10 +985,11 @@ af_shaper_buf_destroy( face, shaper_buf ); - /* we finally check whether blue zones are ordered; */ - /* `ref' and `shoot' values of two blue zones must not overlap */ if ( axis->blue_count ) { + /* we finally check whether blue zones are ordered; */ + /* `ref' and `shoot' values of two blue zones must not overlap */ + FT_UInt i; AF_LatinBlue blue_sorted[AF_BLUE_STRINGSET_MAX_LEN + 2]; @@ -1033,11 +1038,34 @@ *a )); } } + + FT_TRACE5(( "\n" )); + + return 0; } + else + { + /* disable hinting for the current style if there are no blue zones */ - FT_TRACE5(( "\n" )); + AF_FaceGlobals globals = metrics->root.globals; + FT_UShort* gstyles = globals->glyph_styles; + + FT_Long i; + + + FT_TRACE5(( "no blue zones found:" + " hinting disabled for this style\n" )); - return; + for ( i = 0; i < globals->glyph_count; i++ ) + { + if ( ( gstyles[i] & AF_STYLE_MASK ) == sc->style ) + gstyles[i] = AF_STYLE_NONE_DFLT; + } + + FT_TRACE5(( "\n" )); + + return 1; + } } @@ -1116,6 +1144,8 @@ af_latin_metrics_init( AF_LatinMetrics metrics, FT_Face face ) { + FT_Error error = FT_Err_Ok; + FT_CharMap oldmap = face->charmap; @@ -1124,12 +1154,18 @@ if ( !FT_Select_Charmap( face, FT_ENCODING_UNICODE ) ) { af_latin_metrics_init_widths( metrics, face ); - af_latin_metrics_init_blues( metrics, face ); + if ( af_latin_metrics_init_blues( metrics, face ) ) + { + /* use internal error code to indicate missing blue zones */ + error = -1; + goto Exit; + } af_latin_metrics_check_digits( metrics, face ); } + Exit: FT_Set_Charmap( face, oldmap ); - return FT_Err_Ok; + return error; } @@ -1443,13 +1479,13 @@ nn, blue->ref.org, blue->ref.fit / 64.0, - blue->flags & AF_LATIN_BLUE_ACTIVE ? "" - : " (inactive)", + ( blue->flags & AF_LATIN_BLUE_ACTIVE ) ? "" + : " (inactive)", nn, blue->shoot.org, blue->shoot.fit / 64.0, - blue->flags & AF_LATIN_BLUE_ACTIVE ? "" - : " (inactive)" )); + ( blue->flags & AF_LATIN_BLUE_ACTIVE ) ? "" + : " (inactive)" )); } #endif } diff --git a/thirdparty/freetype/src/autofit/afranges.c b/thirdparty/freetype/src/autofit/afranges.c index c0dba818a1..45c8bbfc95 100644 --- a/thirdparty/freetype/src/autofit/afranges.c +++ b/thirdparty/freetype/src/autofit/afranges.c @@ -664,6 +664,21 @@ }; + const AF_Script_UniRangeRec af_mong_uniranges[] = + { + AF_UNIRANGE_REC( 0x1800, 0x18AF ), /* Mongolian */ + AF_UNIRANGE_REC( 0x11660, 0x1167F ), /* Mongolian Supplement */ + AF_UNIRANGE_REC( 0, 0 ) + }; + + const AF_Script_UniRangeRec af_mong_nonbase_uniranges[] = + { + AF_UNIRANGE_REC( 0x1885, 0x1886 ), + AF_UNIRANGE_REC( 0x18A9, 0x18A9 ), + AF_UNIRANGE_REC( 0, 0 ) + }; + + const AF_Script_UniRangeRec af_mymr_uniranges[] = { AF_UNIRANGE_REC( 0x1000, 0x109F ), /* Myanmar */ diff --git a/thirdparty/freetype/src/autofit/afscript.h b/thirdparty/freetype/src/autofit/afscript.h index c2f0c7ac60..2da8c70183 100644 --- a/thirdparty/freetype/src/autofit/afscript.h +++ b/thirdparty/freetype/src/autofit/afscript.h @@ -243,6 +243,12 @@ HINTING_BOTTOM_TO_TOP, "\xE0\xB4\xA0 \xE0\xB4\xB1" ) /* ഠ റ */ + SCRIPT( mong, MONG, + "Mongolian", + HB_SCRIPT_MONGOLIAN, + HINTING_TOP_TO_BOTTOM, + "\xE1\xA1\x82 \xE1\xA0\xAA" ) /* ᡂ ᠪ */ + SCRIPT( mymr, MYMR, "Myanmar", HB_SCRIPT_MYANMAR, diff --git a/thirdparty/freetype/src/autofit/afstyles.h b/thirdparty/freetype/src/autofit/afstyles.h index edf4f54edd..8d1d70812f 100644 --- a/thirdparty/freetype/src/autofit/afstyles.h +++ b/thirdparty/freetype/src/autofit/afstyles.h @@ -322,6 +322,13 @@ AF_BLUE_STRINGSET_MLYM, AF_COVERAGE_DEFAULT ) + STYLE( mong_dflt, MONG_DFLT, + "Mongolian default style", + AF_WRITING_SYSTEM_LATIN, + AF_SCRIPT_MONG, + AF_BLUE_STRINGSET_MONG, + AF_COVERAGE_DEFAULT ) + STYLE( mymr_dflt, MYMR_DFLT, "Myanmar default style", AF_WRITING_SYSTEM_LATIN, diff --git a/thirdparty/freetype/src/base/ftbbox.c b/thirdparty/freetype/src/base/ftbbox.c index 0b04fde635..a0b2c46f7b 100644 --- a/thirdparty/freetype/src/base/ftbbox.c +++ b/thirdparty/freetype/src/base/ftbbox.c @@ -319,9 +319,9 @@ q2 = q2 + q1; q4 = q4 + q3; q3 = q3 + q2; - q4 = ( q4 + q3 ) / 8; - q3 = q3 / 4; - q2 = q2 / 2; + q4 = ( q4 + q3 ) >> 3; + q3 = q3 >> 2; + q2 = q2 >> 1; } else /* second half */ { @@ -330,9 +330,9 @@ q3 = q3 + q4; q1 = q1 + q2; q2 = q2 + q3; - q1 = ( q1 + q2 ) / 8; - q2 = q2 / 4; - q3 = q3 / 2; + q1 = ( q1 + q2 ) >> 3; + q2 = q2 >> 2; + q3 = q3 >> 1; } /* check whether either end reached the maximum */ diff --git a/thirdparty/freetype/src/base/ftbitmap.c b/thirdparty/freetype/src/base/ftbitmap.c index 1bdcd9eff3..0e0a76fe40 100644 --- a/thirdparty/freetype/src/base/ftbitmap.c +++ b/thirdparty/freetype/src/base/ftbitmap.c @@ -922,12 +922,18 @@ else FT_TRACE5(( " target bitmap: empty\n" )); - FT_TRACE5(( " final bitmap: (%d, %d) -- (%d, %d); %d x %d\n", - final_llx / 64, final_lly / 64, - final_urx / 64, final_ury / 64, - final_width, final_rows )); + if ( final_width && final_rows ) + FT_TRACE5(( " final bitmap: (%d, %d) -- (%d, %d); %d x %d\n", + final_llx / 64, final_lly / 64, + final_urx / 64, final_ury / 64, + final_width, final_rows )); + else + FT_TRACE5(( " final bitmap: empty\n" )); #endif /* FT_DEBUG_LEVEL_TRACE */ + if ( !( final_width && final_rows ) ) + return FT_Err_Ok; /* nothing to do */ + /* for blending, set offset vector of final bitmap */ /* temporarily to (0,0) */ source_llx -= final_llx; @@ -971,6 +977,7 @@ pitch = target->pitch; + if ( pitch < 0 ) pitch = -pitch; diff --git a/thirdparty/freetype/src/base/fterrors.c b/thirdparty/freetype/src/base/fterrors.c index 4ef326d8e2..84fe590289 100644 --- a/thirdparty/freetype/src/base/fterrors.c +++ b/thirdparty/freetype/src/base/fterrors.c @@ -17,6 +17,7 @@ #include <ft2build.h> +#include FT_INTERNAL_DEBUG_H #include FT_ERRORS_H diff --git a/thirdparty/freetype/src/base/ftinit.c b/thirdparty/freetype/src/base/ftinit.c index 9d524effa9..c73cd78b83 100644 --- a/thirdparty/freetype/src/base/ftinit.c +++ b/thirdparty/freetype/src/base/ftinit.c @@ -176,6 +176,9 @@ module_name, property_name, property_value ); + + if ( !*p ) + break; } } diff --git a/thirdparty/freetype/src/base/ftlcdfil.c b/thirdparty/freetype/src/base/ftlcdfil.c index 9fb49ba116..d9f4af4293 100644 --- a/thirdparty/freetype/src/base/ftlcdfil.c +++ b/thirdparty/freetype/src/base/ftlcdfil.c @@ -77,13 +77,13 @@ /* FIR filter used by the default and light filters */ FT_BASE_DEF( void ) ft_lcd_filter_fir( FT_Bitmap* bitmap, - FT_Render_Mode mode, FT_LcdFiveTapFilter weights ) { FT_UInt width = (FT_UInt)bitmap->width; FT_UInt height = (FT_UInt)bitmap->rows; FT_Int pitch = bitmap->pitch; FT_Byte* origin = bitmap->buffer; + FT_Byte mode = bitmap->pixel_mode; /* take care of bitmap flow */ @@ -91,7 +91,7 @@ origin += pitch * (FT_Int)( height - 1 ); /* horizontal in-place FIR filter */ - if ( mode == FT_RENDER_MODE_LCD && width >= 2 ) + if ( mode == FT_PIXEL_MODE_LCD && width >= 2 ) { FT_Byte* line = origin; @@ -134,7 +134,7 @@ } /* vertical in-place FIR filter */ - else if ( mode == FT_RENDER_MODE_LCD_V && height >= 2 ) + else if ( mode == FT_PIXEL_MODE_LCD_V && height >= 2 ) { FT_Byte* column = origin; @@ -183,13 +183,13 @@ /* intra-pixel filter used by the legacy filter */ static void _ft_lcd_filter_legacy( FT_Bitmap* bitmap, - FT_Render_Mode mode, FT_Byte* weights ) { FT_UInt width = (FT_UInt)bitmap->width; FT_UInt height = (FT_UInt)bitmap->rows; FT_Int pitch = bitmap->pitch; FT_Byte* origin = bitmap->buffer; + FT_Byte mode = bitmap->pixel_mode; static const unsigned int filters[3][3] = { @@ -206,7 +206,7 @@ origin += pitch * (FT_Int)( height - 1 ); /* horizontal in-place intra-pixel filter */ - if ( mode == FT_RENDER_MODE_LCD && width >= 3 ) + if ( mode == FT_PIXEL_MODE_LCD && width >= 3 ) { FT_Byte* line = origin; @@ -243,7 +243,7 @@ } } } - else if ( mode == FT_RENDER_MODE_LCD_V && height >= 3 ) + else if ( mode == FT_PIXEL_MODE_LCD_V && height >= 3 ) { FT_Byte* column = origin; diff --git a/thirdparty/freetype/src/base/ftobjs.c b/thirdparty/freetype/src/base/ftobjs.c index 3f8619d3b3..e301f8f11a 100644 --- a/thirdparty/freetype/src/base/ftobjs.c +++ b/thirdparty/freetype/src/base/ftobjs.c @@ -4059,8 +4059,8 @@ /* documentation is in freetype.h */ FT_EXPORT_DEF( FT_UInt ) - FT_Get_Name_Index( FT_Face face, - FT_String* glyph_name ) + FT_Get_Name_Index( FT_Face face, + const FT_String* glyph_name ) { FT_UInt result = 0; diff --git a/thirdparty/freetype/src/base/ftoutln.c b/thirdparty/freetype/src/base/ftoutln.c index 00329b46c6..0e2ba3475d 100644 --- a/thirdparty/freetype/src/base/ftoutln.c +++ b/thirdparty/freetype/src/base/ftoutln.c @@ -46,8 +46,7 @@ void* user ) { #undef SCALED -#define SCALED( x ) ( ( (x) < 0 ? -( -(x) << shift ) \ - : ( (x) << shift ) ) - delta ) +#define SCALED( x ) ( (x) * ( 1L << shift ) - delta ) FT_Vector v_last; FT_Vector v_control; @@ -621,6 +620,16 @@ params->source = (void*)outline; + /* preset clip_box for direct mode */ + if ( params->flags & FT_RASTER_FLAG_DIRECT && + !( params->flags & FT_RASTER_FLAG_CLIP ) ) + { + params->clip_box.xMin = cbox.xMin >> 6; + params->clip_box.yMin = cbox.yMin >> 6; + params->clip_box.xMax = ( cbox.xMax + 63 ) >> 6; + params->clip_box.yMax = ( cbox.yMax + 63 ) >> 6; + } + error = FT_ERR( Cannot_Render_Glyph ); while ( renderer ) { diff --git a/thirdparty/freetype/src/base/ftstroke.c b/thirdparty/freetype/src/base/ftstroke.c index 826062c94e..1b2c0f657c 100644 --- a/thirdparty/freetype/src/base/ftstroke.c +++ b/thirdparty/freetype/src/base/ftstroke.c @@ -86,16 +86,18 @@ base[4].x = base[2].x; - b = base[1].x; - a = base[3].x = ( base[2].x + b ) / 2; - b = base[1].x = ( base[0].x + b ) / 2; - base[2].x = ( a + b ) / 2; + a = base[0].x + base[1].x; + b = base[1].x + base[2].x; + base[3].x = b >> 1; + base[2].x = ( a + b ) >> 2; + base[1].x = a >> 1; base[4].y = base[2].y; - b = base[1].y; - a = base[3].y = ( base[2].y + b ) / 2; - b = base[1].y = ( base[0].y + b ) / 2; - base[2].y = ( a + b ) / 2; + a = base[0].y + base[1].y; + b = base[1].y + base[2].y; + base[3].y = b >> 1; + base[2].y = ( a + b ) >> 2; + base[1].y = a >> 1; } @@ -153,28 +155,32 @@ static void ft_cubic_split( FT_Vector* base ) { - FT_Pos a, b, c, d; + FT_Pos a, b, c; base[6].x = base[3].x; - c = base[1].x; - d = base[2].x; - base[1].x = a = ( base[0].x + c ) / 2; - base[5].x = b = ( base[3].x + d ) / 2; - c = ( c + d ) / 2; - base[2].x = a = ( a + c ) / 2; - base[4].x = b = ( b + c ) / 2; - base[3].x = ( a + b ) / 2; + a = base[0].x + base[1].x; + b = base[1].x + base[2].x; + c = base[2].x + base[3].x; + base[5].x = c >> 1; + c += b; + base[4].x = c >> 2; + base[1].x = a >> 1; + a += b; + base[2].x = a >> 2; + base[3].x = ( a + c ) >> 3; base[6].y = base[3].y; - c = base[1].y; - d = base[2].y; - base[1].y = a = ( base[0].y + c ) / 2; - base[5].y = b = ( base[3].y + d ) / 2; - c = ( c + d ) / 2; - base[2].y = a = ( a + c ) / 2; - base[4].y = b = ( b + c ) / 2; - base[3].y = ( a + b ) / 2; + a = base[0].y + base[1].y; + b = base[1].y + base[2].y; + c = base[2].y + base[3].y; + base[5].y = c >> 1; + c += b; + base[4].y = c >> 2; + base[1].y = a >> 1; + a += b; + base[2].y = a >> 2; + base[3].y = ( a + c ) >> 3; } diff --git a/thirdparty/freetype/src/base/ftver.rc b/thirdparty/freetype/src/base/ftver.rc index e02a88652c..1354497423 100644 --- a/thirdparty/freetype/src/base/ftver.rc +++ b/thirdparty/freetype/src/base/ftver.rc @@ -18,8 +18,8 @@ #include<windows.h> -#define FT_VERSION 2,10,0,0 -#define FT_VERSION_STR "2.10.0" +#define FT_VERSION 2,10,1,0 +#define FT_VERSION_STR "2.10.1" VS_VERSION_INFO VERSIONINFO FILEVERSION FT_VERSION diff --git a/thirdparty/freetype/src/bdf/bdf.h b/thirdparty/freetype/src/bdf/bdf.h index 4018756f72..d9abd2378f 100644 --- a/thirdparty/freetype/src/bdf/bdf.h +++ b/thirdparty/freetype/src/bdf/bdf.h @@ -109,9 +109,9 @@ FT_BEGIN_HEADER /* There are a set of defaults and each font has their own. */ typedef struct bdf_property_t_ { - char* name; /* Name of the property. */ - int format; /* Format of the property. */ - int builtin; /* A builtin property. */ + const char* name; /* Name of the property. */ + int format; /* Format of the property. */ + int builtin; /* A builtin property. */ union { char* atom; diff --git a/thirdparty/freetype/src/bdf/bdfdrivr.c b/thirdparty/freetype/src/bdf/bdfdrivr.c index 4a11843a1c..60eb93305e 100644 --- a/thirdparty/freetype/src/bdf/bdfdrivr.c +++ b/thirdparty/freetype/src/bdf/bdfdrivr.c @@ -106,7 +106,7 @@ THE SOFTWARE. FT_ULong code; - if ( mid > max || mid < min ) + if ( mid >= max || mid < min ) mid = ( min + max ) >> 1; code = encodings[mid].enc; @@ -152,7 +152,7 @@ THE SOFTWARE. FT_ULong code; /* same as BDF_encoding_el.enc */ - if ( mid > max || mid < min ) + if ( mid >= max || mid < min ) mid = ( min + max ) >> 1; code = encodings[mid].enc; @@ -216,13 +216,13 @@ THE SOFTWARE. bdf_font_t* font = bdf->bdffont; bdf_property_t* prop; - char* strings[4] = { NULL, NULL, NULL, NULL }; - size_t nn, len, lengths[4]; + const char* strings[4] = { NULL, NULL, NULL, NULL }; + size_t lengths[4], nn, len; face->style_flags = 0; - prop = bdf_get_font_property( font, (char *)"SLANT" ); + prop = bdf_get_font_property( font, "SLANT" ); if ( prop && prop->format == BDF_ATOM && prop->value.atom && ( *(prop->value.atom) == 'O' || *(prop->value.atom) == 'o' || @@ -230,30 +230,30 @@ THE SOFTWARE. { face->style_flags |= FT_STYLE_FLAG_ITALIC; strings[2] = ( *(prop->value.atom) == 'O' || *(prop->value.atom) == 'o' ) - ? (char *)"Oblique" - : (char *)"Italic"; + ? "Oblique" + : "Italic"; } - prop = bdf_get_font_property( font, (char *)"WEIGHT_NAME" ); + prop = bdf_get_font_property( font, "WEIGHT_NAME" ); if ( prop && prop->format == BDF_ATOM && prop->value.atom && ( *(prop->value.atom) == 'B' || *(prop->value.atom) == 'b' ) ) { face->style_flags |= FT_STYLE_FLAG_BOLD; - strings[1] = (char *)"Bold"; + strings[1] = "Bold"; } - prop = bdf_get_font_property( font, (char *)"SETWIDTH_NAME" ); + prop = bdf_get_font_property( font, "SETWIDTH_NAME" ); if ( prop && prop->format == BDF_ATOM && prop->value.atom && *(prop->value.atom) && !( *(prop->value.atom) == 'N' || *(prop->value.atom) == 'n' ) ) - strings[3] = (char *)(prop->value.atom); + strings[3] = (const char *)(prop->value.atom); - prop = bdf_get_font_property( font, (char *)"ADD_STYLE_NAME" ); + prop = bdf_get_font_property( font, "ADD_STYLE_NAME" ); if ( prop && prop->format == BDF_ATOM && prop->value.atom && *(prop->value.atom) && !( *(prop->value.atom) == 'N' || *(prop->value.atom) == 'n' ) ) - strings[0] = (char *)(prop->value.atom); + strings[0] = (const char *)(prop->value.atom); for ( len = 0, nn = 0; nn < 4; nn++ ) { @@ -267,7 +267,7 @@ THE SOFTWARE. if ( len == 0 ) { - strings[0] = (char *)"Regular"; + strings[0] = "Regular"; lengths[0] = ft_strlen( strings[0] ); len = lengths[0] + 1; } @@ -283,7 +283,7 @@ THE SOFTWARE. for ( nn = 0; nn < 4; nn++ ) { - char* src = strings[nn]; + const char* src = strings[nn]; len = lengths[nn]; diff --git a/thirdparty/freetype/src/bdf/bdflib.c b/thirdparty/freetype/src/bdf/bdflib.c index 0898b0d470..63813f7edc 100644 --- a/thirdparty/freetype/src/bdf/bdflib.c +++ b/thirdparty/freetype/src/bdf/bdflib.c @@ -79,89 +79,89 @@ static const bdf_property_t _bdf_properties[] = { - { (char *)"ADD_STYLE_NAME", BDF_ATOM, 1, { 0 } }, - { (char *)"AVERAGE_WIDTH", BDF_INTEGER, 1, { 0 } }, - { (char *)"AVG_CAPITAL_WIDTH", BDF_INTEGER, 1, { 0 } }, - { (char *)"AVG_LOWERCASE_WIDTH", BDF_INTEGER, 1, { 0 } }, - { (char *)"CAP_HEIGHT", BDF_INTEGER, 1, { 0 } }, - { (char *)"CHARSET_COLLECTIONS", BDF_ATOM, 1, { 0 } }, - { (char *)"CHARSET_ENCODING", BDF_ATOM, 1, { 0 } }, - { (char *)"CHARSET_REGISTRY", BDF_ATOM, 1, { 0 } }, - { (char *)"COMMENT", BDF_ATOM, 1, { 0 } }, - { (char *)"COPYRIGHT", BDF_ATOM, 1, { 0 } }, - { (char *)"DEFAULT_CHAR", BDF_CARDINAL, 1, { 0 } }, - { (char *)"DESTINATION", BDF_CARDINAL, 1, { 0 } }, - { (char *)"DEVICE_FONT_NAME", BDF_ATOM, 1, { 0 } }, - { (char *)"END_SPACE", BDF_INTEGER, 1, { 0 } }, - { (char *)"FACE_NAME", BDF_ATOM, 1, { 0 } }, - { (char *)"FAMILY_NAME", BDF_ATOM, 1, { 0 } }, - { (char *)"FIGURE_WIDTH", BDF_INTEGER, 1, { 0 } }, - { (char *)"FONT", BDF_ATOM, 1, { 0 } }, - { (char *)"FONTNAME_REGISTRY", BDF_ATOM, 1, { 0 } }, - { (char *)"FONT_ASCENT", BDF_INTEGER, 1, { 0 } }, - { (char *)"FONT_DESCENT", BDF_INTEGER, 1, { 0 } }, - { (char *)"FOUNDRY", BDF_ATOM, 1, { 0 } }, - { (char *)"FULL_NAME", BDF_ATOM, 1, { 0 } }, - { (char *)"ITALIC_ANGLE", BDF_INTEGER, 1, { 0 } }, - { (char *)"MAX_SPACE", BDF_INTEGER, 1, { 0 } }, - { (char *)"MIN_SPACE", BDF_INTEGER, 1, { 0 } }, - { (char *)"NORM_SPACE", BDF_INTEGER, 1, { 0 } }, - { (char *)"NOTICE", BDF_ATOM, 1, { 0 } }, - { (char *)"PIXEL_SIZE", BDF_INTEGER, 1, { 0 } }, - { (char *)"POINT_SIZE", BDF_INTEGER, 1, { 0 } }, - { (char *)"QUAD_WIDTH", BDF_INTEGER, 1, { 0 } }, - { (char *)"RAW_ASCENT", BDF_INTEGER, 1, { 0 } }, - { (char *)"RAW_AVERAGE_WIDTH", BDF_INTEGER, 1, { 0 } }, - { (char *)"RAW_AVG_CAPITAL_WIDTH", BDF_INTEGER, 1, { 0 } }, - { (char *)"RAW_AVG_LOWERCASE_WIDTH", BDF_INTEGER, 1, { 0 } }, - { (char *)"RAW_CAP_HEIGHT", BDF_INTEGER, 1, { 0 } }, - { (char *)"RAW_DESCENT", BDF_INTEGER, 1, { 0 } }, - { (char *)"RAW_END_SPACE", BDF_INTEGER, 1, { 0 } }, - { (char *)"RAW_FIGURE_WIDTH", BDF_INTEGER, 1, { 0 } }, - { (char *)"RAW_MAX_SPACE", BDF_INTEGER, 1, { 0 } }, - { (char *)"RAW_MIN_SPACE", BDF_INTEGER, 1, { 0 } }, - { (char *)"RAW_NORM_SPACE", BDF_INTEGER, 1, { 0 } }, - { (char *)"RAW_PIXEL_SIZE", BDF_INTEGER, 1, { 0 } }, - { (char *)"RAW_POINT_SIZE", BDF_INTEGER, 1, { 0 } }, - { (char *)"RAW_PIXELSIZE", BDF_INTEGER, 1, { 0 } }, - { (char *)"RAW_POINTSIZE", BDF_INTEGER, 1, { 0 } }, - { (char *)"RAW_QUAD_WIDTH", BDF_INTEGER, 1, { 0 } }, - { (char *)"RAW_SMALL_CAP_SIZE", BDF_INTEGER, 1, { 0 } }, - { (char *)"RAW_STRIKEOUT_ASCENT", BDF_INTEGER, 1, { 0 } }, - { (char *)"RAW_STRIKEOUT_DESCENT", BDF_INTEGER, 1, { 0 } }, - { (char *)"RAW_SUBSCRIPT_SIZE", BDF_INTEGER, 1, { 0 } }, - { (char *)"RAW_SUBSCRIPT_X", BDF_INTEGER, 1, { 0 } }, - { (char *)"RAW_SUBSCRIPT_Y", BDF_INTEGER, 1, { 0 } }, - { (char *)"RAW_SUPERSCRIPT_SIZE", BDF_INTEGER, 1, { 0 } }, - { (char *)"RAW_SUPERSCRIPT_X", BDF_INTEGER, 1, { 0 } }, - { (char *)"RAW_SUPERSCRIPT_Y", BDF_INTEGER, 1, { 0 } }, - { (char *)"RAW_UNDERLINE_POSITION", BDF_INTEGER, 1, { 0 } }, - { (char *)"RAW_UNDERLINE_THICKNESS", BDF_INTEGER, 1, { 0 } }, - { (char *)"RAW_X_HEIGHT", BDF_INTEGER, 1, { 0 } }, - { (char *)"RELATIVE_SETWIDTH", BDF_CARDINAL, 1, { 0 } }, - { (char *)"RELATIVE_WEIGHT", BDF_CARDINAL, 1, { 0 } }, - { (char *)"RESOLUTION", BDF_INTEGER, 1, { 0 } }, - { (char *)"RESOLUTION_X", BDF_CARDINAL, 1, { 0 } }, - { (char *)"RESOLUTION_Y", BDF_CARDINAL, 1, { 0 } }, - { (char *)"SETWIDTH_NAME", BDF_ATOM, 1, { 0 } }, - { (char *)"SLANT", BDF_ATOM, 1, { 0 } }, - { (char *)"SMALL_CAP_SIZE", BDF_INTEGER, 1, { 0 } }, - { (char *)"SPACING", BDF_ATOM, 1, { 0 } }, - { (char *)"STRIKEOUT_ASCENT", BDF_INTEGER, 1, { 0 } }, - { (char *)"STRIKEOUT_DESCENT", BDF_INTEGER, 1, { 0 } }, - { (char *)"SUBSCRIPT_SIZE", BDF_INTEGER, 1, { 0 } }, - { (char *)"SUBSCRIPT_X", BDF_INTEGER, 1, { 0 } }, - { (char *)"SUBSCRIPT_Y", BDF_INTEGER, 1, { 0 } }, - { (char *)"SUPERSCRIPT_SIZE", BDF_INTEGER, 1, { 0 } }, - { (char *)"SUPERSCRIPT_X", BDF_INTEGER, 1, { 0 } }, - { (char *)"SUPERSCRIPT_Y", BDF_INTEGER, 1, { 0 } }, - { (char *)"UNDERLINE_POSITION", BDF_INTEGER, 1, { 0 } }, - { (char *)"UNDERLINE_THICKNESS", BDF_INTEGER, 1, { 0 } }, - { (char *)"WEIGHT", BDF_CARDINAL, 1, { 0 } }, - { (char *)"WEIGHT_NAME", BDF_ATOM, 1, { 0 } }, - { (char *)"X_HEIGHT", BDF_INTEGER, 1, { 0 } }, - { (char *)"_MULE_BASELINE_OFFSET", BDF_INTEGER, 1, { 0 } }, - { (char *)"_MULE_RELATIVE_COMPOSE", BDF_INTEGER, 1, { 0 } }, + { "ADD_STYLE_NAME", BDF_ATOM, 1, { 0 } }, + { "AVERAGE_WIDTH", BDF_INTEGER, 1, { 0 } }, + { "AVG_CAPITAL_WIDTH", BDF_INTEGER, 1, { 0 } }, + { "AVG_LOWERCASE_WIDTH", BDF_INTEGER, 1, { 0 } }, + { "CAP_HEIGHT", BDF_INTEGER, 1, { 0 } }, + { "CHARSET_COLLECTIONS", BDF_ATOM, 1, { 0 } }, + { "CHARSET_ENCODING", BDF_ATOM, 1, { 0 } }, + { "CHARSET_REGISTRY", BDF_ATOM, 1, { 0 } }, + { "COMMENT", BDF_ATOM, 1, { 0 } }, + { "COPYRIGHT", BDF_ATOM, 1, { 0 } }, + { "DEFAULT_CHAR", BDF_CARDINAL, 1, { 0 } }, + { "DESTINATION", BDF_CARDINAL, 1, { 0 } }, + { "DEVICE_FONT_NAME", BDF_ATOM, 1, { 0 } }, + { "END_SPACE", BDF_INTEGER, 1, { 0 } }, + { "FACE_NAME", BDF_ATOM, 1, { 0 } }, + { "FAMILY_NAME", BDF_ATOM, 1, { 0 } }, + { "FIGURE_WIDTH", BDF_INTEGER, 1, { 0 } }, + { "FONT", BDF_ATOM, 1, { 0 } }, + { "FONTNAME_REGISTRY", BDF_ATOM, 1, { 0 } }, + { "FONT_ASCENT", BDF_INTEGER, 1, { 0 } }, + { "FONT_DESCENT", BDF_INTEGER, 1, { 0 } }, + { "FOUNDRY", BDF_ATOM, 1, { 0 } }, + { "FULL_NAME", BDF_ATOM, 1, { 0 } }, + { "ITALIC_ANGLE", BDF_INTEGER, 1, { 0 } }, + { "MAX_SPACE", BDF_INTEGER, 1, { 0 } }, + { "MIN_SPACE", BDF_INTEGER, 1, { 0 } }, + { "NORM_SPACE", BDF_INTEGER, 1, { 0 } }, + { "NOTICE", BDF_ATOM, 1, { 0 } }, + { "PIXEL_SIZE", BDF_INTEGER, 1, { 0 } }, + { "POINT_SIZE", BDF_INTEGER, 1, { 0 } }, + { "QUAD_WIDTH", BDF_INTEGER, 1, { 0 } }, + { "RAW_ASCENT", BDF_INTEGER, 1, { 0 } }, + { "RAW_AVERAGE_WIDTH", BDF_INTEGER, 1, { 0 } }, + { "RAW_AVG_CAPITAL_WIDTH", BDF_INTEGER, 1, { 0 } }, + { "RAW_AVG_LOWERCASE_WIDTH", BDF_INTEGER, 1, { 0 } }, + { "RAW_CAP_HEIGHT", BDF_INTEGER, 1, { 0 } }, + { "RAW_DESCENT", BDF_INTEGER, 1, { 0 } }, + { "RAW_END_SPACE", BDF_INTEGER, 1, { 0 } }, + { "RAW_FIGURE_WIDTH", BDF_INTEGER, 1, { 0 } }, + { "RAW_MAX_SPACE", BDF_INTEGER, 1, { 0 } }, + { "RAW_MIN_SPACE", BDF_INTEGER, 1, { 0 } }, + { "RAW_NORM_SPACE", BDF_INTEGER, 1, { 0 } }, + { "RAW_PIXEL_SIZE", BDF_INTEGER, 1, { 0 } }, + { "RAW_POINT_SIZE", BDF_INTEGER, 1, { 0 } }, + { "RAW_PIXELSIZE", BDF_INTEGER, 1, { 0 } }, + { "RAW_POINTSIZE", BDF_INTEGER, 1, { 0 } }, + { "RAW_QUAD_WIDTH", BDF_INTEGER, 1, { 0 } }, + { "RAW_SMALL_CAP_SIZE", BDF_INTEGER, 1, { 0 } }, + { "RAW_STRIKEOUT_ASCENT", BDF_INTEGER, 1, { 0 } }, + { "RAW_STRIKEOUT_DESCENT", BDF_INTEGER, 1, { 0 } }, + { "RAW_SUBSCRIPT_SIZE", BDF_INTEGER, 1, { 0 } }, + { "RAW_SUBSCRIPT_X", BDF_INTEGER, 1, { 0 } }, + { "RAW_SUBSCRIPT_Y", BDF_INTEGER, 1, { 0 } }, + { "RAW_SUPERSCRIPT_SIZE", BDF_INTEGER, 1, { 0 } }, + { "RAW_SUPERSCRIPT_X", BDF_INTEGER, 1, { 0 } }, + { "RAW_SUPERSCRIPT_Y", BDF_INTEGER, 1, { 0 } }, + { "RAW_UNDERLINE_POSITION", BDF_INTEGER, 1, { 0 } }, + { "RAW_UNDERLINE_THICKNESS", BDF_INTEGER, 1, { 0 } }, + { "RAW_X_HEIGHT", BDF_INTEGER, 1, { 0 } }, + { "RELATIVE_SETWIDTH", BDF_CARDINAL, 1, { 0 } }, + { "RELATIVE_WEIGHT", BDF_CARDINAL, 1, { 0 } }, + { "RESOLUTION", BDF_INTEGER, 1, { 0 } }, + { "RESOLUTION_X", BDF_CARDINAL, 1, { 0 } }, + { "RESOLUTION_Y", BDF_CARDINAL, 1, { 0 } }, + { "SETWIDTH_NAME", BDF_ATOM, 1, { 0 } }, + { "SLANT", BDF_ATOM, 1, { 0 } }, + { "SMALL_CAP_SIZE", BDF_INTEGER, 1, { 0 } }, + { "SPACING", BDF_ATOM, 1, { 0 } }, + { "STRIKEOUT_ASCENT", BDF_INTEGER, 1, { 0 } }, + { "STRIKEOUT_DESCENT", BDF_INTEGER, 1, { 0 } }, + { "SUBSCRIPT_SIZE", BDF_INTEGER, 1, { 0 } }, + { "SUBSCRIPT_X", BDF_INTEGER, 1, { 0 } }, + { "SUBSCRIPT_Y", BDF_INTEGER, 1, { 0 } }, + { "SUPERSCRIPT_SIZE", BDF_INTEGER, 1, { 0 } }, + { "SUPERSCRIPT_X", BDF_INTEGER, 1, { 0 } }, + { "SUPERSCRIPT_Y", BDF_INTEGER, 1, { 0 } }, + { "UNDERLINE_POSITION", BDF_INTEGER, 1, { 0 } }, + { "UNDERLINE_THICKNESS", BDF_INTEGER, 1, { 0 } }, + { "WEIGHT", BDF_CARDINAL, 1, { 0 } }, + { "WEIGHT_NAME", BDF_ATOM, 1, { 0 } }, + { "X_HEIGHT", BDF_INTEGER, 1, { 0 } }, + { "_MULE_BASELINE_OFFSET", BDF_INTEGER, 1, { 0 } }, + { "_MULE_RELATIVE_COMPOSE", BDF_INTEGER, 1, { 0 } }, }; static const unsigned long @@ -364,7 +364,7 @@ /* An empty string for empty fields. */ - static const char empty[1] = { 0 }; /* XXX eliminate this */ + static const char empty[] = ""; /* XXX eliminate this */ static char * @@ -407,13 +407,14 @@ static FT_Error _bdf_list_split( _bdf_list_t* list, - char* separators, + const char* separators, char* line, unsigned long linelen ) { unsigned long final_empty; int mult; - char *sp, *ep, *end; + const char *sp, *end; + char *ep; char seps[32]; FT_Error error = FT_Err_Ok; @@ -473,7 +474,7 @@ } /* Assign the field appropriately. */ - list->field[list->used++] = ( ep > sp ) ? sp : (char*)empty; + list->field[list->used++] = ( ep > sp ) ? (char*)sp : (char*)empty; sp = ep; @@ -692,7 +693,7 @@ /* Routine to convert a decimal ASCII string to an unsigned long integer. */ static unsigned long - _bdf_atoul( char* s ) + _bdf_atoul( const char* s ) { unsigned long v; @@ -717,7 +718,7 @@ /* Routine to convert a decimal ASCII string to a signed long integer. */ static long - _bdf_atol( char* s ) + _bdf_atol( const char* s ) { long v, neg; @@ -750,7 +751,7 @@ /* Routine to convert a decimal ASCII string to an unsigned short integer. */ static unsigned short - _bdf_atous( char* s ) + _bdf_atous( const char* s ) { unsigned short v; @@ -775,7 +776,7 @@ /* Routine to convert a decimal ASCII string to a signed short integer. */ static short - _bdf_atos( char* s ) + _bdf_atos( const char* s ) { short v, neg; @@ -828,7 +829,7 @@ static FT_Error - bdf_create_property( char* name, + bdf_create_property( const char* name, int format, bdf_font_t* font ) { @@ -998,7 +999,7 @@ FT_MEM_COPY( name, font->name, len ); - error = _bdf_list_split( &list, (char *)"-", name, (unsigned long)len ); + error = _bdf_list_split( &list, "-", name, (unsigned long)len ); if ( error ) goto Fail; @@ -1097,7 +1098,7 @@ static FT_Error _bdf_add_property( bdf_font_t* font, - char* name, + const char* name, char* value, unsigned long lineno ) { @@ -1336,7 +1337,7 @@ goto Exit; } - error = _bdf_list_split( &p->list, (char *)" +", line, linelen ); + error = _bdf_list_split( &p->list, " +", line, linelen ); if ( error ) goto Exit; p->cnt = font->glyphs_size = _bdf_atoul( p->list.field[1] ); @@ -1423,7 +1424,7 @@ /* encoding can be checked for an unencoded character. */ FT_FREE( p->glyph_name ); - error = _bdf_list_split( &p->list, (char *)" +", line, linelen ); + error = _bdf_list_split( &p->list, " +", line, linelen ); if ( error ) goto Exit; @@ -1461,7 +1462,7 @@ goto Exit; } - error = _bdf_list_split( &p->list, (char *)" +", line, linelen ); + error = _bdf_list_split( &p->list, " +", line, linelen ); if ( error ) goto Exit; @@ -1615,7 +1616,7 @@ /* Expect the SWIDTH (scalable width) field next. */ if ( _bdf_strncmp( line, "SWIDTH", 6 ) == 0 ) { - error = _bdf_list_split( &p->list, (char *)" +", line, linelen ); + error = _bdf_list_split( &p->list, " +", line, linelen ); if ( error ) goto Exit; @@ -1628,7 +1629,7 @@ /* Expect the DWIDTH (scalable width) field next. */ if ( _bdf_strncmp( line, "DWIDTH", 6 ) == 0 ) { - error = _bdf_list_split( &p->list, (char *)" +", line, linelen ); + error = _bdf_list_split( &p->list, " +", line, linelen ); if ( error ) goto Exit; @@ -1653,7 +1654,7 @@ /* Expect the BBX field next. */ if ( _bdf_strncmp( line, "BBX", 3 ) == 0 ) { - error = _bdf_list_split( &p->list, (char *)" +", line, linelen ); + error = _bdf_list_split( &p->list, " +", line, linelen ); if ( error ) goto Exit; @@ -1796,7 +1797,7 @@ { p->font->font_ascent = p->font->bbx.ascent; ft_sprintf( nbuf, "%hd", p->font->bbx.ascent ); - error = _bdf_add_property( p->font, (char *)"FONT_ASCENT", + error = _bdf_add_property( p->font, "FONT_ASCENT", nbuf, lineno ); if ( error ) goto Exit; @@ -1808,7 +1809,7 @@ { p->font->font_descent = p->font->bbx.descent; ft_sprintf( nbuf, "%hd", p->font->bbx.descent ); - error = _bdf_add_property( p->font, (char *)"FONT_DESCENT", + error = _bdf_add_property( p->font, "FONT_DESCENT", nbuf, lineno ); if ( error ) goto Exit; @@ -1846,7 +1847,7 @@ } else { - error = _bdf_list_split( &p->list, (char *)" +", line, linelen ); + error = _bdf_list_split( &p->list, " +", line, linelen ); if ( error ) goto Exit; name = p->list.field[0]; @@ -1976,7 +1977,7 @@ goto Exit; } - error = _bdf_list_split( &p->list, (char *)" +", line, linelen ); + error = _bdf_list_split( &p->list, " +", line, linelen ); if ( error ) goto Exit; @@ -2015,7 +2016,7 @@ goto Exit; } - error = _bdf_list_split( &p->list, (char *)" +", line, linelen ); + error = _bdf_list_split( &p->list, " +", line, linelen ); if ( error ) goto Exit; @@ -2038,7 +2039,7 @@ /* The next thing to check for is the FONT field. */ if ( _bdf_strncmp( line, "FONT", 4 ) == 0 ) { - error = _bdf_list_split( &p->list, (char *)" +", line, linelen ); + error = _bdf_list_split( &p->list, " +", line, linelen ); if ( error ) goto Exit; _bdf_list_shift( &p->list, 1 ); @@ -2081,7 +2082,7 @@ goto Exit; } - error = _bdf_list_split( &p->list, (char *)" +", line, linelen ); + error = _bdf_list_split( &p->list, " +", line, linelen ); if ( error ) goto Exit; @@ -2136,7 +2137,7 @@ /* for compiling fonts. */ p->font->font_ascent = p->font->bbx.ascent; ft_sprintf( nbuf, "%hd", p->font->bbx.ascent ); - error = _bdf_add_property( p->font, (char *)"FONT_ASCENT", + error = _bdf_add_property( p->font, "FONT_ASCENT", nbuf, lineno ); if ( error ) goto Exit; @@ -2144,7 +2145,7 @@ p->font->font_descent = p->font->bbx.descent; ft_sprintf( nbuf, "%hd", p->font->bbx.descent ); - error = _bdf_add_property( p->font, (char *)"FONT_DESCENT", + error = _bdf_add_property( p->font, "FONT_DESCENT", nbuf, lineno ); if ( error ) goto Exit; diff --git a/thirdparty/freetype/src/cache/rules.mk b/thirdparty/freetype/src/cache/rules.mk index abcb242239..1618d98303 100644 --- a/thirdparty/freetype/src/cache/rules.mk +++ b/thirdparty/freetype/src/cache/rules.mk @@ -15,7 +15,7 @@ # Cache driver directory # -CACHE_DIR := $(SRC_DIR)/cache +CACHE_DIR := $(SRC_DIR)/cache # compilation flags for the driver diff --git a/thirdparty/freetype/src/cff/cffdrivr.c b/thirdparty/freetype/src/cff/cffdrivr.c index bbd5c40329..2324989811 100644 --- a/thirdparty/freetype/src/cff/cffdrivr.c +++ b/thirdparty/freetype/src/cff/cffdrivr.c @@ -381,8 +381,8 @@ static FT_UInt - cff_get_name_index( CFF_Face face, - FT_String* glyph_name ) + cff_get_name_index( CFF_Face face, + const FT_String* glyph_name ) { CFF_Font cff; CFF_Charset charset; diff --git a/thirdparty/freetype/src/cff/cffobjs.c b/thirdparty/freetype/src/cff/cffobjs.c index 1a1030c065..f76245f30b 100644 --- a/thirdparty/freetype/src/cff/cffobjs.c +++ b/thirdparty/freetype/src/cff/cffobjs.c @@ -962,7 +962,7 @@ cffface->style_name = style_name; else /* assume "Regular" style if we don't know better */ - cffface->style_name = cff_strcpy( memory, (char *)"Regular" ); + cffface->style_name = cff_strcpy( memory, "Regular" ); /******************************************************************** * diff --git a/thirdparty/freetype/src/cff/cffparse.c b/thirdparty/freetype/src/cff/cffparse.c index fa806f1a90..008752c3ae 100644 --- a/thirdparty/freetype/src/cff/cffparse.c +++ b/thirdparty/freetype/src/cff/cffparse.c @@ -77,6 +77,23 @@ } +#ifdef CFF_CONFIG_OPTION_OLD_ENGINE + static void + finalize_t2_strings( FT_Memory memory, + void* data, + void* user ) + { + CFF_T2_String t2 = (CFF_T2_String)data; + + + FT_UNUSED( user ); + + memory->free( memory, t2->start ); + memory->free( memory, data ); + } +#endif /* CFF_CONFIG_OPTION_OLD_ENGINE */ + + FT_LOCAL_DEF( void ) cff_parser_done( CFF_Parser parser ) { @@ -84,13 +101,65 @@ FT_FREE( parser->stack ); + +#ifdef CFF_CONFIG_OPTION_OLD_ENGINE + FT_List_Finalize( &parser->t2_strings, + finalize_t2_strings, + memory, + NULL ); +#endif + } + + + /* Assuming `first >= last'. */ + + static FT_Error + cff_parser_within_limits( CFF_Parser parser, + FT_Byte* first, + FT_Byte* last ) + { +#ifndef CFF_CONFIG_OPTION_OLD_ENGINE + + /* Fast path for regular FreeType builds with the "new" engine; */ + /* `first >= parser->start' can be assumed. */ + + FT_UNUSED( first ); + + return last < parser->limit ? FT_Err_Ok : FT_THROW( Invalid_Argument ); + +#else /* CFF_CONFIG_OPTION_OLD_ENGINE */ + + FT_ListNode node; + + + if ( first >= parser->start && + last < parser->limit ) + return FT_Err_Ok; + + node = parser->t2_strings.head; + + while ( node ) + { + CFF_T2_String t2 = (CFF_T2_String)node->data; + + + if ( first >= t2->start && + last < t2->limit ) + return FT_Err_Ok; + + node = node->next; + } + + return FT_THROW( Invalid_Argument ); + +#endif /* CFF_CONFIG_OPTION_OLD_ENGINE */ } /* read an integer */ static FT_Long - cff_parse_integer( FT_Byte* start, - FT_Byte* limit ) + cff_parse_integer( CFF_Parser parser, + FT_Byte* start ) { FT_Byte* p = start; FT_Int v = *p++; @@ -99,14 +168,14 @@ if ( v == 28 ) { - if ( p + 2 > limit ) + if ( cff_parser_within_limits( parser, p, p + 1 ) ) goto Bad; val = (FT_Short)( ( (FT_UShort)p[0] << 8 ) | p[1] ); } else if ( v == 29 ) { - if ( p + 4 > limit ) + if ( cff_parser_within_limits( parser, p, p + 3 ) ) goto Bad; val = (FT_Long)( ( (FT_ULong)p[0] << 24 ) | @@ -120,14 +189,14 @@ } else if ( v < 251 ) { - if ( p + 1 > limit ) + if ( cff_parser_within_limits( parser, p, p ) ) goto Bad; val = ( v - 247 ) * 256 + p[0] + 108; } else { - if ( p + 1 > limit ) + if ( cff_parser_within_limits( parser, p, p ) ) goto Bad; val = -( v - 251 ) * 256 - p[0] - 108; @@ -176,10 +245,10 @@ /* read a real */ static FT_Fixed - cff_parse_real( FT_Byte* start, - FT_Byte* limit, - FT_Long power_ten, - FT_Long* scaling ) + cff_parse_real( CFF_Parser parser, + FT_Byte* start, + FT_Long power_ten, + FT_Long* scaling ) { FT_Byte* p = start; FT_Int nib; @@ -214,7 +283,7 @@ p++; /* Make sure we don't read past the end. */ - if ( p >= limit ) + if ( cff_parser_within_limits( parser, p, p ) ) goto Bad; } @@ -251,7 +320,7 @@ p++; /* Make sure we don't read past the end. */ - if ( p >= limit ) + if ( cff_parser_within_limits( parser, p, p ) ) goto Bad; } @@ -290,7 +359,7 @@ p++; /* Make sure we don't read past the end. */ - if ( p >= limit ) + if ( cff_parser_within_limits( parser, p, p ) ) goto Bad; } @@ -457,7 +526,7 @@ if ( **d == 30 ) { /* binary-coded decimal is truncated to integer */ - return cff_parse_real( *d, parser->limit, 0, NULL ) >> 16; + return cff_parse_real( parser, *d, 0, NULL ) >> 16; } else if ( **d == 255 ) @@ -483,7 +552,7 @@ } else - return cff_parse_integer( *d, parser->limit ); + return cff_parse_integer( parser, *d ); } @@ -494,10 +563,10 @@ FT_Long scaling ) { if ( **d == 30 ) - return cff_parse_real( *d, parser->limit, scaling, NULL ); + return cff_parse_real( parser, *d, scaling, NULL ); else { - FT_Long val = cff_parse_integer( *d, parser->limit ); + FT_Long val = cff_parse_integer( parser, *d ); if ( scaling ) @@ -562,14 +631,14 @@ FT_ASSERT( scaling ); if ( **d == 30 ) - return cff_parse_real( *d, parser->limit, 0, scaling ); + return cff_parse_real( parser, *d, 0, scaling ); else { FT_Long number; FT_Int integer_length; - number = cff_parse_integer( d[0], d[1] ); + number = cff_parse_integer( parser, d[0] ); if ( number > 0x7FFFL ) { @@ -1122,18 +1191,6 @@ #endif /* FT_DEBUG_LEVEL_TRACE */ -#ifdef CFF_CONFIG_OPTION_OLD_ENGINE - static void - destruct_t2s_item( FT_Memory memory, - void* data, - void* user ) - { - FT_UNUSED( user ); - memory->free( memory, data ); - } -#endif /* CFF_CONFIG_OPTION_OLD_ENGINE */ - - FT_LOCAL_DEF( FT_Error ) cff_parser_run( CFF_Parser parser, FT_Byte* start, @@ -1147,11 +1204,6 @@ FT_Library library = parser->library; FT_Memory memory = library->memory; - - FT_ListRec t2s; - - - FT_ZERO( &t2s ); #endif parser->top = parser->stack; @@ -1212,9 +1264,11 @@ FT_Byte* charstring_base; FT_ULong charstring_len; - FT_Fixed* stack; - FT_ListNode node; - FT_Byte* q; + FT_Fixed* stack; + FT_ListNode node; + CFF_T2_String t2; + size_t t2_size; + FT_Byte* q; charstring_base = ++p; @@ -1261,16 +1315,26 @@ if ( !node ) goto Out_Of_Memory_Error; + FT_List_Add( &parser->t2_strings, node ); + + t2 = (CFF_T2_String)memory->alloc( memory, + sizeof ( CFF_T2_StringRec ) ); + if ( !t2 ) + goto Out_Of_Memory_Error; + + node->data = t2; + /* `5' is the conservative upper bound of required bytes per stack */ /* element. */ - q = (FT_Byte*)memory->alloc( memory, - 5 * ( decoder.top - decoder.stack ) ); + + t2_size = 5 * ( decoder.top - decoder.stack ); + + q = (FT_Byte*)memory->alloc( memory, t2_size ); if ( !q ) goto Out_Of_Memory_Error; - node->data = q; - - FT_List_Add( &t2s, node ); + t2->start = q; + t2->limit = q + t2_size; stack = decoder.stack; @@ -1531,9 +1595,6 @@ } /* while ( p < limit ) */ Exit: -#ifdef CFF_CONFIG_OPTION_OLD_ENGINE - FT_List_Finalize( &t2s, destruct_t2s_item, memory, NULL ); -#endif return error; #ifdef CFF_CONFIG_OPTION_OLD_ENGINE diff --git a/thirdparty/freetype/src/cff/cffparse.h b/thirdparty/freetype/src/cff/cffparse.h index bac32f9449..4e74709a2d 100644 --- a/thirdparty/freetype/src/cff/cffparse.h +++ b/thirdparty/freetype/src/cff/cffparse.h @@ -60,6 +60,10 @@ FT_BEGIN_HEADER FT_Byte** top; FT_UInt stackSize; /* allocated size */ +#ifdef CFF_CONFIG_OPTION_OLD_ENGINE + FT_ListRec t2_strings; +#endif /* CFF_CONFIG_OPTION_OLD_ENGINE */ + FT_UInt object_code; void* object; @@ -130,6 +134,15 @@ FT_BEGIN_HEADER FT_END_HEADER +#ifdef CFF_CONFIG_OPTION_OLD_ENGINE + typedef struct CFF_T2_String_ + { + FT_Byte* start; + FT_Byte* limit; + + } CFF_T2_StringRec, *CFF_T2_String; +#endif /* CFF_CONFIG_OPTION_OLD_ENGINE */ + #endif /* CFFPARSE_H_ */ diff --git a/thirdparty/freetype/src/gzip/ftgzip.c b/thirdparty/freetype/src/gzip/ftgzip.c index a5206307f4..5e78bc6f8d 100644 --- a/thirdparty/freetype/src/gzip/ftgzip.c +++ b/thirdparty/freetype/src/gzip/ftgzip.c @@ -746,7 +746,7 @@ stream.zfree = (free_func) ft_gzip_free; stream.opaque = memory; - err = inflateInit2( &stream, MAX_WBITS ); + err = inflateInit2( &stream, MAX_WBITS|32 ); if ( err != Z_OK ) return FT_THROW( Invalid_Argument ); diff --git a/thirdparty/freetype/src/gzip/infblock.c b/thirdparty/freetype/src/gzip/infblock.c index d6e2dc297d..2b4f0c2b53 100644 --- a/thirdparty/freetype/src/gzip/infblock.c +++ b/thirdparty/freetype/src/gzip/infblock.c @@ -235,6 +235,7 @@ int r ) s->sub.trees.index = 0; Tracev((stderr, "inflate: table sizes ok\n")); s->mode = BTREE; + /* fall through */ case BTREE: while (s->sub.trees.index < 4 + (s->sub.trees.table >> 10)) { @@ -260,6 +261,7 @@ int r ) s->sub.trees.index = 0; Tracev((stderr, "inflate: bits tree ok\n")); s->mode = DTREE; + /* fall through */ case DTREE: while (t = s->sub.trees.table, s->sub.trees.index < 258 + (t & 0x1f) + ((t >> 5) & 0x1f)) @@ -335,6 +337,7 @@ int r ) } ZFREE(z, s->sub.trees.blens); s->mode = CODES; + /* fall through */ case CODES: UPDATE if ((r = inflate_codes(s, z, r)) != Z_STREAM_END) @@ -351,11 +354,13 @@ int r ) break; } s->mode = DRY; + /* fall through */ case DRY: FLUSH if (s->read != s->write) LEAVE s->mode = DONE; + /* fall through */ case DONE: r = Z_STREAM_END; LEAVE diff --git a/thirdparty/freetype/src/gzip/infcodes.c b/thirdparty/freetype/src/gzip/infcodes.c index f7bfd58c4f..ba30654990 100644 --- a/thirdparty/freetype/src/gzip/infcodes.c +++ b/thirdparty/freetype/src/gzip/infcodes.c @@ -117,6 +117,7 @@ int r ) c->sub.code.need = c->lbits; c->sub.code.tree = c->ltree; c->mode = LEN; + /* fall through */ case LEN: /* i: get length/literal/eob next */ j = c->sub.code.need; NEEDBITS(j) @@ -164,6 +165,7 @@ int r ) c->sub.code.tree = c->dtree; Tracevv((stderr, "inflate: length %u\n", c->len)); c->mode = DIST; + /* fall through */ case DIST: /* i: get distance next */ j = c->sub.code.need; NEEDBITS(j) @@ -194,6 +196,7 @@ int r ) DUMPBITS(j) Tracevv((stderr, "inflate: distance %u\n", c->sub.copy.dist)); c->mode = COPY; + /* fall through */ case COPY: /* o: copying bytes in window, waiting for space */ f = q - c->sub.copy.dist; while (f < s->window) /* modulo window size-"while" instead */ @@ -225,6 +228,7 @@ int r ) if (s->read != s->write) LEAVE c->mode = END; + /* fall through */ case END: r = Z_STREAM_END; LEAVE diff --git a/thirdparty/freetype/src/gzip/inflate.c b/thirdparty/freetype/src/gzip/inflate.c index 8877fa3eb2..95e2653662 100644 --- a/thirdparty/freetype/src/gzip/inflate.c +++ b/thirdparty/freetype/src/gzip/inflate.c @@ -174,6 +174,7 @@ int f ) break; } z->state->mode = FLAG; + /* fall through */ case FLAG: NEEDBYTE b = NEXTBYTE; @@ -191,18 +192,22 @@ int f ) break; } z->state->mode = DICT4; + /* fall through */ case DICT4: NEEDBYTE z->state->sub.check.need = (uLong)NEXTBYTE << 24; z->state->mode = DICT3; + /* fall through */ case DICT3: NEEDBYTE z->state->sub.check.need += (uLong)NEXTBYTE << 16; z->state->mode = DICT2; + /* fall through */ case DICT2: NEEDBYTE z->state->sub.check.need += (uLong)NEXTBYTE << 8; z->state->mode = DICT1; + /* fall through */ case DICT1: NEEDBYTE z->state->sub.check.need += (uLong)NEXTBYTE; @@ -234,18 +239,22 @@ int f ) break; } z->state->mode = CHECK4; + /* fall through */ case CHECK4: NEEDBYTE z->state->sub.check.need = (uLong)NEXTBYTE << 24; z->state->mode = CHECK3; + /* fall through */ case CHECK3: NEEDBYTE z->state->sub.check.need += (uLong)NEXTBYTE << 16; z->state->mode = CHECK2; + /* fall through */ case CHECK2: NEEDBYTE z->state->sub.check.need += (uLong)NEXTBYTE << 8; z->state->mode = CHECK1; + /* fall through */ case CHECK1: NEEDBYTE z->state->sub.check.need += (uLong)NEXTBYTE; @@ -259,6 +268,7 @@ int f ) } Tracev((stderr, "inflate: zlib check ok\n")); z->state->mode = DONE; + /* fall through */ case DONE: return Z_STREAM_END; case BAD: diff --git a/thirdparty/freetype/src/pcf/pcf.h b/thirdparty/freetype/src/pcf/pcf.h index 529dd3adf8..33be4bcd85 100644 --- a/thirdparty/freetype/src/pcf/pcf.h +++ b/thirdparty/freetype/src/pcf/pcf.h @@ -99,7 +99,8 @@ FT_BEGIN_HEADER FT_Short ascent; FT_Short descent; FT_Short attributes; - FT_ULong bits; + + FT_ULong bits; /* offset into the PCF_BITMAPS table */ } PCF_MetricRec, *PCF_Metric; diff --git a/thirdparty/freetype/src/pcf/pcfdrivr.c b/thirdparty/freetype/src/pcf/pcfdrivr.c index 54bbb9d119..b39592c794 100644 --- a/thirdparty/freetype/src/pcf/pcfdrivr.c +++ b/thirdparty/freetype/src/pcf/pcfdrivr.c @@ -122,9 +122,9 @@ THE SOFTWARE. charcodeCol > enc->lastCol ) return 0; - return (FT_UInt)enc->offset[ ( charcodeRow - enc->firstRow ) * - ( enc->lastCol - enc->firstCol + 1 ) + - charcodeCol - enc->firstCol ]; + return (FT_UInt)enc->offset[( charcodeRow - enc->firstRow ) * + ( enc->lastCol - enc->firstCol + 1 ) + + charcodeCol - enc->firstCol]; } @@ -160,9 +160,9 @@ THE SOFTWARE. charcode = (FT_UInt32)( charcodeRow * 256 + charcodeCol ); - result = (FT_UInt)enc->offset[ ( charcodeRow - enc->firstRow ) * - ( enc->lastCol - enc->firstCol + 1 ) + - charcodeCol - enc->firstCol ]; + result = (FT_UInt)enc->offset[( charcodeRow - enc->firstRow ) * + ( enc->lastCol - enc->firstCol + 1 ) + + charcodeCol - enc->firstCol]; if ( result != 0xFFFFU ) break; } diff --git a/thirdparty/freetype/src/pcf/pcfread.c b/thirdparty/freetype/src/pcf/pcfread.c index 71143ecfb5..2ffe22d71c 100644 --- a/thirdparty/freetype/src/pcf/pcfread.c +++ b/thirdparty/freetype/src/pcf/pcfread.c @@ -743,33 +743,39 @@ THE SOFTWARE. if ( !orig_nmetrics ) return FT_THROW( Invalid_Table ); - /* PCF is a format from ancient times; Unicode was in its */ - /* infancy, and widely used two-byte character sets for CJK */ - /* scripts (Big 5, GB 2312, JIS X 0208, etc.) did have at most */ - /* 15000 characters. Even the more exotic CNS 11643 and CCCII */ - /* standards, which were essentially three-byte character sets, */ - /* provided less then 65536 assigned characters. */ - /* */ - /* While technically possible to have a larger number of glyphs */ - /* in PCF files, we thus limit the number to 65536. */ - if ( orig_nmetrics > 65536 ) + /* + * PCF is a format from ancient times; Unicode was in its infancy, and + * widely used two-byte character sets for CJK scripts (Big 5, GB 2312, + * JIS X 0208, etc.) did have at most 15000 characters. Even the more + * exotic CNS 11643 and CCCII standards, which were essentially + * three-byte character sets, provided less then 65536 assigned + * characters. + * + * While technically possible to have a larger number of glyphs in PCF + * files, we thus limit the number to 65535, taking into account that we + * synthesize the metrics of glyph 0 to be a copy of the `default + * character', and that 0xFFFF in the encodings array indicates a + * missing glyph. + */ + if ( orig_nmetrics > 65534 ) { FT_TRACE0(( "pcf_get_metrics:" - " only loading first 65536 metrics\n" )); - nmetrics = 65536; + " only loading first 65534 metrics\n" )); + nmetrics = 65534; } else nmetrics = orig_nmetrics; - face->nmetrics = nmetrics; + face->nmetrics = nmetrics + 1; - if ( FT_NEW_ARRAY( face->metrics, nmetrics ) ) + if ( FT_NEW_ARRAY( face->metrics, face->nmetrics ) ) return error; - metrics = face->metrics; + /* we handle glyph index 0 later on */ + metrics = face->metrics + 1; FT_TRACE4(( "\n" )); - for ( i = 0; i < nmetrics; i++, metrics++ ) + for ( i = 1; i < face->nmetrics; i++, metrics++ ) { FT_TRACE5(( " idx %ld:", i )); error = pcf_get_metric( stream, format, metrics ); @@ -808,12 +814,10 @@ THE SOFTWARE. pcf_get_bitmaps( FT_Stream stream, PCF_Face face ) { - FT_Error error; - FT_Memory memory = FT_FACE( face )->memory; - FT_ULong* offsets = NULL; - FT_ULong bitmapSizes[GLYPHPADOPTIONS]; - FT_ULong format, size; - FT_ULong nbitmaps, orig_nbitmaps, i, sizebitmaps = 0; + FT_Error error; + FT_ULong bitmapSizes[GLYPHPADOPTIONS]; + FT_ULong format, size, pos; + FT_ULong nbitmaps, orig_nbitmaps, i, sizebitmaps = 0; error = pcf_seek_to_table_type( stream, @@ -859,31 +863,46 @@ THE SOFTWARE. FT_TRACE4(( " number of bitmaps: %ld\n", orig_nbitmaps )); /* see comment in `pcf_get_metrics' */ - if ( orig_nbitmaps > 65536 ) + if ( orig_nbitmaps > 65534 ) { FT_TRACE0(( "pcf_get_bitmaps:" - " only loading first 65536 bitmaps\n" )); - nbitmaps = 65536; + " only loading first 65534 bitmaps\n" )); + nbitmaps = 65534; } else nbitmaps = orig_nbitmaps; - if ( nbitmaps != face->nmetrics ) + /* no extra bitmap for glyph 0 */ + if ( nbitmaps != face->nmetrics - 1 ) return FT_THROW( Invalid_File_Format ); - if ( FT_NEW_ARRAY( offsets, nbitmaps ) ) - return error; + /* start position of bitmap data */ + pos = stream->pos + nbitmaps * 4 + 4 * 4; FT_TRACE5(( "\n" )); - for ( i = 0; i < nbitmaps; i++ ) + for ( i = 1; i <= nbitmaps; i++ ) { + FT_ULong offset; + + if ( PCF_BYTE_ORDER( format ) == MSBFirst ) - (void)FT_READ_ULONG( offsets[i] ); + (void)FT_READ_ULONG( offset ); else - (void)FT_READ_ULONG_LE( offsets[i] ); + (void)FT_READ_ULONG_LE( offset ); FT_TRACE5(( " bitmap %lu: offset %lu (0x%lX)\n", - i, offsets[i], offsets[i] )); + i, offset, offset )); + + /* right now, we only check the offset with a rough estimate; */ + /* actual bitmaps are only loaded on demand */ + if ( offset > size ) + { + FT_TRACE0(( "pcf_get_bitmaps:" + " invalid offset to bitmap data of glyph %lu\n", i )); + face->metrics[i].bits = pos; + } + else + face->metrics[i].bits = pos + offset; } if ( error ) goto Bail; @@ -910,24 +929,9 @@ THE SOFTWARE. FT_UNUSED( sizebitmaps ); /* only used for debugging */ - /* right now, we only check the bitmap offsets; */ - /* actual bitmaps are only loaded on demand */ - for ( i = 0; i < nbitmaps; i++ ) - { - /* rough estimate */ - if ( offsets[i] > size ) - { - FT_TRACE0(( "pcf_get_bitmaps:" - " invalid offset to bitmap data of glyph %lu\n", i )); - } - else - face->metrics[i].bits = stream->pos + offsets[i]; - } - face->bitmapsFormat = format; Bail: - FT_FREE( offsets ); return error; } @@ -1062,41 +1066,52 @@ THE SOFTWARE. defaultCharCol = enc->firstCol; } - /* FreeType mandates that glyph index 0 is the `undefined glyph', */ - /* which PCF calls the `default character'. For this reason, we */ - /* swap the positions of glyph index 0 and the index corresponding */ - /* to `defaultChar' in case they are different. */ - - /* `stream->cursor' still points at the beginning of the frame; */ - /* we can thus easily get the offset to the default character */ + /* + * FreeType mandates that glyph index 0 is the `undefined glyph', which + * PCF calls the `default character'. However, FreeType needs glyph + * index 0 to be used for the undefined glyph only, which is is not the + * case for PCF. For this reason, we add one slot for glyph index 0 and + * simply copy the default character to it. + * + * `stream->cursor' still points to the beginning of the frame; we can + * thus easily get the offset to the default character. + */ pos = stream->cursor + 2 * ( ( defaultCharRow - enc->firstRow ) * - ( enc->lastCol - enc->firstCol + 1 ) + - defaultCharCol - enc->firstCol ); + ( enc->lastCol - enc->firstCol + 1 ) + + defaultCharCol - enc->firstCol ); if ( PCF_BYTE_ORDER( format ) == MSBFirst ) defaultCharEncodingOffset = FT_PEEK_USHORT( pos ); else defaultCharEncodingOffset = FT_PEEK_USHORT_LE( pos ); - if ( defaultCharEncodingOffset >= face->nmetrics ) + if ( defaultCharEncodingOffset == 0xFFFF ) { FT_TRACE0(( "pcf_get_encodings:" - " Invalid glyph index for default character," - " setting to zero\n" )); - defaultCharEncodingOffset = 0; + " No glyph for default character,\n" + " " + " setting it to the first glyph of the font\n" )); + defaultCharEncodingOffset = 1; } - - if ( defaultCharEncodingOffset ) + else { - /* do the swapping */ - PCF_MetricRec tmp = face->metrics[defaultCharEncodingOffset]; - + defaultCharEncodingOffset++; - face->metrics[defaultCharEncodingOffset] = face->metrics[0]; - face->metrics[0] = tmp; + if ( defaultCharEncodingOffset >= face->nmetrics ) + { + FT_TRACE0(( "pcf_get_encodings:" + " Invalid glyph index for default character,\n" + " " + " setting it to the first glyph of the font\n" )); + defaultCharEncodingOffset = 1; + } } + /* copy metrics of default character to index 0 */ + face->metrics[0] = face->metrics[defaultCharEncodingOffset]; + + /* now loop over all values */ offset = enc->offset; for ( i = enc->firstRow; i <= enc->lastRow; i++ ) { @@ -1111,15 +1126,9 @@ THE SOFTWARE. else encodingOffset = FT_GET_USHORT_LE(); - if ( encodingOffset != 0xFFFFU ) - { - if ( encodingOffset == defaultCharEncodingOffset ) - encodingOffset = 0; - else if ( encodingOffset == 0 ) - encodingOffset = defaultCharEncodingOffset; - } - - *offset++ = encodingOffset; + /* everything is off by 1 due to the artificial glyph 0 */ + *offset++ = encodingOffset == 0xFFFF ? 0xFFFF + : encodingOffset + 1; } } FT_Stream_ExitFrame( stream ); @@ -1303,9 +1312,8 @@ THE SOFTWARE. PCF_Property prop; - size_t nn, len; - char* strings[4] = { NULL, NULL, NULL, NULL }; - size_t lengths[4]; + const char* strings[4] = { NULL, NULL, NULL, NULL }; + size_t lengths[4], nn, len; face->style_flags = 0; @@ -1317,8 +1325,8 @@ THE SOFTWARE. { face->style_flags |= FT_STYLE_FLAG_ITALIC; strings[2] = ( *(prop->value.atom) == 'O' || - *(prop->value.atom) == 'o' ) ? (char *)"Oblique" - : (char *)"Italic"; + *(prop->value.atom) == 'o' ) ? "Oblique" + : "Italic"; } prop = pcf_find_property( pcf, "WEIGHT_NAME" ); @@ -1326,20 +1334,20 @@ THE SOFTWARE. ( *(prop->value.atom) == 'B' || *(prop->value.atom) == 'b' ) ) { face->style_flags |= FT_STYLE_FLAG_BOLD; - strings[1] = (char*)"Bold"; + strings[1] = "Bold"; } prop = pcf_find_property( pcf, "SETWIDTH_NAME" ); if ( prop && prop->isString && *(prop->value.atom) && !( *(prop->value.atom) == 'N' || *(prop->value.atom) == 'n' ) ) - strings[3] = (char*)( prop->value.atom ); + strings[3] = (const char*)( prop->value.atom ); prop = pcf_find_property( pcf, "ADD_STYLE_NAME" ); if ( prop && prop->isString && *(prop->value.atom) && !( *(prop->value.atom) == 'N' || *(prop->value.atom) == 'n' ) ) - strings[0] = (char*)( prop->value.atom ); + strings[0] = (const char*)( prop->value.atom ); for ( len = 0, nn = 0; nn < 4; nn++ ) { @@ -1353,7 +1361,7 @@ THE SOFTWARE. if ( len == 0 ) { - strings[0] = (char*)"Regular"; + strings[0] = "Regular"; lengths[0] = ft_strlen( strings[0] ); len = lengths[0] + 1; } @@ -1369,7 +1377,7 @@ THE SOFTWARE. for ( nn = 0; nn < 4; nn++ ) { - char* src = strings[nn]; + const char* src = strings[nn]; len = lengths[nn]; diff --git a/thirdparty/freetype/src/pfr/pfrobjs.c b/thirdparty/freetype/src/pfr/pfrobjs.c index e103a3f6f2..9765f95c2f 100644 --- a/thirdparty/freetype/src/pfr/pfrobjs.c +++ b/thirdparty/freetype/src/pfr/pfrobjs.c @@ -378,7 +378,7 @@ outline->flags &= ~FT_OUTLINE_OWNER; outline->flags |= FT_OUTLINE_REVERSE_FILL; - if ( size && pfrsize->metrics.y_ppem < 24 ) + if ( pfrsize->metrics.y_ppem < 24 ) outline->flags |= FT_OUTLINE_HIGH_PRECISION; /* compute the advance vector */ diff --git a/thirdparty/freetype/src/psaux/afmparse.c b/thirdparty/freetype/src/psaux/afmparse.c index 49225a9f78..f78adbba3d 100644 --- a/thirdparty/freetype/src/psaux/afmparse.c +++ b/thirdparty/freetype/src/psaux/afmparse.c @@ -953,7 +953,8 @@ error = afm_parse_kern_data( parser ); if ( error ) goto Fail; - /* fall through since we only support kern data */ + /* we only support kern data, so ... */ + /* fall through */ case AFM_TOKEN_ENDFONTMETRICS: return FT_Err_Ok; diff --git a/thirdparty/freetype/src/psaux/psfixed.h b/thirdparty/freetype/src/psaux/psfixed.h index fd3460f34a..7dff9ef1bd 100644 --- a/thirdparty/freetype/src/psaux/psfixed.h +++ b/thirdparty/freetype/src/psaux/psfixed.h @@ -72,8 +72,7 @@ FT_BEGIN_HEADER #define cf2_fixedFraction( x ) \ ( (x) - cf2_fixedFloor( x ) ) #define cf2_fracToFixed( x ) \ - ( (x) < 0 ? -( ( -(x) + 0x2000 ) >> 14 ) \ - : ( ( (x) + 0x2000 ) >> 14 ) ) + ( ( (x) + 0x2000 - ( (x) < 0 ) ) >> 14 ) /* signed numeric types */ diff --git a/thirdparty/freetype/src/psaux/psfont.c b/thirdparty/freetype/src/psaux/psfont.c index bb5faa38f5..00e4210819 100644 --- a/thirdparty/freetype/src/psaux/psfont.c +++ b/thirdparty/freetype/src/psaux/psfont.c @@ -274,9 +274,6 @@ if ( !font->isT1 ) { - FT_Service_CFFLoad cffload = (FT_Service_CFFLoad)font->cffload; - - /* check for variation vectors */ vstore = cf2_getVStore( decoder ); hasVariations = ( vstore->dataCount != 0 ); @@ -284,6 +281,9 @@ if ( hasVariations ) { #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT + FT_Service_CFFLoad cffload = (FT_Service_CFFLoad)font->cffload; + + /* check whether Private DICT in this subfont needs to be reparsed */ font->error = cf2_getNormalizedVector( decoder, &lenNormalizedV, diff --git a/thirdparty/freetype/src/psaux/psobjs.c b/thirdparty/freetype/src/psaux/psobjs.c index e2168a3324..8bfdb92332 100644 --- a/thirdparty/freetype/src/psaux/psobjs.c +++ b/thirdparty/freetype/src/psaux/psobjs.c @@ -174,10 +174,10 @@ * reallocation fails. */ FT_LOCAL_DEF( FT_Error ) - ps_table_add( PS_Table table, - FT_Int idx, - void* object, - FT_UInt length ) + ps_table_add( PS_Table table, + FT_Int idx, + const void* object, + FT_UInt length ) { if ( idx < 0 || idx >= table->max_elems ) { diff --git a/thirdparty/freetype/src/psaux/psobjs.h b/thirdparty/freetype/src/psaux/psobjs.h index 9466a1d075..c44dc450ec 100644 --- a/thirdparty/freetype/src/psaux/psobjs.h +++ b/thirdparty/freetype/src/psaux/psobjs.h @@ -53,10 +53,10 @@ FT_BEGIN_HEADER FT_Memory memory ); FT_LOCAL( FT_Error ) - ps_table_add( PS_Table table, - FT_Int idx, - void* object, - FT_UInt length ); + ps_table_add( PS_Table table, + FT_Int idx, + const void* object, + FT_UInt length ); FT_LOCAL( void ) ps_table_done( PS_Table table ); diff --git a/thirdparty/freetype/src/raster/ftraster.c b/thirdparty/freetype/src/raster/ftraster.c index 798a72d02a..023b6c1eff 100644 --- a/thirdparty/freetype/src/raster/ftraster.c +++ b/thirdparty/freetype/src/raster/ftraster.c @@ -399,7 +399,7 @@ #define RAS_ARGS /* void */ -#define RAS_ARG /* void */ +#define RAS_ARG void #define RAS_VARS /* void */ #define RAS_VAR /* void */ @@ -546,8 +546,7 @@ #ifdef FT_STATIC_RASTER - static black_TWorker cur_ras; -#define ras cur_ras + static black_TWorker ras; #else /* !FT_STATIC_RASTER */ @@ -661,7 +660,6 @@ return FAILURE; } - ras.cProfile->flags = 0; ras.cProfile->start = 0; ras.cProfile->height = 0; ras.cProfile->offset = ras.top; @@ -914,16 +912,18 @@ base[4].x = base[2].x; - b = base[1].x; - a = base[3].x = ( base[2].x + b ) / 2; - b = base[1].x = ( base[0].x + b ) / 2; - base[2].x = ( a + b ) / 2; + a = base[0].x + base[1].x; + b = base[1].x + base[2].x; + base[3].x = b >> 1; + base[2].x = ( a + b ) >> 2; + base[1].x = a >> 1; base[4].y = base[2].y; - b = base[1].y; - a = base[3].y = ( base[2].y + b ) / 2; - b = base[1].y = ( base[0].y + b ) / 2; - base[2].y = ( a + b ) / 2; + a = base[0].y + base[1].y; + b = base[1].y + base[2].y; + base[3].y = b >> 1; + base[2].y = ( a + b ) >> 2; + base[1].y = a >> 1; /* hand optimized. gcc doesn't seem to be too good at common */ /* expression substitution and instruction scheduling ;-) */ @@ -947,28 +947,32 @@ static void Split_Cubic( TPoint* base ) { - Long a, b, c, d; + Long a, b, c; base[6].x = base[3].x; - c = base[1].x; - d = base[2].x; - base[1].x = a = ( base[0].x + c + 1 ) >> 1; - base[5].x = b = ( base[3].x + d + 1 ) >> 1; - c = ( c + d + 1 ) >> 1; - base[2].x = a = ( a + c + 1 ) >> 1; - base[4].x = b = ( b + c + 1 ) >> 1; - base[3].x = ( a + b + 1 ) >> 1; + a = base[0].x + base[1].x; + b = base[1].x + base[2].x; + c = base[2].x + base[3].x; + base[5].x = c >> 1; + c += b; + base[4].x = c >> 2; + base[1].x = a >> 1; + a += b; + base[2].x = a >> 2; + base[3].x = ( a + c ) >> 3; base[6].y = base[3].y; - c = base[1].y; - d = base[2].y; - base[1].y = a = ( base[0].y + c + 1 ) >> 1; - base[5].y = b = ( base[3].y + d + 1 ) >> 1; - c = ( c + d + 1 ) >> 1; - base[2].y = a = ( a + c + 1 ) >> 1; - base[4].y = b = ( b + c + 1 ) >> 1; - base[3].y = ( a + b + 1 ) >> 1; + a = base[0].y + base[1].y; + b = base[1].y + base[2].y; + c = base[2].y + base[3].y; + base[5].y = c >> 1; + c += b; + base[4].y = c >> 2; + base[1].y = a >> 1; + a += b; + base[2].y = a >> 2; + base[3].y = ( a + c ) >> 3; } @@ -2784,7 +2788,7 @@ P_Left = draw_left; P_Right = draw_right; - while ( P_Left ) + while ( P_Left && P_Right ) { x1 = P_Left ->X; x2 = P_Right->X; @@ -2885,7 +2889,7 @@ P_Left = draw_left; P_Right = draw_right; - while ( P_Left ) + while ( P_Left && P_Right ) { if ( P_Left->countL ) { @@ -3257,7 +3261,9 @@ const FT_Outline* outline = (const FT_Outline*)params->source; const FT_Bitmap* target_map = params->target; +#ifndef FT_STATIC_RASTER black_TWorker worker[1]; +#endif Long buffer[FT_MAX_BLACK_POOL]; @@ -3299,8 +3305,8 @@ ras.outline = *outline; ras.target = *target_map; - worker->buff = buffer; - worker->sizeBuff = (&buffer)[1]; /* Points to right after buffer. */ + ras.buff = buffer; + ras.sizeBuff = (&buffer)[1]; /* Points to right after buffer. */ return Render_Glyph( RAS_VAR ); } diff --git a/thirdparty/freetype/src/sfnt/rules.mk b/thirdparty/freetype/src/sfnt/rules.mk index ff9e7c6117..ee3314eac3 100644 --- a/thirdparty/freetype/src/sfnt/rules.mk +++ b/thirdparty/freetype/src/sfnt/rules.mk @@ -31,6 +31,7 @@ SFNT_COMPILE := $(CC) $(ANSIFLAGS) \ SFNT_DRV_SRC := $(SFNT_DIR)/pngshim.c \ $(SFNT_DIR)/sfdriver.c \ $(SFNT_DIR)/sfobjs.c \ + $(SFNT_DIR)/sfwoff.c \ $(SFNT_DIR)/ttbdf.c \ $(SFNT_DIR)/ttcmap.c \ $(SFNT_DIR)/ttcolr.c \ diff --git a/thirdparty/freetype/src/sfnt/sfdriver.c b/thirdparty/freetype/src/sfnt/sfdriver.c index c467ff4d37..2611685284 100644 --- a/thirdparty/freetype/src/sfnt/sfdriver.c +++ b/thirdparty/freetype/src/sfnt/sfdriver.c @@ -182,8 +182,8 @@ static FT_UInt - sfnt_get_name_index( FT_Face face, - FT_String* glyph_name ) + sfnt_get_name_index( FT_Face face, + const FT_String* glyph_name ) { TT_Face ttface = (TT_Face)face; @@ -375,47 +375,61 @@ { case 15: k4 ^= (FT_UInt32)tail[14] << 16; + /* fall through */ case 14: k4 ^= (FT_UInt32)tail[13] << 8; + /* fall through */ case 13: k4 ^= (FT_UInt32)tail[12]; k4 *= c4; k4 = ROTL32( k4, 18 ); k4 *= c1; h4 ^= k4; + /* fall through */ case 12: k3 ^= (FT_UInt32)tail[11] << 24; + /* fall through */ case 11: k3 ^= (FT_UInt32)tail[10] << 16; + /* fall through */ case 10: k3 ^= (FT_UInt32)tail[9] << 8; + /* fall through */ case 9: k3 ^= (FT_UInt32)tail[8]; k3 *= c3; k3 = ROTL32( k3, 17 ); k3 *= c4; h3 ^= k3; + /* fall through */ case 8: k2 ^= (FT_UInt32)tail[7] << 24; + /* fall through */ case 7: k2 ^= (FT_UInt32)tail[6] << 16; + /* fall through */ case 6: k2 ^= (FT_UInt32)tail[5] << 8; + /* fall through */ case 5: k2 ^= (FT_UInt32)tail[4]; k2 *= c2; k2 = ROTL32( k2, 16 ); k2 *= c3; h2 ^= k2; + /* fall through */ case 4: k1 ^= (FT_UInt32)tail[3] << 24; + /* fall through */ case 3: k1 ^= (FT_UInt32)tail[2] << 16; + /* fall through */ case 2: k1 ^= (FT_UInt32)tail[1] << 8; + /* fall through */ case 1: k1 ^= (FT_UInt32)tail[0]; k1 *= c1; diff --git a/thirdparty/freetype/src/sfnt/sfnt.c b/thirdparty/freetype/src/sfnt/sfnt.c index 5a503f30c5..b4faf34a3a 100644 --- a/thirdparty/freetype/src/sfnt/sfnt.c +++ b/thirdparty/freetype/src/sfnt/sfnt.c @@ -22,6 +22,7 @@ #include "pngshim.c" #include "sfdriver.c" #include "sfobjs.c" +#include "sfwoff.c" #include "ttbdf.c" #include "ttcmap.c" #include "ttcolr.c" diff --git a/thirdparty/freetype/src/sfnt/sfobjs.c b/thirdparty/freetype/src/sfnt/sfobjs.c index 0b43d251b8..6edf3ae1de 100644 --- a/thirdparty/freetype/src/sfnt/sfobjs.c +++ b/thirdparty/freetype/src/sfnt/sfobjs.c @@ -21,13 +21,13 @@ #include "ttload.h" #include "ttcmap.h" #include "ttkern.h" +#include "sfwoff.h" #include FT_INTERNAL_SFNT_H #include FT_INTERNAL_DEBUG_H #include FT_TRUETYPE_IDS_H #include FT_TRUETYPE_TAGS_H #include FT_SERVICE_POSTSCRIPT_CMAPS_H #include FT_SFNT_NAMES_H -#include FT_GZIP_H #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT #include FT_SERVICE_MULTIPLE_MASTERS_H @@ -337,403 +337,6 @@ } -#define WRITE_USHORT( p, v ) \ - do \ - { \ - *(p)++ = (FT_Byte)( (v) >> 8 ); \ - *(p)++ = (FT_Byte)( (v) >> 0 ); \ - \ - } while ( 0 ) - -#define WRITE_ULONG( p, v ) \ - do \ - { \ - *(p)++ = (FT_Byte)( (v) >> 24 ); \ - *(p)++ = (FT_Byte)( (v) >> 16 ); \ - *(p)++ = (FT_Byte)( (v) >> 8 ); \ - *(p)++ = (FT_Byte)( (v) >> 0 ); \ - \ - } while ( 0 ) - - - static void - sfnt_stream_close( FT_Stream stream ) - { - FT_Memory memory = stream->memory; - - - FT_FREE( stream->base ); - - stream->size = 0; - stream->base = NULL; - stream->close = NULL; - } - - - FT_CALLBACK_DEF( int ) - compare_offsets( const void* a, - const void* b ) - { - WOFF_Table table1 = *(WOFF_Table*)a; - WOFF_Table table2 = *(WOFF_Table*)b; - - FT_ULong offset1 = table1->Offset; - FT_ULong offset2 = table2->Offset; - - - if ( offset1 > offset2 ) - return 1; - else if ( offset1 < offset2 ) - return -1; - else - return 0; - } - - - /* Replace `face->root.stream' with a stream containing the extracted */ - /* SFNT of a WOFF font. */ - - static FT_Error - woff_open_font( FT_Stream stream, - TT_Face face ) - { - FT_Memory memory = stream->memory; - FT_Error error = FT_Err_Ok; - - WOFF_HeaderRec woff; - WOFF_Table tables = NULL; - WOFF_Table* indices = NULL; - - FT_ULong woff_offset; - - FT_Byte* sfnt = NULL; - FT_Stream sfnt_stream = NULL; - - FT_Byte* sfnt_header; - FT_ULong sfnt_offset; - - FT_Int nn; - FT_ULong old_tag = 0; - - static const FT_Frame_Field woff_header_fields[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE WOFF_HeaderRec - - FT_FRAME_START( 44 ), - FT_FRAME_ULONG ( signature ), - FT_FRAME_ULONG ( flavor ), - FT_FRAME_ULONG ( length ), - FT_FRAME_USHORT( num_tables ), - FT_FRAME_USHORT( reserved ), - FT_FRAME_ULONG ( totalSfntSize ), - FT_FRAME_USHORT( majorVersion ), - FT_FRAME_USHORT( minorVersion ), - FT_FRAME_ULONG ( metaOffset ), - FT_FRAME_ULONG ( metaLength ), - FT_FRAME_ULONG ( metaOrigLength ), - FT_FRAME_ULONG ( privOffset ), - FT_FRAME_ULONG ( privLength ), - FT_FRAME_END - }; - - - FT_ASSERT( stream == face->root.stream ); - FT_ASSERT( FT_STREAM_POS() == 0 ); - - if ( FT_STREAM_READ_FIELDS( woff_header_fields, &woff ) ) - return error; - - /* Make sure we don't recurse back here or hit TTC code. */ - if ( woff.flavor == TTAG_wOFF || woff.flavor == TTAG_ttcf ) - return FT_THROW( Invalid_Table ); - - /* Miscellaneous checks. */ - if ( woff.length != stream->size || - woff.num_tables == 0 || - 44 + woff.num_tables * 20UL >= woff.length || - 12 + woff.num_tables * 16UL >= woff.totalSfntSize || - ( woff.totalSfntSize & 3 ) != 0 || - ( woff.metaOffset == 0 && ( woff.metaLength != 0 || - woff.metaOrigLength != 0 ) ) || - ( woff.metaLength != 0 && woff.metaOrigLength == 0 ) || - ( woff.privOffset == 0 && woff.privLength != 0 ) ) - { - FT_ERROR(( "woff_font_open: invalid WOFF header\n" )); - return FT_THROW( Invalid_Table ); - } - - /* Don't trust `totalSfntSize' before thorough checks. */ - if ( FT_ALLOC( sfnt, 12 + woff.num_tables * 16UL ) || - FT_NEW( sfnt_stream ) ) - goto Exit; - - sfnt_header = sfnt; - - /* Write sfnt header. */ - { - FT_UInt searchRange, entrySelector, rangeShift, x; - - - x = woff.num_tables; - entrySelector = 0; - while ( x ) - { - x >>= 1; - entrySelector += 1; - } - entrySelector--; - - searchRange = ( 1 << entrySelector ) * 16; - rangeShift = woff.num_tables * 16 - searchRange; - - WRITE_ULONG ( sfnt_header, woff.flavor ); - WRITE_USHORT( sfnt_header, woff.num_tables ); - WRITE_USHORT( sfnt_header, searchRange ); - WRITE_USHORT( sfnt_header, entrySelector ); - WRITE_USHORT( sfnt_header, rangeShift ); - } - - /* While the entries in the sfnt header must be sorted by the */ - /* tag value, the tables themselves are not. We thus have to */ - /* sort them by offset and check that they don't overlap. */ - - if ( FT_NEW_ARRAY( tables, woff.num_tables ) || - FT_NEW_ARRAY( indices, woff.num_tables ) ) - goto Exit; - - FT_TRACE2(( "\n" - " tag offset compLen origLen checksum\n" - " -------------------------------------------\n" )); - - if ( FT_FRAME_ENTER( 20L * woff.num_tables ) ) - goto Exit; - - for ( nn = 0; nn < woff.num_tables; nn++ ) - { - WOFF_Table table = tables + nn; - - table->Tag = FT_GET_TAG4(); - table->Offset = FT_GET_ULONG(); - table->CompLength = FT_GET_ULONG(); - table->OrigLength = FT_GET_ULONG(); - table->CheckSum = FT_GET_ULONG(); - - FT_TRACE2(( " %c%c%c%c %08lx %08lx %08lx %08lx\n", - (FT_Char)( table->Tag >> 24 ), - (FT_Char)( table->Tag >> 16 ), - (FT_Char)( table->Tag >> 8 ), - (FT_Char)( table->Tag ), - table->Offset, - table->CompLength, - table->OrigLength, - table->CheckSum )); - - if ( table->Tag <= old_tag ) - { - FT_FRAME_EXIT(); - - FT_ERROR(( "woff_font_open: table tags are not sorted\n" )); - error = FT_THROW( Invalid_Table ); - goto Exit; - } - - old_tag = table->Tag; - indices[nn] = table; - } - - FT_FRAME_EXIT(); - - /* Sort by offset. */ - - ft_qsort( indices, - woff.num_tables, - sizeof ( WOFF_Table ), - compare_offsets ); - - /* Check offsets and lengths. */ - - woff_offset = 44 + woff.num_tables * 20L; - sfnt_offset = 12 + woff.num_tables * 16L; - - for ( nn = 0; nn < woff.num_tables; nn++ ) - { - WOFF_Table table = indices[nn]; - - - if ( table->Offset != woff_offset || - table->CompLength > woff.length || - table->Offset > woff.length - table->CompLength || - table->OrigLength > woff.totalSfntSize || - sfnt_offset > woff.totalSfntSize - table->OrigLength || - table->CompLength > table->OrigLength ) - { - FT_ERROR(( "woff_font_open: invalid table offsets\n" )); - error = FT_THROW( Invalid_Table ); - goto Exit; - } - - table->OrigOffset = sfnt_offset; - - /* The offsets must be multiples of 4. */ - woff_offset += ( table->CompLength + 3 ) & ~3U; - sfnt_offset += ( table->OrigLength + 3 ) & ~3U; - } - - /* - * Final checks! - * - * We don't decode and check the metadata block. - * We don't check table checksums either. - * But other than those, I think we implement all - * `MUST' checks from the spec. - */ - - if ( woff.metaOffset ) - { - if ( woff.metaOffset != woff_offset || - woff.metaOffset + woff.metaLength > woff.length ) - { - FT_ERROR(( "woff_font_open:" - " invalid `metadata' offset or length\n" )); - error = FT_THROW( Invalid_Table ); - goto Exit; - } - - /* We have padding only ... */ - woff_offset += woff.metaLength; - } - - if ( woff.privOffset ) - { - /* ... if it isn't the last block. */ - woff_offset = ( woff_offset + 3 ) & ~3U; - - if ( woff.privOffset != woff_offset || - woff.privOffset + woff.privLength > woff.length ) - { - FT_ERROR(( "woff_font_open: invalid `private' offset or length\n" )); - error = FT_THROW( Invalid_Table ); - goto Exit; - } - - /* No padding for the last block. */ - woff_offset += woff.privLength; - } - - if ( sfnt_offset != woff.totalSfntSize || - woff_offset != woff.length ) - { - FT_ERROR(( "woff_font_open: invalid `sfnt' table structure\n" )); - error = FT_THROW( Invalid_Table ); - goto Exit; - } - - /* Now use `totalSfntSize'. */ - if ( FT_REALLOC( sfnt, - 12 + woff.num_tables * 16UL, - woff.totalSfntSize ) ) - goto Exit; - - sfnt_header = sfnt + 12; - - /* Write the tables. */ - - for ( nn = 0; nn < woff.num_tables; nn++ ) - { - WOFF_Table table = tables + nn; - - - /* Write SFNT table entry. */ - WRITE_ULONG( sfnt_header, table->Tag ); - WRITE_ULONG( sfnt_header, table->CheckSum ); - WRITE_ULONG( sfnt_header, table->OrigOffset ); - WRITE_ULONG( sfnt_header, table->OrigLength ); - - /* Write table data. */ - if ( FT_STREAM_SEEK( table->Offset ) || - FT_FRAME_ENTER( table->CompLength ) ) - goto Exit; - - if ( table->CompLength == table->OrigLength ) - { - /* Uncompressed data; just copy. */ - ft_memcpy( sfnt + table->OrigOffset, - stream->cursor, - table->OrigLength ); - } - else - { -#ifdef FT_CONFIG_OPTION_USE_ZLIB - - /* Uncompress with zlib. */ - FT_ULong output_len = table->OrigLength; - - - error = FT_Gzip_Uncompress( memory, - sfnt + table->OrigOffset, &output_len, - stream->cursor, table->CompLength ); - if ( error ) - goto Exit; - if ( output_len != table->OrigLength ) - { - FT_ERROR(( "woff_font_open: compressed table length mismatch\n" )); - error = FT_THROW( Invalid_Table ); - goto Exit; - } - -#else /* !FT_CONFIG_OPTION_USE_ZLIB */ - - error = FT_THROW( Unimplemented_Feature ); - goto Exit; - -#endif /* !FT_CONFIG_OPTION_USE_ZLIB */ - } - - FT_FRAME_EXIT(); - - /* We don't check whether the padding bytes in the WOFF file are */ - /* actually '\0'. For the output, however, we do set them properly. */ - sfnt_offset = table->OrigOffset + table->OrigLength; - while ( sfnt_offset & 3 ) - { - sfnt[sfnt_offset] = '\0'; - sfnt_offset++; - } - } - - /* Ok! Finally ready. Swap out stream and return. */ - FT_Stream_OpenMemory( sfnt_stream, sfnt, woff.totalSfntSize ); - sfnt_stream->memory = stream->memory; - sfnt_stream->close = sfnt_stream_close; - - FT_Stream_Free( - face->root.stream, - ( face->root.face_flags & FT_FACE_FLAG_EXTERNAL_STREAM ) != 0 ); - - face->root.stream = sfnt_stream; - - face->root.face_flags &= ~FT_FACE_FLAG_EXTERNAL_STREAM; - - Exit: - FT_FREE( tables ); - FT_FREE( indices ); - - if ( error ) - { - FT_FREE( sfnt ); - FT_Stream_Close( sfnt_stream ); - FT_FREE( sfnt_stream ); - } - - return error; - } - - -#undef WRITE_USHORT -#undef WRITE_ULONG - - /* Fill in face->ttc_header. If the font is not a TTC, it is */ /* synthesized into a TTC with one offset table. */ static FT_Error diff --git a/thirdparty/freetype/src/sfnt/sfobjs.h b/thirdparty/freetype/src/sfnt/sfobjs.h index 17b0d50105..3fbf2dd6bd 100644 --- a/thirdparty/freetype/src/sfnt/sfobjs.h +++ b/thirdparty/freetype/src/sfnt/sfobjs.h @@ -53,7 +53,7 @@ FT_BEGIN_HEADER FT_END_HEADER -#endif /* SFDRIVER_H_ */ +#endif /* SFOBJS_H_ */ /* END */ diff --git a/thirdparty/freetype/src/sfnt/sfwoff.c b/thirdparty/freetype/src/sfnt/sfwoff.c new file mode 100644 index 0000000000..ca4821a20a --- /dev/null +++ b/thirdparty/freetype/src/sfnt/sfwoff.c @@ -0,0 +1,434 @@ +/**************************************************************************** + * + * sfwoff.c + * + * WOFF format management (base). + * + * Copyright (C) 1996-2019 by + * David Turner, Robert Wilhelm, and Werner Lemberg. + * + * This file is part of the FreeType project, and may only be used, + * modified, and distributed under the terms of the FreeType project + * license, LICENSE.TXT. By continuing to use, modify, or distribute + * this file you indicate that you have read the license and + * understand and accept it fully. + * + */ + + +#include <ft2build.h> +#include "sfwoff.h" +#include FT_TRUETYPE_TAGS_H +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_STREAM_H +#include FT_GZIP_H + + + /************************************************************************** + * + * The macro FT_COMPONENT is used in trace mode. It is an implicit + * parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log + * messages during execution. + */ +#undef FT_COMPONENT +#define FT_COMPONENT sfwoff + + +#define WRITE_USHORT( p, v ) \ + do \ + { \ + *(p)++ = (FT_Byte)( (v) >> 8 ); \ + *(p)++ = (FT_Byte)( (v) >> 0 ); \ + \ + } while ( 0 ) + +#define WRITE_ULONG( p, v ) \ + do \ + { \ + *(p)++ = (FT_Byte)( (v) >> 24 ); \ + *(p)++ = (FT_Byte)( (v) >> 16 ); \ + *(p)++ = (FT_Byte)( (v) >> 8 ); \ + *(p)++ = (FT_Byte)( (v) >> 0 ); \ + \ + } while ( 0 ) + + + static void + sfnt_stream_close( FT_Stream stream ) + { + FT_Memory memory = stream->memory; + + + FT_FREE( stream->base ); + + stream->size = 0; + stream->base = NULL; + stream->close = NULL; + } + + + FT_CALLBACK_DEF( int ) + compare_offsets( const void* a, + const void* b ) + { + WOFF_Table table1 = *(WOFF_Table*)a; + WOFF_Table table2 = *(WOFF_Table*)b; + + FT_ULong offset1 = table1->Offset; + FT_ULong offset2 = table2->Offset; + + + if ( offset1 > offset2 ) + return 1; + else if ( offset1 < offset2 ) + return -1; + else + return 0; + } + + + /* Replace `face->root.stream' with a stream containing the extracted */ + /* SFNT of a WOFF font. */ + + FT_LOCAL_DEF( FT_Error ) + woff_open_font( FT_Stream stream, + TT_Face face ) + { + FT_Memory memory = stream->memory; + FT_Error error = FT_Err_Ok; + + WOFF_HeaderRec woff; + WOFF_Table tables = NULL; + WOFF_Table* indices = NULL; + + FT_ULong woff_offset; + + FT_Byte* sfnt = NULL; + FT_Stream sfnt_stream = NULL; + + FT_Byte* sfnt_header; + FT_ULong sfnt_offset; + + FT_Int nn; + FT_ULong old_tag = 0; + + static const FT_Frame_Field woff_header_fields[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE WOFF_HeaderRec + + FT_FRAME_START( 44 ), + FT_FRAME_ULONG ( signature ), + FT_FRAME_ULONG ( flavor ), + FT_FRAME_ULONG ( length ), + FT_FRAME_USHORT( num_tables ), + FT_FRAME_USHORT( reserved ), + FT_FRAME_ULONG ( totalSfntSize ), + FT_FRAME_USHORT( majorVersion ), + FT_FRAME_USHORT( minorVersion ), + FT_FRAME_ULONG ( metaOffset ), + FT_FRAME_ULONG ( metaLength ), + FT_FRAME_ULONG ( metaOrigLength ), + FT_FRAME_ULONG ( privOffset ), + FT_FRAME_ULONG ( privLength ), + FT_FRAME_END + }; + + + FT_ASSERT( stream == face->root.stream ); + FT_ASSERT( FT_STREAM_POS() == 0 ); + + if ( FT_STREAM_READ_FIELDS( woff_header_fields, &woff ) ) + return error; + + /* Make sure we don't recurse back here or hit TTC code. */ + if ( woff.flavor == TTAG_wOFF || woff.flavor == TTAG_ttcf ) + return FT_THROW( Invalid_Table ); + + /* Miscellaneous checks. */ + if ( woff.length != stream->size || + woff.num_tables == 0 || + 44 + woff.num_tables * 20UL >= woff.length || + 12 + woff.num_tables * 16UL >= woff.totalSfntSize || + ( woff.totalSfntSize & 3 ) != 0 || + ( woff.metaOffset == 0 && ( woff.metaLength != 0 || + woff.metaOrigLength != 0 ) ) || + ( woff.metaLength != 0 && woff.metaOrigLength == 0 ) || + ( woff.privOffset == 0 && woff.privLength != 0 ) ) + { + FT_ERROR(( "woff_font_open: invalid WOFF header\n" )); + return FT_THROW( Invalid_Table ); + } + + /* Don't trust `totalSfntSize' before thorough checks. */ + if ( FT_ALLOC( sfnt, 12 + woff.num_tables * 16UL ) || + FT_NEW( sfnt_stream ) ) + goto Exit; + + sfnt_header = sfnt; + + /* Write sfnt header. */ + { + FT_UInt searchRange, entrySelector, rangeShift, x; + + + x = woff.num_tables; + entrySelector = 0; + while ( x ) + { + x >>= 1; + entrySelector += 1; + } + entrySelector--; + + searchRange = ( 1 << entrySelector ) * 16; + rangeShift = woff.num_tables * 16 - searchRange; + + WRITE_ULONG ( sfnt_header, woff.flavor ); + WRITE_USHORT( sfnt_header, woff.num_tables ); + WRITE_USHORT( sfnt_header, searchRange ); + WRITE_USHORT( sfnt_header, entrySelector ); + WRITE_USHORT( sfnt_header, rangeShift ); + } + + /* While the entries in the sfnt header must be sorted by the */ + /* tag value, the tables themselves are not. We thus have to */ + /* sort them by offset and check that they don't overlap. */ + + if ( FT_NEW_ARRAY( tables, woff.num_tables ) || + FT_NEW_ARRAY( indices, woff.num_tables ) ) + goto Exit; + + FT_TRACE2(( "\n" + " tag offset compLen origLen checksum\n" + " -------------------------------------------\n" )); + + if ( FT_FRAME_ENTER( 20L * woff.num_tables ) ) + goto Exit; + + for ( nn = 0; nn < woff.num_tables; nn++ ) + { + WOFF_Table table = tables + nn; + + table->Tag = FT_GET_TAG4(); + table->Offset = FT_GET_ULONG(); + table->CompLength = FT_GET_ULONG(); + table->OrigLength = FT_GET_ULONG(); + table->CheckSum = FT_GET_ULONG(); + + FT_TRACE2(( " %c%c%c%c %08lx %08lx %08lx %08lx\n", + (FT_Char)( table->Tag >> 24 ), + (FT_Char)( table->Tag >> 16 ), + (FT_Char)( table->Tag >> 8 ), + (FT_Char)( table->Tag ), + table->Offset, + table->CompLength, + table->OrigLength, + table->CheckSum )); + + if ( table->Tag <= old_tag ) + { + FT_FRAME_EXIT(); + + FT_ERROR(( "woff_font_open: table tags are not sorted\n" )); + error = FT_THROW( Invalid_Table ); + goto Exit; + } + + old_tag = table->Tag; + indices[nn] = table; + } + + FT_FRAME_EXIT(); + + /* Sort by offset. */ + + ft_qsort( indices, + woff.num_tables, + sizeof ( WOFF_Table ), + compare_offsets ); + + /* Check offsets and lengths. */ + + woff_offset = 44 + woff.num_tables * 20L; + sfnt_offset = 12 + woff.num_tables * 16L; + + for ( nn = 0; nn < woff.num_tables; nn++ ) + { + WOFF_Table table = indices[nn]; + + + if ( table->Offset != woff_offset || + table->CompLength > woff.length || + table->Offset > woff.length - table->CompLength || + table->OrigLength > woff.totalSfntSize || + sfnt_offset > woff.totalSfntSize - table->OrigLength || + table->CompLength > table->OrigLength ) + { + FT_ERROR(( "woff_font_open: invalid table offsets\n" )); + error = FT_THROW( Invalid_Table ); + goto Exit; + } + + table->OrigOffset = sfnt_offset; + + /* The offsets must be multiples of 4. */ + woff_offset += ( table->CompLength + 3 ) & ~3U; + sfnt_offset += ( table->OrigLength + 3 ) & ~3U; + } + + /* + * Final checks! + * + * We don't decode and check the metadata block. + * We don't check table checksums either. + * But other than those, I think we implement all + * `MUST' checks from the spec. + */ + + if ( woff.metaOffset ) + { + if ( woff.metaOffset != woff_offset || + woff.metaOffset + woff.metaLength > woff.length ) + { + FT_ERROR(( "woff_font_open:" + " invalid `metadata' offset or length\n" )); + error = FT_THROW( Invalid_Table ); + goto Exit; + } + + /* We have padding only ... */ + woff_offset += woff.metaLength; + } + + if ( woff.privOffset ) + { + /* ... if it isn't the last block. */ + woff_offset = ( woff_offset + 3 ) & ~3U; + + if ( woff.privOffset != woff_offset || + woff.privOffset + woff.privLength > woff.length ) + { + FT_ERROR(( "woff_font_open: invalid `private' offset or length\n" )); + error = FT_THROW( Invalid_Table ); + goto Exit; + } + + /* No padding for the last block. */ + woff_offset += woff.privLength; + } + + if ( sfnt_offset != woff.totalSfntSize || + woff_offset != woff.length ) + { + FT_ERROR(( "woff_font_open: invalid `sfnt' table structure\n" )); + error = FT_THROW( Invalid_Table ); + goto Exit; + } + + /* Now use `totalSfntSize'. */ + if ( FT_REALLOC( sfnt, + 12 + woff.num_tables * 16UL, + woff.totalSfntSize ) ) + goto Exit; + + sfnt_header = sfnt + 12; + + /* Write the tables. */ + + for ( nn = 0; nn < woff.num_tables; nn++ ) + { + WOFF_Table table = tables + nn; + + + /* Write SFNT table entry. */ + WRITE_ULONG( sfnt_header, table->Tag ); + WRITE_ULONG( sfnt_header, table->CheckSum ); + WRITE_ULONG( sfnt_header, table->OrigOffset ); + WRITE_ULONG( sfnt_header, table->OrigLength ); + + /* Write table data. */ + if ( FT_STREAM_SEEK( table->Offset ) || + FT_FRAME_ENTER( table->CompLength ) ) + goto Exit; + + if ( table->CompLength == table->OrigLength ) + { + /* Uncompressed data; just copy. */ + ft_memcpy( sfnt + table->OrigOffset, + stream->cursor, + table->OrigLength ); + } + else + { +#ifdef FT_CONFIG_OPTION_USE_ZLIB + + /* Uncompress with zlib. */ + FT_ULong output_len = table->OrigLength; + + + error = FT_Gzip_Uncompress( memory, + sfnt + table->OrigOffset, &output_len, + stream->cursor, table->CompLength ); + if ( error ) + goto Exit; + if ( output_len != table->OrigLength ) + { + FT_ERROR(( "woff_font_open: compressed table length mismatch\n" )); + error = FT_THROW( Invalid_Table ); + goto Exit; + } + +#else /* !FT_CONFIG_OPTION_USE_ZLIB */ + + error = FT_THROW( Unimplemented_Feature ); + goto Exit; + +#endif /* !FT_CONFIG_OPTION_USE_ZLIB */ + } + + FT_FRAME_EXIT(); + + /* We don't check whether the padding bytes in the WOFF file are */ + /* actually '\0'. For the output, however, we do set them properly. */ + sfnt_offset = table->OrigOffset + table->OrigLength; + while ( sfnt_offset & 3 ) + { + sfnt[sfnt_offset] = '\0'; + sfnt_offset++; + } + } + + /* Ok! Finally ready. Swap out stream and return. */ + FT_Stream_OpenMemory( sfnt_stream, sfnt, woff.totalSfntSize ); + sfnt_stream->memory = stream->memory; + sfnt_stream->close = sfnt_stream_close; + + FT_Stream_Free( + face->root.stream, + ( face->root.face_flags & FT_FACE_FLAG_EXTERNAL_STREAM ) != 0 ); + + face->root.stream = sfnt_stream; + + face->root.face_flags &= ~FT_FACE_FLAG_EXTERNAL_STREAM; + + Exit: + FT_FREE( tables ); + FT_FREE( indices ); + + if ( error ) + { + FT_FREE( sfnt ); + FT_Stream_Close( sfnt_stream ); + FT_FREE( sfnt_stream ); + } + + return error; + } + + +#undef WRITE_USHORT +#undef WRITE_ULONG + + +/* END */ diff --git a/thirdparty/freetype/src/sfnt/sfwoff.h b/thirdparty/freetype/src/sfnt/sfwoff.h new file mode 100644 index 0000000000..15495c32a2 --- /dev/null +++ b/thirdparty/freetype/src/sfnt/sfwoff.h @@ -0,0 +1,41 @@ +/**************************************************************************** + * + * sfwoff.h + * + * WOFFF format management (specification). + * + * Copyright (C) 1996-2019 by + * David Turner, Robert Wilhelm, and Werner Lemberg. + * + * This file is part of the FreeType project, and may only be used, + * modified, and distributed under the terms of the FreeType project + * license, LICENSE.TXT. By continuing to use, modify, or distribute + * this file you indicate that you have read the license and + * understand and accept it fully. + * + */ + + +#ifndef SFWOFF_H_ +#define SFWOFF_H_ + + +#include <ft2build.h> +#include FT_INTERNAL_SFNT_H +#include FT_INTERNAL_OBJECTS_H + + +FT_BEGIN_HEADER + + + FT_LOCAL( FT_Error ) + woff_open_font( FT_Stream stream, + TT_Face face ); + + +FT_END_HEADER + +#endif /* SFWOFF_H_ */ + + +/* END */ diff --git a/thirdparty/freetype/src/sfnt/ttcmap.c b/thirdparty/freetype/src/sfnt/ttcmap.c index 8d9737310c..683f3b1818 100644 --- a/thirdparty/freetype/src/sfnt/ttcmap.c +++ b/thirdparty/freetype/src/sfnt/ttcmap.c @@ -2368,10 +2368,7 @@ /* if `gindex' is invalid, the remaining values */ /* in this group are invalid, too */ if ( gindex >= (FT_UInt)face->num_glyphs ) - { - gindex = 0; continue; - } cmap->cur_charcode = char_code; cmap->cur_gindex = gindex; @@ -3661,7 +3658,7 @@ tt_get_glyph_name( TT_Face face, FT_UInt idx ) { - FT_String* PSname; + FT_String* PSname = NULL; tt_face_get_ps_name( face, idx, &PSname ); diff --git a/thirdparty/freetype/src/sfnt/ttmtx.c b/thirdparty/freetype/src/sfnt/ttmtx.c index 7a4d2be2cb..b6725c962f 100644 --- a/thirdparty/freetype/src/sfnt/ttmtx.c +++ b/thirdparty/freetype/src/sfnt/ttmtx.c @@ -280,7 +280,7 @@ else { table_pos += 4 * ( k - 1 ); - if ( table_pos + 4 > table_end ) + if ( table_pos + 2 > table_end ) goto NoData; if ( FT_STREAM_SEEK( table_pos ) || @@ -292,7 +292,9 @@ *abearing = 0; else { - if ( !FT_STREAM_SEEK( table_pos ) ) + if ( FT_STREAM_SEEK( table_pos ) ) + *abearing = 0; + else (void)FT_READ_SHORT( *abearing ); } } diff --git a/thirdparty/freetype/src/smooth/ftgrays.c b/thirdparty/freetype/src/smooth/ftgrays.c index 91293ac946..fd357a50fc 100644 --- a/thirdparty/freetype/src/smooth/ftgrays.c +++ b/thirdparty/freetype/src/smooth/ftgrays.c @@ -45,7 +45,7 @@ * This is a new anti-aliasing scan-converter for FreeType 2. The * algorithm used here is _very_ different from the one in the standard * `ftraster' module. Actually, `ftgrays' computes the _exact_ - * coverage of the outline on each pixel cell. + * coverage of the outline on each pixel cell by straight segments. * * It is based on ideas that I initially found in Raph Levien's * excellent LibArt graphics library (see https://www.levien.com/libart @@ -58,6 +58,14 @@ * different way, and I don't use sorted vector paths. Also, it doesn't * use floating point values. * + * Bézier segments are flattened by splitting them until their deviation + * from straight line becomes much smaller than a pixel. Therefore, the + * pixel coverage by a Bézier curve is calculated approximately. To + * estimate the deviation, we use the distance from the control point + * to the conic chord centre or the cubic chord trisection. These + * distances vanish fast after each split. In the conic case, they vanish + * predictably and the number of necessary splits can be calculated. + * * This renderer has the following advantages: * * - It doesn't need an intermediate bitmap. Instead, one can supply a @@ -67,7 +75,7 @@ * callback. * * - A perfect anti-aliaser, i.e., it computes the _exact_ coverage on - * each pixel cell. + * each pixel cell by straight segments. * * - It performs a single pass on the outline (the `standard' FT2 * renderer makes two passes). @@ -75,7 +83,7 @@ * - It can easily be modified to render to _any_ number of gray levels * cheaply. * - * - For small (< 20) pixel sizes, it is faster than the standard + * - For small (< 80) pixel sizes, it is faster than the standard * renderer. * */ @@ -327,17 +335,9 @@ typedef ptrdiff_t FT_PtrDist; /* must be at least 6 bits! */ #define PIXEL_BITS 8 -#undef FLOOR -#undef CEILING -#undef TRUNC -#undef SCALED - #define ONE_PIXEL ( 1 << PIXEL_BITS ) -#define TRUNC( x ) ( (TCoord)( (x) >> PIXEL_BITS ) ) -#define SUBPIXELS( x ) ( (TPos)(x) * ONE_PIXEL ) -#define FLOOR( x ) ( (x) & -ONE_PIXEL ) -#define CEILING( x ) ( ( (x) + ONE_PIXEL - 1 ) & -ONE_PIXEL ) -#define ROUND( x ) ( ( (x) + ONE_PIXEL / 2 ) & -ONE_PIXEL ) +#define TRUNC( x ) (TCoord)( (x) >> PIXEL_BITS ) +#define FRACT( x ) (TCoord)( (x) & ( ONE_PIXEL - 1 ) ) #if PIXEL_BITS >= 6 #define UPSCALE( x ) ( (x) * ( ONE_PIXEL >> 6 ) ) @@ -388,9 +388,9 @@ typedef ptrdiff_t FT_PtrDist; #define FT_UDIVPREP( c, b ) \ long b ## _r = c ? (long)( FT_ULONG_MAX >> PIXEL_BITS ) / ( b ) \ : 0 -#define FT_UDIV( a, b ) \ - ( ( (unsigned long)( a ) * (unsigned long)( b ## _r ) ) >> \ - ( sizeof( long ) * FT_CHAR_BIT - PIXEL_BITS ) ) +#define FT_UDIV( a, b ) \ + (TCoord)( ( (unsigned long)( a ) * (unsigned long)( b ## _r ) ) >> \ + ( sizeof( long ) * FT_CHAR_BIT - PIXEL_BITS ) ) /************************************************************************** @@ -432,6 +432,9 @@ typedef ptrdiff_t FT_PtrDist; #define FT_MAX_GRAY_POOL ( 2048 / sizeof ( TCell ) ) #endif + /* FT_Span buffer size for direct rendering only */ +#define FT_MAX_GRAY_SPANS 10 + #if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */ /* We disable the warning `structure was padded due to */ @@ -465,6 +468,8 @@ typedef ptrdiff_t FT_PtrDist; FT_Raster_Span_Func render_span; void* render_span_data; + FT_Span spans[FT_MAX_GRAY_SPANS]; + int num_spans; } gray_TWorker, *gray_PWorker; @@ -516,7 +521,7 @@ typedef ptrdiff_t FT_PtrDist; /************************************************************************** * - * Record the current cell in the table. + * Record the current cell in the linked list. */ static void gray_record_cell( RAS_ARG ) @@ -526,10 +531,9 @@ typedef ptrdiff_t FT_PtrDist; pcell = &ras.ycells[ras.ey - ras.min_ey]; - for (;;) + while ( ( cell = *pcell ) ) { - cell = *pcell; - if ( !cell || cell->x > x ) + if ( cell->x > x ) break; if ( cell->x == x ) @@ -577,16 +581,13 @@ typedef ptrdiff_t FT_PtrDist; /* Note that if a cell is to the left of the clipping region, it is */ /* actually set to the (min_ex-1) horizontal position. */ - if ( ex < ras.min_ex ) - ex = ras.min_ex - 1; - /* record the current one if it is valid and substantial */ if ( !ras.invalid && ( ras.area || ras.cover ) ) gray_record_cell( RAS_VAR ); ras.area = 0; ras.cover = 0; - ras.ex = ex; + ras.ex = FT_MAX( ex, ras.min_ex - 1 ); ras.ey = ey; ras.invalid = ( ey >= ras.max_ey || ey < ras.min_ey || @@ -622,8 +623,8 @@ typedef ptrdiff_t FT_PtrDist; return; } - fx1 = (TCoord)( x1 - SUBPIXELS( ex1 ) ); - fx2 = (TCoord)( x2 - SUBPIXELS( ex2 ) ); + fx1 = FRACT( x1 ); + fx2 = FRACT( x2 ); /* everything is located in a single cell. That is easy! */ /* */ @@ -650,6 +651,9 @@ typedef ptrdiff_t FT_PtrDist; dx = -dx; } + /* the fractional part of y-delta is mod/dx. It is essential to */ + /* keep track of its accumulation for accurate rendering. */ + /* XXX: y-delta and x-delta below should be related. */ FT_DIV_MOD( TCoord, p, dx, delta, mod ); ras.area += (TArea)( ( fx1 + first ) * delta ); @@ -715,8 +719,8 @@ typedef ptrdiff_t FT_PtrDist; ( ey1 < ras.min_ey && ey2 < ras.min_ey ) ) goto End; - fy1 = (TCoord)( ras.y - SUBPIXELS( ey1 ) ); - fy2 = (TCoord)( to_y - SUBPIXELS( ey2 ) ); + fy1 = FRACT( ras.y ); + fy2 = FRACT( to_y ); /* everything is on a single scanline */ if ( ey1 == ey2 ) @@ -732,7 +736,7 @@ typedef ptrdiff_t FT_PtrDist; if ( dx == 0 ) { TCoord ex = TRUNC( ras.x ); - TCoord two_fx = (TCoord)( ( ras.x - SUBPIXELS( ex ) ) << 1 ); + TCoord two_fx = FRACT( ras.x ) << 1; TArea area; @@ -787,6 +791,8 @@ typedef ptrdiff_t FT_PtrDist; dy = -dy; } + /* the fractional part of x-delta is mod/dy. It is essential to */ + /* keep track of its accumulation for accurate rendering. */ FT_DIV_MOD( TCoord, p, dy, delta, mod ); x = ras.x + delta; @@ -843,8 +849,9 @@ typedef ptrdiff_t FT_PtrDist; gray_render_line( RAS_ARG_ TPos to_x, TPos to_y ) { - TPos dx, dy, fx1, fy1, fx2, fy2; - TCoord ex1, ex2, ey1, ey2; + TPos dx, dy; + TCoord fx1, fy1, fx2, fy2; + TCoord ex1, ey1, ex2, ey2; ey1 = TRUNC( ras.y ); @@ -858,8 +865,8 @@ typedef ptrdiff_t FT_PtrDist; ex1 = TRUNC( ras.x ); ex2 = TRUNC( to_x ); - fx1 = ras.x - SUBPIXELS( ex1 ); - fy1 = ras.y - SUBPIXELS( ey1 ); + fx1 = FRACT( ras.x ); + fy1 = FRACT( ras.y ); dx = to_x - ras.x; dy = to_y - ras.y; @@ -868,8 +875,8 @@ typedef ptrdiff_t FT_PtrDist; ; else if ( dy == 0 ) /* ex1 != ex2 */ /* any horizontal line */ { - ex1 = ex2; - gray_set_cell( RAS_VAR_ ex1, ey1 ); + gray_set_cell( RAS_VAR_ ex2, ey2 ); + goto End; } else if ( dx == 0 ) { @@ -896,7 +903,7 @@ typedef ptrdiff_t FT_PtrDist; } else /* any other line */ { - TPos prod = dx * fy1 - dy * fx1; + TPos prod = dx * (TPos)fy1 - dy * (TPos)fx1; FT_UDIVPREP( ex1 != ex2, dx ); FT_UDIVPREP( ey1 != ey2, dy ); @@ -910,7 +917,7 @@ typedef ptrdiff_t FT_PtrDist; prod - dx * ONE_PIXEL > 0 ) /* left */ { fx2 = 0; - fy2 = (TPos)FT_UDIV( -prod, -dx ); + fy2 = FT_UDIV( -prod, -dx ); prod -= dy * ONE_PIXEL; ras.cover += ( fy2 - fy1 ); ras.area += ( fy2 - fy1 ) * ( fx1 + fx2 ); @@ -922,7 +929,7 @@ typedef ptrdiff_t FT_PtrDist; prod - dx * ONE_PIXEL + dy * ONE_PIXEL > 0 ) /* up */ { prod -= dx * ONE_PIXEL; - fx2 = (TPos)FT_UDIV( -prod, dy ); + fx2 = FT_UDIV( -prod, dy ); fy2 = ONE_PIXEL; ras.cover += ( fy2 - fy1 ); ras.area += ( fy2 - fy1 ) * ( fx1 + fx2 ); @@ -935,7 +942,7 @@ typedef ptrdiff_t FT_PtrDist; { prod += dy * ONE_PIXEL; fx2 = ONE_PIXEL; - fy2 = (TPos)FT_UDIV( prod, dx ); + fy2 = FT_UDIV( prod, dx ); ras.cover += ( fy2 - fy1 ); ras.area += ( fy2 - fy1 ) * ( fx1 + fx2 ); fx1 = 0; @@ -945,7 +952,7 @@ typedef ptrdiff_t FT_PtrDist; else /* ( prod + dy * ONE_PIXEL < 0 && prod > 0 ) down */ { - fx2 = (TPos)FT_UDIV( prod, -dy ); + fx2 = FT_UDIV( prod, -dy ); fy2 = 0; prod += dx * ONE_PIXEL; ras.cover += ( fy2 - fy1 ); @@ -959,8 +966,8 @@ typedef ptrdiff_t FT_PtrDist; } while ( ex1 != ex2 || ey1 != ey2 ); } - fx2 = to_x - SUBPIXELS( ex2 ); - fy2 = to_y - SUBPIXELS( ey2 ); + fx2 = FRACT( to_x ); + fy2 = FRACT( to_y ); ras.cover += ( fy2 - fy1 ); ras.area += ( fy2 - fy1 ) * ( fx1 + fx2 ); @@ -979,16 +986,18 @@ typedef ptrdiff_t FT_PtrDist; base[4].x = base[2].x; - b = base[1].x; - a = base[3].x = ( base[2].x + b ) / 2; - b = base[1].x = ( base[0].x + b ) / 2; - base[2].x = ( a + b ) / 2; + a = base[0].x + base[1].x; + b = base[1].x + base[2].x; + base[3].x = b >> 1; + base[2].x = ( a + b ) >> 2; + base[1].x = a >> 1; base[4].y = base[2].y; - b = base[1].y; - a = base[3].y = ( base[2].y + b ) / 2; - b = base[1].y = ( base[0].y + b ) / 2; - base[2].y = ( a + b ) / 2; + a = base[0].y + base[1].y; + b = base[1].y + base[2].y; + base[3].y = b >> 1; + base[2].y = ( a + b ) >> 2; + base[1].y = a >> 1; } @@ -1042,12 +1051,11 @@ typedef ptrdiff_t FT_PtrDist; /* many times as there are trailing zeros in the counter. */ do { - split = 1; - while ( ( draw & split ) == 0 ) + split = draw & ( -draw ); /* isolate the rightmost 1-bit */ + while ( ( split >>= 1 ) ) { gray_split_conic( arc ); arc += 2; - split <<= 1; } gray_render_line( RAS_VAR_ arc[0].x, arc[0].y ); @@ -1060,28 +1068,32 @@ typedef ptrdiff_t FT_PtrDist; static void gray_split_cubic( FT_Vector* base ) { - TPos a, b, c, d; + TPos a, b, c; base[6].x = base[3].x; - c = base[1].x; - d = base[2].x; - base[1].x = a = ( base[0].x + c ) / 2; - base[5].x = b = ( base[3].x + d ) / 2; - c = ( c + d ) / 2; - base[2].x = a = ( a + c ) / 2; - base[4].x = b = ( b + c ) / 2; - base[3].x = ( a + b ) / 2; + a = base[0].x + base[1].x; + b = base[1].x + base[2].x; + c = base[2].x + base[3].x; + base[5].x = c >> 1; + c += b; + base[4].x = c >> 2; + base[1].x = a >> 1; + a += b; + base[2].x = a >> 2; + base[3].x = ( a + c ) >> 3; base[6].y = base[3].y; - c = base[1].y; - d = base[2].y; - base[1].y = a = ( base[0].y + c ) / 2; - base[5].y = b = ( base[3].y + d ) / 2; - c = ( c + d ) / 2; - base[2].y = a = ( a + c ) / 2; - base[4].y = b = ( b + c ) / 2; - base[3].y = ( a + b ) / 2; + a = base[0].y + base[1].y; + b = base[1].y + base[2].y; + c = base[2].y + base[3].y; + base[5].y = c >> 1; + c += b; + base[4].y = c >> 2; + base[1].y = a >> 1; + a += b; + base[2].y = a >> 2; + base[3].y = ( a + c ) >> 3; } @@ -1092,9 +1104,6 @@ typedef ptrdiff_t FT_PtrDist; { FT_Vector bez_stack[16 * 3 + 1]; /* enough to accommodate bisections */ FT_Vector* arc = bez_stack; - TPos dx, dy, dx_, dy_; - TPos dx1, dy1, dx2, dy2; - TPos L, s, s_limit; arc[0].x = UPSCALE( to->x ); @@ -1123,45 +1132,13 @@ typedef ptrdiff_t FT_PtrDist; for (;;) { - /* Decide whether to split or draw. See `Rapid Termination */ - /* Evaluation for Recursive Subdivision of Bezier Curves' by Thomas */ - /* F. Hain, at */ - /* http://www.cis.southalabama.edu/~hain/general/Publications/Bezier/Camera-ready%20CISST02%202.pdf */ - - /* dx and dy are x and y components of the P0-P3 chord vector. */ - dx = dx_ = arc[3].x - arc[0].x; - dy = dy_ = arc[3].y - arc[0].y; - - L = FT_HYPOT( dx_, dy_ ); - - /* Avoid possible arithmetic overflow below by splitting. */ - if ( L > 32767 ) - goto Split; - - /* Max deviation may be as much as (s/L) * 3/4 (if Hain's v = 1). */ - s_limit = L * (TPos)( ONE_PIXEL / 6 ); - - /* s is L * the perpendicular distance from P1 to the line P0-P3. */ - dx1 = arc[1].x - arc[0].x; - dy1 = arc[1].y - arc[0].y; - s = FT_ABS( SUB_LONG( MUL_LONG( dy, dx1 ), MUL_LONG( dx, dy1 ) ) ); - - if ( s > s_limit ) - goto Split; - - /* s is L * the perpendicular distance from P2 to the line P0-P3. */ - dx2 = arc[2].x - arc[0].x; - dy2 = arc[2].y - arc[0].y; - s = FT_ABS( SUB_LONG( MUL_LONG( dy, dx2 ), MUL_LONG( dx, dy2 ) ) ); - - if ( s > s_limit ) - goto Split; - - /* Split super curvy segments where the off points are so far - from the chord that the angles P0-P1-P3 or P0-P2-P3 become - acute as detected by appropriate dot products. */ - if ( dx1 * ( dx1 - dx ) + dy1 * ( dy1 - dy ) > 0 || - dx2 * ( dx2 - dx ) + dy2 * ( dy2 - dy ) > 0 ) + /* with each split, control points quickly converge towards */ + /* chord trisection points and the vanishing distances below */ + /* indicate when the segment is flat enough to draw */ + if ( FT_ABS( 2 * arc[0].x - 3 * arc[1].x + arc[3].x ) > ONE_PIXEL / 2 || + FT_ABS( 2 * arc[0].y - 3 * arc[1].y + arc[3].y ) > ONE_PIXEL / 2 || + FT_ABS( arc[0].x - 3 * arc[2].x + 2 * arc[3].x ) > ONE_PIXEL / 2 || + FT_ABS( arc[0].y - 3 * arc[2].y + 2 * arc[3].y ) > ONE_PIXEL / 2 ) goto Split; gray_render_line( RAS_VAR_ arc[0].x, arc[0].y ); @@ -1236,8 +1213,6 @@ typedef ptrdiff_t FT_PtrDist; { /* scale the coverage from 0..(ONE_PIXEL*ONE_PIXEL*2) to 0..256 */ coverage >>= PIXEL_BITS * 2 + 1 - 8; - if ( coverage < 0 ) - coverage = -coverage - 1; /* compute the line's coverage depending on the outline fill rule */ if ( ras.outline.flags & FT_OUTLINE_EVEN_ODD_FILL ) @@ -1247,23 +1222,30 @@ typedef ptrdiff_t FT_PtrDist; if ( coverage >= 256 ) coverage = 511 - coverage; } - else + else /* default non-zero winding rule */ { - /* normal non-zero winding rule */ + if ( coverage < 0 ) + coverage = ~coverage; /* the same as -coverage - 1 */ + if ( coverage >= 256 ) coverage = 255; } - if ( ras.render_span ) /* for FT_RASTER_FLAG_DIRECT only */ + if ( ras.num_spans >= 0 ) /* for FT_RASTER_FLAG_DIRECT only */ { - FT_Span span; + FT_Span* span = ras.spans + ras.num_spans++; - span.x = (short)x; - span.len = (unsigned short)acount; - span.coverage = (unsigned char)coverage; + span->x = (short)x; + span->len = (unsigned short)acount; + span->coverage = (unsigned char)coverage; - ras.render_span( y, 1, &span, ras.render_span_data ); + if ( ras.num_spans == FT_MAX_GRAY_SPANS ) + { + /* flush the span buffer and reset the count */ + ras.render_span( y, ras.num_spans, ras.spans, ras.render_span_data ); + ras.num_spans = 0; + } } else { @@ -1277,14 +1259,29 @@ typedef ptrdiff_t FT_PtrDist; */ switch ( acount ) { - case 7: *q++ = c; - case 6: *q++ = c; - case 5: *q++ = c; - case 4: *q++ = c; - case 3: *q++ = c; - case 2: *q++ = c; - case 1: *q = c; - case 0: break; + case 7: + *q++ = c; + /* fall through */ + case 6: + *q++ = c; + /* fall through */ + case 5: + *q++ = c; + /* fall through */ + case 4: + *q++ = c; + /* fall through */ + case 3: + *q++ = c; + /* fall through */ + case 2: + *q++ = c; + /* fall through */ + case 1: + *q = c; + /* fall through */ + case 0: + break; default: FT_MEM_SET( q, c, acount ); } @@ -1322,6 +1319,13 @@ typedef ptrdiff_t FT_PtrDist; if ( cover != 0 ) gray_hline( RAS_VAR_ x, y, cover, ras.max_ex - x ); + + if ( ras.num_spans > 0 ) /* for FT_RASTER_FLAG_DIRECT only */ + { + /* flush the span buffer and reset the count */ + ras.render_span( y, ras.num_spans, ras.spans, ras.render_span_data ); + ras.num_spans = 0; + } } } @@ -1371,7 +1375,7 @@ typedef ptrdiff_t FT_PtrDist; void* user ) { #undef SCALED -#define SCALED( x ) ( ( (x) << shift ) - delta ) +#define SCALED( x ) ( (x) * ( 1L << shift ) - delta ) FT_Vector v_last; FT_Vector v_control; @@ -1631,7 +1635,7 @@ typedef ptrdiff_t FT_PtrDist; gray_convert_glyph_inner( RAS_ARG, int continued ) { - volatile int error = 0; + int error; if ( ft_setjmp( ras.jump_buffer ) == 0 ) @@ -1755,7 +1759,6 @@ typedef ptrdiff_t FT_PtrDist; { const FT_Outline* outline = (const FT_Outline*)params->source; const FT_Bitmap* target_map = params->target; - FT_BBox clip; #ifndef FT_STATIC_RASTER gray_TWorker worker[1]; @@ -1792,6 +1795,12 @@ typedef ptrdiff_t FT_PtrDist; ras.render_span = (FT_Raster_Span_Func)params->gray_spans; ras.render_span_data = params->user; + ras.num_spans = 0; + + ras.min_ex = params->clip_box.xMin; + ras.min_ey = params->clip_box.yMin; + ras.max_ex = params->clip_box.xMax; + ras.max_ey = params->clip_box.yMax; } else { @@ -1816,27 +1825,15 @@ typedef ptrdiff_t FT_PtrDist; ras.render_span = (FT_Raster_Span_Func)NULL; ras.render_span_data = NULL; - } + ras.num_spans = -1; /* invalid */ - /* compute clipping box */ - if ( params->flags & FT_RASTER_FLAG_DIRECT && - params->flags & FT_RASTER_FLAG_CLIP ) - clip = params->clip_box; - else - { - /* compute clip box from target pixmap */ - clip.xMin = 0; - clip.yMin = 0; - clip.xMax = (FT_Pos)target_map->width; - clip.yMax = (FT_Pos)target_map->rows; + ras.min_ex = 0; + ras.min_ey = 0; + ras.max_ex = (FT_Pos)target_map->width; + ras.max_ey = (FT_Pos)target_map->rows; } - /* clip to target bitmap, exit if nothing to do */ - ras.min_ex = clip.xMin; - ras.min_ey = clip.yMin; - ras.max_ex = clip.xMax; - ras.max_ey = clip.yMax; - + /* exit if nothing to do */ if ( ras.max_ex <= ras.min_ex || ras.max_ey <= ras.min_ey ) return 0; diff --git a/thirdparty/freetype/src/smooth/ftsmooth.c b/thirdparty/freetype/src/smooth/ftsmooth.c index c8b6bb7518..cd034d2b40 100644 --- a/thirdparty/freetype/src/smooth/ftsmooth.c +++ b/thirdparty/freetype/src/smooth/ftsmooth.c @@ -243,7 +243,7 @@ } if ( lcd_filter_func ) - lcd_filter_func( bitmap, mode, lcd_weights ); + lcd_filter_func( bitmap, lcd_weights ); } #else /* !FT_CONFIG_OPTION_SUBPIXEL_RENDERING */ diff --git a/thirdparty/freetype/src/truetype/ttgload.c b/thirdparty/freetype/src/truetype/ttgload.c index cbee27aa69..a04684086b 100644 --- a/thirdparty/freetype/src/truetype/ttgload.c +++ b/thirdparty/freetype/src/truetype/ttgload.c @@ -82,6 +82,15 @@ #define UNSCALED_COMPONENT_OFFSET 0x1000 +#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT +#define IS_DEFAULT_INSTANCE( _face ) \ + ( !( FT_IS_NAMED_INSTANCE( _face ) || \ + FT_IS_VARIATION( _face ) ) ) +#else +#define IS_DEFAULT_INSTANCE( _face ) 1 +#endif + + /************************************************************************** * * Return the horizontal metrics in font units for a given glyph. @@ -927,6 +936,11 @@ FT_Outline* outline; FT_Int n_points; +#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT + FT_Memory memory = loader->face->root.memory; + FT_Vector* unrounded = NULL; +#endif + outline = &gloader->current.outline; n_points = outline->n_points; @@ -947,26 +961,32 @@ #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT - if ( FT_IS_NAMED_INSTANCE( FT_FACE( loader->face ) ) || - FT_IS_VARIATION( FT_FACE( loader->face ) ) ) + if ( !IS_DEFAULT_INSTANCE( FT_FACE( loader->face ) ) ) { + if ( FT_NEW_ARRAY( unrounded, n_points ) ) + goto Exit; + /* Deltas apply to the unscaled data. */ error = TT_Vary_Apply_Glyph_Deltas( loader->face, loader->glyph_index, outline, + unrounded, (FT_UInt)n_points ); /* recalculate linear horizontal and vertical advances */ /* if we don't have HVAR and VVAR, respectively */ + + /* XXX: change all FreeType modules to store `linear' and `vadvance' */ + /* in 26.6 format before the `base' module scales them to 16.16 */ if ( !( loader->face->variation_support & TT_FACE_FLAG_VAR_HADVANCE ) ) - loader->linear = outline->points[n_points - 3].x - - outline->points[n_points - 4].x; + loader->linear = FT_PIX_ROUND( unrounded[n_points - 3].x - + unrounded[n_points - 4].x ) / 64; if ( !( loader->face->variation_support & TT_FACE_FLAG_VAR_VADVANCE ) ) - loader->vadvance = outline->points[n_points - 1].x - - outline->points[n_points - 2].x; + loader->vadvance = FT_PIX_ROUND( unrounded[n_points - 1].x - + unrounded[n_points - 2].x ) / 64; if ( error ) - return error; + goto Exit; } #endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */ @@ -1021,10 +1041,23 @@ /* compensate for any scaling by de/emboldening; */ /* the amount was determined via experimentation */ if ( x_scale_factor != 1000 && ppem > 11 ) + { +#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT + FT_Vector* orig_points = outline->points; + + + if ( !IS_DEFAULT_INSTANCE( FT_FACE( loader->face ) ) ) + outline->points = unrounded; +#endif FT_Outline_EmboldenXY( outline, FT_MulFix( 1280 * ppem, 1000 - x_scale_factor ), 0 ); +#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT + if ( !IS_DEFAULT_INSTANCE( FT_FACE( loader->face ) ) ) + outline->points = orig_points; +#endif + } do_scale = TRUE; } } @@ -1045,10 +1078,26 @@ if ( do_scale ) { - for ( ; vec < limit; vec++ ) +#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT + if ( !IS_DEFAULT_INSTANCE( FT_FACE( loader->face ) ) ) { - vec->x = FT_MulFix( vec->x, x_scale ); - vec->y = FT_MulFix( vec->y, y_scale ); + FT_Vector* u = unrounded; + + + for ( ; vec < limit; vec++, u++ ) + { + vec->x = ( FT_MulFix( u->x, x_scale ) + 32 ) >> 6; + vec->y = ( FT_MulFix( u->y, y_scale ) + 32 ) >> 6; + } + } + else +#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */ + { + for ( ; vec < limit; vec++ ) + { + vec->x = FT_MulFix( vec->x, x_scale ); + vec->y = FT_MulFix( vec->y, y_scale ); + } } } @@ -1080,6 +1129,11 @@ error = TT_Hint_Glyph( loader, 0 ); } +#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT + Exit: + FT_FREE( unrounded ); +#endif + return error; } @@ -1681,6 +1735,9 @@ short contours[4] = { 0, 1, 2, 3 }; FT_Outline outline; + /* unrounded values */ + FT_Vector unrounded[4] = { {0, 0}, {0, 0}, {0, 0}, {0, 0} }; + points[0].x = loader->pp1.x; points[0].y = loader->pp1.y; @@ -1702,6 +1759,7 @@ error = TT_Vary_Apply_Glyph_Deltas( loader->face, glyph_index, &outline, + unrounded, (FT_UInt)outline.n_points ); if ( error ) goto Exit; @@ -1719,9 +1777,11 @@ /* recalculate linear horizontal and vertical advances */ /* if we don't have HVAR and VVAR, respectively */ if ( !( loader->face->variation_support & TT_FACE_FLAG_VAR_HADVANCE ) ) - loader->linear = loader->pp2.x - loader->pp1.x; + loader->linear = FT_PIX_ROUND( unrounded[1].x - + unrounded[0].x ) / 64; if ( !( loader->face->variation_support & TT_FACE_FLAG_VAR_VADVANCE ) ) - loader->vadvance = loader->pp4.x - loader->pp3.x; + loader->vadvance = FT_PIX_ROUND( unrounded[3].x - + unrounded[2].x ) / 64; } #endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */ @@ -1861,9 +1921,10 @@ FT_SubGlyph subglyph; FT_Outline outline; - FT_Vector* points = NULL; - char* tags = NULL; - short* contours = NULL; + FT_Vector* points = NULL; + char* tags = NULL; + short* contours = NULL; + FT_Vector* unrounded = NULL; limit = (short)gloader->current.num_subglyphs; @@ -1877,9 +1938,10 @@ outline.tags = NULL; outline.contours = NULL; - if ( FT_NEW_ARRAY( points, outline.n_points ) || - FT_NEW_ARRAY( tags, outline.n_points ) || - FT_NEW_ARRAY( contours, outline.n_points ) ) + if ( FT_NEW_ARRAY( points, outline.n_points ) || + FT_NEW_ARRAY( tags, outline.n_points ) || + FT_NEW_ARRAY( contours, outline.n_points ) || + FT_NEW_ARRAY( unrounded, outline.n_points ) ) goto Exit1; subglyph = gloader->current.subglyphs; @@ -1928,6 +1990,7 @@ face, glyph_index, &outline, + unrounded, (FT_UInt)outline.n_points ) ) ) goto Exit1; @@ -1955,14 +2018,19 @@ /* recalculate linear horizontal and vertical advances */ /* if we don't have HVAR and VVAR, respectively */ if ( !( face->variation_support & TT_FACE_FLAG_VAR_HADVANCE ) ) - loader->linear = loader->pp2.x - loader->pp1.x; + loader->linear = + FT_PIX_ROUND( unrounded[outline.n_points - 3].x - + unrounded[outline.n_points - 4].x ) / 64; if ( !( face->variation_support & TT_FACE_FLAG_VAR_VADVANCE ) ) - loader->vadvance = loader->pp4.x - loader->pp3.x; + loader->vadvance = + FT_PIX_ROUND( unrounded[outline.n_points - 1].x - + unrounded[outline.n_points - 2].x ) / 64; Exit1: FT_FREE( outline.points ); FT_FREE( outline.tags ); FT_FREE( outline.contours ); + FT_FREE( unrounded ); if ( error ) goto Exit; @@ -2088,6 +2156,7 @@ loader->ins_pos = ins_pos; if ( IS_HINTED( loader->load_flags ) && #ifdef TT_USE_BYTECODE_INTERPRETER + subglyph && subglyph->flags & WE_HAVE_INSTR && #endif num_points > start_point ) @@ -2611,11 +2680,6 @@ if ( reexecute ) { - FT_UInt i; - - - for ( i = 0; i < size->cvt_size; i++ ) - size->cvt[i] = FT_MulFix( face->cvt[i], size->ttmetrics.scale ); error = tt_size_run_prep( size, pedantic ); if ( error ) return error; @@ -2718,13 +2782,6 @@ FT_Error error; TT_LoaderRec loader; -#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT -#define IS_DEFAULT_INSTANCE ( !( FT_IS_NAMED_INSTANCE( glyph->face ) || \ - FT_IS_VARIATION( glyph->face ) ) ) -#else -#define IS_DEFAULT_INSTANCE 1 -#endif - FT_TRACE1(( "TT_Load_Glyph: glyph index %d\n", glyph_index )); @@ -2733,7 +2790,7 @@ /* try to load embedded bitmap (if any) */ if ( size->strike_index != 0xFFFFFFFFUL && ( load_flags & FT_LOAD_NO_BITMAP ) == 0 && - IS_DEFAULT_INSTANCE ) + IS_DEFAULT_INSTANCE( glyph->face ) ) { FT_Fixed x_scale = size->root.metrics.x_scale; FT_Fixed y_scale = size->root.metrics.y_scale; diff --git a/thirdparty/freetype/src/truetype/ttgxvar.c b/thirdparty/freetype/src/truetype/ttgxvar.c index 020918f533..78d87dc097 100644 --- a/thirdparty/freetype/src/truetype/ttgxvar.c +++ b/thirdparty/freetype/src/truetype/ttgxvar.c @@ -68,12 +68,16 @@ /* some macros we need */ -#define FT_fdot14ToFixed( x ) \ - ( (FT_Fixed)( (FT_ULong)(x) << 2 ) ) -#define FT_intToFixed( i ) \ - ( (FT_Fixed)( (FT_ULong)(i) << 16 ) ) -#define FT_fixedToInt( x ) \ - ( (FT_Short)( ( (FT_UInt32)(x) + 0x8000U ) >> 16 ) ) +#define FT_fdot14ToFixed( x ) \ + ( (FT_Fixed)( (FT_ULong)(x) << 2 ) ) +#define FT_intToFixed( i ) \ + ( (FT_Fixed)( (FT_ULong)(i) << 16 ) ) +#define FT_fdot6ToFixed( i ) \ + ( (FT_Fixed)( (FT_ULong)(i) << 10 ) ) +#define FT_fixedToInt( x ) \ + ( (FT_Short)( ( (x) + 0x8000U ) >> 16 ) ) +#define FT_fixedToFdot6( x ) \ + ( (FT_Pos)( ( (x) + 0x200 ) >> 10 ) ) /************************************************************************** @@ -397,9 +401,10 @@ for ( j = 0; j < segment->pairCount; j++ ) { - /* convert to Fixed */ - segment->correspondence[j].fromCoord = FT_GET_SHORT() * 4; - segment->correspondence[j].toCoord = FT_GET_SHORT() * 4; + segment->correspondence[j].fromCoord = + FT_fdot14ToFixed( FT_GET_SHORT() ); + segment->correspondence[j].toCoord = + FT_fdot14ToFixed( FT_GET_SHORT() ); FT_TRACE5(( " mapping %.5f to %.5f\n", segment->correspondence[j].fromCoord / 65536.0, @@ -1616,7 +1621,7 @@ for ( j = 0; j < (FT_UInt)gvar_head.axisCount; j++ ) { blend->tuplecoords[i * gvar_head.axisCount + j] = - FT_GET_SHORT() * 4; /* convert to FT_Fixed */ + FT_fdot14ToFixed( FT_GET_SHORT() ); FT_TRACE5(( "%.5f ", blend->tuplecoords[i * gvar_head.axisCount + j] / 65536.0 )); } @@ -3054,7 +3059,7 @@ if ( instance_index > num_instances ) goto Exit; - if ( instance_index > 0 && mmvar->namedstyle ) + if ( instance_index > 0 ) { FT_Memory memory = face->root.memory; SFNT_Service sfnt = (SFNT_Service)face->sfnt; @@ -3080,7 +3085,12 @@ mmvar->num_axis, named_style->coords ); if ( error ) + { + /* internal error code -1 means `no change' */ + if ( error == -1 ) + error = FT_Err_Ok; goto Exit; + } } else error = TT_Set_Var_Design( face, 0, NULL ); @@ -3103,6 +3113,21 @@ /*************************************************************************/ + static FT_Error + tt_cvt_ready_iterator( FT_ListNode node, + void* user ) + { + TT_Size size = (TT_Size)node->data; + + FT_UNUSED( user ); + + + size->cvt_ready = -1; + + return FT_Err_Ok; + } + + /************************************************************************** * * @Function: @@ -3133,6 +3158,8 @@ FT_Error error; FT_Memory memory = stream->memory; + FT_Face root = &face->root; + FT_ULong table_start; FT_ULong table_len; @@ -3261,8 +3288,7 @@ if ( tupleIndex & GX_TI_EMBEDDED_TUPLE_COORD ) { for ( j = 0; j < blend->num_axis; j++ ) - tuple_coords[j] = FT_GET_SHORT() * 4; /* convert from */ - /* short frac to fixed */ + tuple_coords[j] = FT_fdot14ToFixed( FT_GET_SHORT() ); } else if ( ( tupleIndex & GX_TI_TUPLE_INDEX_MASK ) >= blend->tuplecount ) { @@ -3293,9 +3319,9 @@ if ( tupleIndex & GX_TI_INTERMEDIATE_TUPLE ) { for ( j = 0; j < blend->num_axis; j++ ) - im_start_coords[j] = FT_GET_SHORT() * 4; + im_start_coords[j] = FT_fdot14ToFixed( FT_GET_SHORT() ); for ( j = 0; j < blend->num_axis; j++ ) - im_end_coords[j] = FT_GET_SHORT() * 4; + im_end_coords[j] = FT_fdot14ToFixed( FT_GET_SHORT() ); } apply = ft_var_apply_tuple( blend, @@ -3360,9 +3386,9 @@ { FT_TRACE7(( " %d: %f -> %f\n", j, - ( FT_intToFixed( face->cvt[j] ) + + ( FT_fdot6ToFixed( face->cvt[j] ) + old_cvt_delta ) / 65536.0, - ( FT_intToFixed( face->cvt[j] ) + + ( FT_fdot6ToFixed( face->cvt[j] ) + cvt_deltas[j] ) / 65536.0 )); count++; } @@ -3402,9 +3428,9 @@ { FT_TRACE7(( " %d: %f -> %f\n", pindex, - ( FT_intToFixed( face->cvt[pindex] ) + + ( FT_fdot6ToFixed( face->cvt[pindex] ) + old_cvt_delta ) / 65536.0, - ( FT_intToFixed( face->cvt[pindex] ) + + ( FT_fdot6ToFixed( face->cvt[pindex] ) + cvt_deltas[pindex] ) / 65536.0 )); count++; } @@ -3429,7 +3455,7 @@ FT_TRACE5(( "\n" )); for ( i = 0; i < face->cvt_size; i++ ) - face->cvt[i] += FT_fixedToInt( cvt_deltas[i] ); + face->cvt[i] += FT_fixedToFdot6( cvt_deltas[i] ); FExit: FT_FRAME_EXIT(); @@ -3442,6 +3468,12 @@ FT_FREE( im_end_coords ); FT_FREE( cvt_deltas ); + /* iterate over all FT_Size objects and set `cvt_ready' to -1 */ + /* to trigger rescaling of all CVT values */ + FT_List_Iterate( &root->sizes_list, + tt_cvt_ready_iterator, + NULL ); + return error; } @@ -3669,6 +3701,11 @@ * outline :: * The outline to change. * + * @Output: + * unrounded :: + * An array with `n_points' elements that is filled with unrounded + * point coordinates (in 26.6 format). + * * @Return: * FreeType error code. 0 means success. */ @@ -3676,6 +3713,7 @@ TT_Vary_Apply_Glyph_Deltas( TT_Face face, FT_UInt glyph_index, FT_Outline* outline, + FT_Vector* unrounded, FT_UInt n_points ) { FT_Error error; @@ -3717,6 +3755,12 @@ if ( !face->doblend || !blend ) return FT_THROW( Invalid_Argument ); + for ( i = 0; i < n_points; i++ ) + { + unrounded[i].x = INT_TO_F26DOT6( outline->points[i].x ); + unrounded[i].y = INT_TO_F26DOT6( outline->points[i].y ); + } + if ( glyph_index >= blend->gv_glyphcnt || blend->glyphoffsets[glyph_index] == blend->glyphoffsets[glyph_index + 1] ) @@ -3807,8 +3851,7 @@ if ( tupleIndex & GX_TI_EMBEDDED_TUPLE_COORD ) { for ( j = 0; j < blend->num_axis; j++ ) - tuple_coords[j] = FT_GET_SHORT() * 4; /* convert from */ - /* short frac to fixed */ + tuple_coords[j] = FT_fdot14ToFixed( FT_GET_SHORT() ); } else if ( ( tupleIndex & GX_TI_TUPLE_INDEX_MASK ) >= blend->tuplecount ) { @@ -3828,9 +3871,9 @@ if ( tupleIndex & GX_TI_INTERMEDIATE_TUPLE ) { for ( j = 0; j < blend->num_axis; j++ ) - im_start_coords[j] = FT_GET_SHORT() * 4; + im_start_coords[j] = FT_fdot14ToFixed( FT_GET_SHORT() ); for ( j = 0; j < blend->num_axis; j++ ) - im_end_coords[j] = FT_GET_SHORT() * 4; + im_end_coords[j] = FT_fdot14ToFixed( FT_GET_SHORT() ); } apply = ft_var_apply_tuple( blend, @@ -4064,6 +4107,9 @@ for ( i = 0; i < n_points; i++ ) { + unrounded[i].x += FT_fixedToFdot6( point_deltas_x[i] ); + unrounded[i].y += FT_fixedToFdot6( point_deltas_y[i] ); + outline->points[i].x += FT_fixedToInt( point_deltas_x[i] ); outline->points[i].y += FT_fixedToInt( point_deltas_y[i] ); } diff --git a/thirdparty/freetype/src/truetype/ttgxvar.h b/thirdparty/freetype/src/truetype/ttgxvar.h index 7e8d9768a7..07c99b6403 100644 --- a/thirdparty/freetype/src/truetype/ttgxvar.h +++ b/thirdparty/freetype/src/truetype/ttgxvar.h @@ -416,6 +416,7 @@ FT_BEGIN_HEADER TT_Vary_Apply_Glyph_Deltas( TT_Face face, FT_UInt glyph_index, FT_Outline* outline, + FT_Vector* unrounded, FT_UInt n_points ); FT_LOCAL( FT_Error ) diff --git a/thirdparty/freetype/src/truetype/ttinterp.c b/thirdparty/freetype/src/truetype/ttinterp.c index 403f3753c7..70434e1729 100644 --- a/thirdparty/freetype/src/truetype/ttinterp.c +++ b/thirdparty/freetype/src/truetype/ttinterp.c @@ -654,23 +654,25 @@ /* opcodes are gathered in groups of 16 */ /* please keep the spaces as they are */ - /* SVTCA y */ PACK( 0, 0 ), - /* SVTCA x */ PACK( 0, 0 ), - /* SPvTCA y */ PACK( 0, 0 ), - /* SPvTCA x */ PACK( 0, 0 ), - /* SFvTCA y */ PACK( 0, 0 ), - /* SFvTCA x */ PACK( 0, 0 ), - /* SPvTL // */ PACK( 2, 0 ), - /* SPvTL + */ PACK( 2, 0 ), - /* SFvTL // */ PACK( 2, 0 ), - /* SFvTL + */ PACK( 2, 0 ), - /* SPvFS */ PACK( 2, 0 ), - /* SFvFS */ PACK( 2, 0 ), - /* GPv */ PACK( 0, 2 ), - /* GFv */ PACK( 0, 2 ), - /* SFvTPv */ PACK( 0, 0 ), + /* 0x00 */ + /* SVTCA[0] */ PACK( 0, 0 ), + /* SVTCA[1] */ PACK( 0, 0 ), + /* SPVTCA[0] */ PACK( 0, 0 ), + /* SPVTCA[1] */ PACK( 0, 0 ), + /* SFVTCA[0] */ PACK( 0, 0 ), + /* SFVTCA[1] */ PACK( 0, 0 ), + /* SPVTL[0] */ PACK( 2, 0 ), + /* SPVTL[1] */ PACK( 2, 0 ), + /* SFVTL[0] */ PACK( 2, 0 ), + /* SFVTL[1] */ PACK( 2, 0 ), + /* SPVFS */ PACK( 2, 0 ), + /* SFVFS */ PACK( 2, 0 ), + /* GPV */ PACK( 0, 2 ), + /* GFV */ PACK( 0, 2 ), + /* SFVTPV */ PACK( 0, 0 ), /* ISECT */ PACK( 5, 0 ), + /* 0x10 */ /* SRP0 */ PACK( 1, 0 ), /* SRP1 */ PACK( 1, 0 ), /* SRP2 */ PACK( 1, 0 ), @@ -684,10 +686,11 @@ /* SMD */ PACK( 1, 0 ), /* ELSE */ PACK( 0, 0 ), /* JMPR */ PACK( 1, 0 ), - /* SCvTCi */ PACK( 1, 0 ), - /* SSwCi */ PACK( 1, 0 ), + /* SCVTCI */ PACK( 1, 0 ), + /* SSWCI */ PACK( 1, 0 ), /* SSW */ PACK( 1, 0 ), + /* 0x20 */ /* DUP */ PACK( 1, 2 ), /* POP */ PACK( 1, 0 ), /* CLEAR */ PACK( 0, 0 ), @@ -695,7 +698,7 @@ /* DEPTH */ PACK( 0, 1 ), /* CINDEX */ PACK( 1, 1 ), /* MINDEX */ PACK( 1, 0 ), - /* AlignPTS */ PACK( 2, 0 ), + /* ALIGNPTS */ PACK( 2, 0 ), /* INS_$28 */ PACK( 0, 0 ), /* UTP */ PACK( 1, 0 ), /* LOOPCALL */ PACK( 2, 0 ), @@ -705,6 +708,7 @@ /* MDAP[0] */ PACK( 1, 0 ), /* MDAP[1] */ PACK( 1, 0 ), + /* 0x30 */ /* IUP[0] */ PACK( 0, 0 ), /* IUP[1] */ PACK( 0, 0 ), /* SHP[0] */ PACK( 0, 0 ), /* loops */ @@ -717,17 +721,18 @@ /* IP */ PACK( 0, 0 ), /* loops */ /* MSIRP[0] */ PACK( 2, 0 ), /* MSIRP[1] */ PACK( 2, 0 ), - /* AlignRP */ PACK( 0, 0 ), /* loops */ + /* ALIGNRP */ PACK( 0, 0 ), /* loops */ /* RTDG */ PACK( 0, 0 ), /* MIAP[0] */ PACK( 2, 0 ), /* MIAP[1] */ PACK( 2, 0 ), - /* NPushB */ PACK( 0, 0 ), - /* NPushW */ PACK( 0, 0 ), + /* 0x40 */ + /* NPUSHB */ PACK( 0, 0 ), + /* NPUSHW */ PACK( 0, 0 ), /* WS */ PACK( 2, 0 ), /* RS */ PACK( 1, 1 ), - /* WCvtP */ PACK( 2, 0 ), - /* RCvt */ PACK( 1, 1 ), + /* WCVTP */ PACK( 2, 0 ), + /* RCVT */ PACK( 1, 1 ), /* GC[0] */ PACK( 1, 1 ), /* GC[1] */ PACK( 1, 1 ), /* SCFS */ PACK( 2, 0 ), @@ -735,10 +740,11 @@ /* MD[1] */ PACK( 2, 1 ), /* MPPEM */ PACK( 0, 1 ), /* MPS */ PACK( 0, 1 ), - /* FlipON */ PACK( 0, 0 ), - /* FlipOFF */ PACK( 0, 0 ), + /* FLIPON */ PACK( 0, 0 ), + /* FLIPOFF */ PACK( 0, 0 ), /* DEBUG */ PACK( 1, 0 ), + /* 0x50 */ /* LT */ PACK( 2, 1 ), /* LTEQ */ PACK( 2, 1 ), /* GT */ PACK( 2, 1 ), @@ -752,10 +758,11 @@ /* AND */ PACK( 2, 1 ), /* OR */ PACK( 2, 1 ), /* NOT */ PACK( 1, 1 ), - /* DeltaP1 */ PACK( 1, 0 ), + /* DELTAP1 */ PACK( 1, 0 ), /* SDB */ PACK( 1, 0 ), /* SDS */ PACK( 1, 0 ), + /* 0x60 */ /* ADD */ PACK( 2, 1 ), /* SUB */ PACK( 2, 1 ), /* DIV */ PACK( 2, 1 ), @@ -773,14 +780,15 @@ /* NROUND[2] */ PACK( 1, 1 ), /* NROUND[3] */ PACK( 1, 1 ), - /* WCvtF */ PACK( 2, 0 ), - /* DeltaP2 */ PACK( 1, 0 ), - /* DeltaP3 */ PACK( 1, 0 ), - /* DeltaCn[0] */ PACK( 1, 0 ), - /* DeltaCn[1] */ PACK( 1, 0 ), - /* DeltaCn[2] */ PACK( 1, 0 ), + /* 0x70 */ + /* WCVTF */ PACK( 2, 0 ), + /* DELTAP2 */ PACK( 1, 0 ), + /* DELTAP3 */ PACK( 1, 0 ), + /* DELTAC1 */ PACK( 1, 0 ), + /* DELTAC2 */ PACK( 1, 0 ), + /* DELTAC3 */ PACK( 1, 0 ), /* SROUND */ PACK( 1, 0 ), - /* S45Round */ PACK( 1, 0 ), + /* S45ROUND */ PACK( 1, 0 ), /* JROT */ PACK( 2, 0 ), /* JROF */ PACK( 2, 0 ), /* ROFF */ PACK( 0, 0 ), @@ -790,23 +798,25 @@ /* SANGW */ PACK( 1, 0 ), /* AA */ PACK( 1, 0 ), - /* FlipPT */ PACK( 0, 0 ), /* loops */ - /* FlipRgON */ PACK( 2, 0 ), - /* FlipRgOFF */ PACK( 2, 0 ), + /* 0x80 */ + /* FLIPPT */ PACK( 0, 0 ), /* loops */ + /* FLIPRGON */ PACK( 2, 0 ), + /* FLIPRGOFF */ PACK( 2, 0 ), /* INS_$83 */ PACK( 0, 0 ), /* INS_$84 */ PACK( 0, 0 ), - /* ScanCTRL */ PACK( 1, 0 ), - /* SDPvTL[0] */ PACK( 2, 0 ), - /* SDPvTL[1] */ PACK( 2, 0 ), - /* GetINFO */ PACK( 1, 1 ), + /* SCANCTRL */ PACK( 1, 0 ), + /* SDPVTL[0] */ PACK( 2, 0 ), + /* SDPVTL[1] */ PACK( 2, 0 ), + /* GETINFO */ PACK( 1, 1 ), /* IDEF */ PACK( 1, 0 ), /* ROLL */ PACK( 3, 3 ), /* MAX */ PACK( 2, 1 ), /* MIN */ PACK( 2, 1 ), - /* ScanTYPE */ PACK( 1, 0 ), - /* InstCTRL */ PACK( 2, 0 ), + /* SCANTYPE */ PACK( 1, 0 ), + /* INSTCTRL */ PACK( 2, 0 ), /* INS_$8F */ PACK( 0, 0 ), + /* 0x90 */ /* INS_$90 */ PACK( 0, 0 ), /* GETVAR */ PACK( 0, 0 ), /* will be handled specially */ /* GETDATA */ PACK( 0, 1 ), @@ -824,6 +834,7 @@ /* INS_$9E */ PACK( 0, 0 ), /* INS_$9F */ PACK( 0, 0 ), + /* 0xA0 */ /* INS_$A0 */ PACK( 0, 0 ), /* INS_$A1 */ PACK( 0, 0 ), /* INS_$A2 */ PACK( 0, 0 ), @@ -841,23 +852,25 @@ /* INS_$AE */ PACK( 0, 0 ), /* INS_$AF */ PACK( 0, 0 ), - /* PushB[0] */ PACK( 0, 1 ), - /* PushB[1] */ PACK( 0, 2 ), - /* PushB[2] */ PACK( 0, 3 ), - /* PushB[3] */ PACK( 0, 4 ), - /* PushB[4] */ PACK( 0, 5 ), - /* PushB[5] */ PACK( 0, 6 ), - /* PushB[6] */ PACK( 0, 7 ), - /* PushB[7] */ PACK( 0, 8 ), - /* PushW[0] */ PACK( 0, 1 ), - /* PushW[1] */ PACK( 0, 2 ), - /* PushW[2] */ PACK( 0, 3 ), - /* PushW[3] */ PACK( 0, 4 ), - /* PushW[4] */ PACK( 0, 5 ), - /* PushW[5] */ PACK( 0, 6 ), - /* PushW[6] */ PACK( 0, 7 ), - /* PushW[7] */ PACK( 0, 8 ), - + /* 0xB0 */ + /* PUSHB[0] */ PACK( 0, 1 ), + /* PUSHB[1] */ PACK( 0, 2 ), + /* PUSHB[2] */ PACK( 0, 3 ), + /* PUSHB[3] */ PACK( 0, 4 ), + /* PUSHB[4] */ PACK( 0, 5 ), + /* PUSHB[5] */ PACK( 0, 6 ), + /* PUSHB[6] */ PACK( 0, 7 ), + /* PUSHB[7] */ PACK( 0, 8 ), + /* PUSHW[0] */ PACK( 0, 1 ), + /* PUSHW[1] */ PACK( 0, 2 ), + /* PUSHW[2] */ PACK( 0, 3 ), + /* PUSHW[3] */ PACK( 0, 4 ), + /* PUSHW[4] */ PACK( 0, 5 ), + /* PUSHW[5] */ PACK( 0, 6 ), + /* PUSHW[6] */ PACK( 0, 7 ), + /* PUSHW[7] */ PACK( 0, 8 ), + + /* 0xC0 */ /* MDRP[00] */ PACK( 1, 0 ), /* MDRP[01] */ PACK( 1, 0 ), /* MDRP[02] */ PACK( 1, 0 ), @@ -875,6 +888,7 @@ /* MDRP[14] */ PACK( 1, 0 ), /* MDRP[15] */ PACK( 1, 0 ), + /* 0xD0 */ /* MDRP[16] */ PACK( 1, 0 ), /* MDRP[17] */ PACK( 1, 0 ), /* MDRP[18] */ PACK( 1, 0 ), @@ -892,6 +906,7 @@ /* MDRP[30] */ PACK( 1, 0 ), /* MDRP[31] */ PACK( 1, 0 ), + /* 0xE0 */ /* MIRP[00] */ PACK( 2, 0 ), /* MIRP[01] */ PACK( 2, 0 ), /* MIRP[02] */ PACK( 2, 0 ), @@ -909,6 +924,7 @@ /* MIRP[14] */ PACK( 2, 0 ), /* MIRP[15] */ PACK( 2, 0 ), + /* 0xF0 */ /* MIRP[16] */ PACK( 2, 0 ), /* MIRP[17] */ PACK( 2, 0 ), /* MIRP[18] */ PACK( 2, 0 ), @@ -937,23 +953,25 @@ static const char* const opcode_name[256] = { - "7 SVTCA y", - "7 SVTCA x", - "8 SPvTCA y", - "8 SPvTCA x", - "8 SFvTCA y", - "8 SFvTCA x", - "8 SPvTL ||", - "7 SPvTL +", - "8 SFvTL ||", - "7 SFvTL +", - "5 SPvFS", - "5 SFvFS", - "3 GPv", - "3 GFv", - "6 SFvTPv", + /* 0x00 */ + "8 SVTCA[y]", + "8 SVTCA[x]", + "9 SPVTCA[y]", + "9 SPVTCA[x]", + "9 SFVTCA[y]", + "9 SFVTCA[x]", + "9 SPVTL[||]", + "8 SPVTL[+]", + "9 SFVTL[||]", + "8 SFVTL[+]", + "5 SPVFS", + "5 SFVFS", + "3 GPV", + "3 GFV", + "6 SFVTPV", "5 ISECT", + /* 0x10 */ "4 SRP0", "4 SRP1", "4 SRP2", @@ -967,10 +985,11 @@ "3 SMD", "4 ELSE", "4 JMPR", - "6 SCvTCi", - "5 SSwCi", + "6 SCVTCI", + "5 SSWCI", "3 SSW", + /* 0x20 */ "3 DUP", "3 POP", "5 CLEAR", @@ -978,50 +997,53 @@ "5 DEPTH", "6 CINDEX", "6 MINDEX", - "8 AlignPTS", + "8 ALIGNPTS", "7 INS_$28", "3 UTP", "8 LOOPCALL", "4 CALL", "4 FDEF", "4 ENDF", - "7 MDAP[0]", - "7 MDAP[1]", - - "6 IUP[0]", - "6 IUP[1]", - "6 SHP[0]", - "6 SHP[1]", - "6 SHC[0]", - "6 SHC[1]", - "6 SHZ[0]", - "6 SHZ[1]", + "6 MDAP[]", + "9 MDAP[rnd]", + + /* 0x30 */ + "6 IUP[y]", + "6 IUP[x]", + "8 SHP[rp2]", + "8 SHP[rp1]", + "8 SHC[rp2]", + "8 SHC[rp1]", + "8 SHZ[rp2]", + "8 SHZ[rp1]", "5 SHPIX", "2 IP", - "8 MSIRP[0]", - "8 MSIRP[1]", - "7 AlignRP", + "7 MSIRP[]", + "A MSIRP[rp0]", + "7 ALIGNRP", "4 RTDG", - "7 MIAP[0]", - "7 MIAP[1]", + "6 MIAP[]", + "9 MIAP[rnd]", - "6 NPushB", - "6 NPushW", + /* 0x40 */ + "6 NPUSHB", + "6 NPUSHW", "2 WS", "2 RS", - "5 WCvtP", - "4 RCvt", - "5 GC[0]", - "5 GC[1]", + "5 WCVTP", + "4 RCVT", + "8 GC[curr]", + "8 GC[orig]", "4 SCFS", - "5 MD[0]", - "5 MD[1]", + "8 MD[curr]", + "8 MD[orig]", "5 MPPEM", "3 MPS", - "6 FlipON", - "7 FlipOFF", + "6 FLIPON", + "7 FLIPOFF", "5 DEBUG", + /* 0x50 */ "2 LT", "4 LTEQ", "2 GT", @@ -1035,10 +1057,11 @@ "3 AND", "2 OR", "3 NOT", - "7 DeltaP1", + "7 DELTAP1", "3 SDB", "3 SDS", + /* 0x60 */ "3 ADD", "3 SUB", "3 DIV", @@ -1047,23 +1070,24 @@ "3 NEG", "5 FLOOR", "7 CEILING", - "8 ROUND[0]", - "8 ROUND[1]", - "8 ROUND[2]", - "8 ROUND[3]", - "9 NROUND[0]", - "9 NROUND[1]", - "9 NROUND[2]", - "9 NROUND[3]", - - "5 WCvtF", - "7 DeltaP2", - "7 DeltaP3", - "A DeltaCn[0]", - "A DeltaCn[1]", - "A DeltaCn[2]", + "8 ROUND[G]", + "8 ROUND[B]", + "8 ROUND[W]", + "7 ROUND[]", + "9 NROUND[G]", + "9 NROUND[B]", + "9 NROUND[W]", + "8 NROUND[]", + + /* 0x70 */ + "5 WCVTF", + "7 DELTAP2", + "7 DELTAP3", + "7 DELTAC1", + "7 DELTAC2", + "7 DELTAC3", "6 SROUND", - "8 S45Round", + "8 S45ROUND", "4 JROT", "4 JROF", "4 ROFF", @@ -1073,26 +1097,28 @@ "5 SANGW", "2 AA", - "6 FlipPT", - "8 FlipRgON", - "9 FlipRgOFF", + /* 0x80 */ + "6 FLIPPT", + "8 FLIPRGON", + "9 FLIPRGOFF", "7 INS_$83", "7 INS_$84", - "8 ScanCTRL", - "9 SDPvTL[0]", - "9 SDPvTL[1]", - "7 GetINFO", + "8 SCANCTRL", + "A SDPVTL[||]", + "9 SDPVTL[+]", + "7 GETINFO", "4 IDEF", "4 ROLL", "3 MAX", "3 MIN", - "8 ScanTYPE", - "8 InstCTRL", + "8 SCANTYPE", + "8 INSTCTRL", "7 INS_$8F", + /* 0x90 */ "7 INS_$90", #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT - "6 GETVAR", + "C GETVARIATION", "7 GETDATA", #else "7 INS_$91", @@ -1112,6 +1138,7 @@ "7 INS_$9E", "7 INS_$9F", + /* 0xA0 */ "7 INS_$A0", "7 INS_$A1", "7 INS_$A2", @@ -1129,90 +1156,95 @@ "7 INS_$AE", "7 INS_$AF", - "8 PushB[0]", - "8 PushB[1]", - "8 PushB[2]", - "8 PushB[3]", - "8 PushB[4]", - "8 PushB[5]", - "8 PushB[6]", - "8 PushB[7]", - "8 PushW[0]", - "8 PushW[1]", - "8 PushW[2]", - "8 PushW[3]", - "8 PushW[4]", - "8 PushW[5]", - "8 PushW[6]", - "8 PushW[7]", - + /* 0xB0 */ + "8 PUSHB[0]", + "8 PUSHB[1]", + "8 PUSHB[2]", + "8 PUSHB[3]", + "8 PUSHB[4]", + "8 PUSHB[5]", + "8 PUSHB[6]", + "8 PUSHB[7]", + "8 PUSHW[0]", + "8 PUSHW[1]", + "8 PUSHW[2]", + "8 PUSHW[3]", + "8 PUSHW[4]", + "8 PUSHW[5]", + "8 PUSHW[6]", + "8 PUSHW[7]", + + /* 0xC0 */ "7 MDRP[G]", "7 MDRP[B]", "7 MDRP[W]", - "7 MDRP[?]", + "6 MDRP[]", "8 MDRP[rG]", "8 MDRP[rB]", "8 MDRP[rW]", - "8 MDRP[r?]", + "7 MDRP[r]", "8 MDRP[mG]", "8 MDRP[mB]", "8 MDRP[mW]", - "8 MDRP[m?]", + "7 MDRP[m]", "9 MDRP[mrG]", "9 MDRP[mrB]", "9 MDRP[mrW]", - "9 MDRP[mr?]", + "8 MDRP[mr]", + /* 0xD0 */ "8 MDRP[pG]", "8 MDRP[pB]", "8 MDRP[pW]", - "8 MDRP[p?]", + "7 MDRP[p]", "9 MDRP[prG]", "9 MDRP[prB]", "9 MDRP[prW]", - "9 MDRP[pr?]", + "8 MDRP[pr]", "9 MDRP[pmG]", "9 MDRP[pmB]", "9 MDRP[pmW]", - "9 MDRP[pm?]", + "8 MDRP[pm]", "A MDRP[pmrG]", "A MDRP[pmrB]", "A MDRP[pmrW]", - "A MDRP[pmr?]", + "9 MDRP[pmr]", + /* 0xE0 */ "7 MIRP[G]", "7 MIRP[B]", "7 MIRP[W]", - "7 MIRP[?]", + "6 MIRP[]", "8 MIRP[rG]", "8 MIRP[rB]", "8 MIRP[rW]", - "8 MIRP[r?]", + "7 MIRP[r]", "8 MIRP[mG]", "8 MIRP[mB]", "8 MIRP[mW]", - "8 MIRP[m?]", + "7 MIRP[m]", "9 MIRP[mrG]", "9 MIRP[mrB]", "9 MIRP[mrW]", - "9 MIRP[mr?]", + "8 MIRP[mr]", + /* 0xF0 */ "8 MIRP[pG]", "8 MIRP[pB]", "8 MIRP[pW]", - "8 MIRP[p?]", + "7 MIRP[p]", "9 MIRP[prG]", "9 MIRP[prB]", "9 MIRP[prW]", - "9 MIRP[pr?]", + "8 MIRP[pr]", "9 MIRP[pmG]", "9 MIRP[pmB]", "9 MIRP[pmW]", - "9 MIRP[pm?]", + "8 MIRP[pm]", "A MIRP[pmrG]", "A MIRP[pmrB]", "A MIRP[pmrW]", - "A MIRP[pmr?]" + "9 MIRP[pmr]" }; #endif /* FT_DEBUG_LEVEL_TRACE */ @@ -1662,6 +1694,32 @@ } + /* + * + * Apple's TrueType specification at + * + * https://developer.apple.com/fonts/TrueType-Reference-Manual/RM02/Chap2.html#order + * + * gives the following order of operations in instructions that move + * points. + * + * - check single width cut-in (MIRP, MDRP) + * + * - check control value cut-in (MIRP, MIAP) + * + * - apply engine compensation (MIRP, MDRP) + * + * - round distance (MIRP, MDRP) or value (MIAP, MDAP) + * + * - check minimum distance (MIRP,MDRP) + * + * - move point (MIRP, MDRP, MIAP, MSIRP, MDAP) + * + * For rounding instructions, engine compensation happens before rounding. + * + */ + + /************************************************************************** * * @Function: @@ -1886,7 +1944,6 @@ zone->org[point].y = ADD_LONG( zone->org[point].y, distance ); } - /************************************************************************** * * @Function: @@ -1904,12 +1961,6 @@ * * @Return: * The compensated distance. - * - * @Note: - * The TrueType specification says very few about the relationship - * between rounding and engine compensation. However, it seems from - * the description of super round that we should add the compensation - * before rounding. */ static FT_F26Dot6 Round_None( TT_ExecContext exc, diff --git a/thirdparty/freetype/src/truetype/ttobjs.c b/thirdparty/freetype/src/truetype/ttobjs.c index f3a432cedd..e4775a51ed 100644 --- a/thirdparty/freetype/src/truetype/ttobjs.c +++ b/thirdparty/freetype/src/truetype/ttobjs.c @@ -148,7 +148,7 @@ /* This list shall be expanded as we find more of them. */ static FT_Bool - tt_check_trickyness_family( FT_String* name ) + tt_check_trickyness_family( const FT_String* name ) { #define TRICK_NAMES_MAX_CHARACTERS 19 @@ -937,7 +937,22 @@ TT_Face face = (TT_Face)size->root.face; TT_ExecContext exec; FT_Error error; + FT_UInt i; + /* unscaled CVT values are already stored in 26.6 format */ + FT_Fixed scale = size->ttmetrics.scale >> 6; + + + /* Scale the cvt values to the new ppem. */ + /* By default, we use the y ppem value for scaling. */ + FT_TRACE6(( "CVT values:\n" )); + for ( i = 0; i < size->cvt_size; i++ ) + { + size->cvt[i] = FT_MulFix( face->cvt[i], scale ); + FT_TRACE6(( " %3d: %f (%f)\n", + i, face->cvt[i] / 64.0, size->cvt[i] / 64.0 )); + } + FT_TRACE6(( "\n" )); exec = size->context; @@ -1094,11 +1109,17 @@ tt_metrics->rotated = FALSE; tt_metrics->stretched = FALSE; - /* set default engine compensation */ - tt_metrics->compensations[0] = 0; /* gray */ - tt_metrics->compensations[1] = 0; /* black */ - tt_metrics->compensations[2] = 0; /* white */ - tt_metrics->compensations[3] = 0; /* reserved */ + /* Set default engine compensation. Value 3 is not described */ + /* in the OpenType specification (as of Mai 2019), but Greg */ + /* says that MS handles it the same as `gray'. */ + /* */ + /* The Apple specification says that the compensation for */ + /* `gray' is always zero. FreeType doesn't do any */ + /* compensation at all. */ + tt_metrics->compensations[0] = 0; /* gray */ + tt_metrics->compensations[1] = 0; /* black */ + tt_metrics->compensations[2] = 0; /* white */ + tt_metrics->compensations[3] = 0; /* the same as gray */ } /* allocate function defs, instruction defs, cvt, and storage area */ @@ -1171,20 +1192,8 @@ if ( size->cvt_ready < 0 ) { FT_UInt i; - TT_Face face = (TT_Face)size->root.face; - /* Scale the cvt values to the new ppem. */ - /* By default, we use the y ppem value for scaling. */ - FT_TRACE6(( "CVT values:\n" )); - for ( i = 0; i < size->cvt_size; i++ ) - { - size->cvt[i] = FT_MulFix( face->cvt[i], size->ttmetrics.scale ); - FT_TRACE6(( " %3d: %d (%f)\n", - i, face->cvt[i], size->cvt[i] / 64.0 )); - } - FT_TRACE6(( "\n" )); - /* all twilight points are originally zero */ for ( i = 0; i < (FT_UInt)size->twilight.n_points; i++ ) { diff --git a/thirdparty/freetype/src/truetype/ttpload.c b/thirdparty/freetype/src/truetype/ttpload.c index e7718bf9b7..bc954c2dba 100644 --- a/thirdparty/freetype/src/truetype/ttpload.c +++ b/thirdparty/freetype/src/truetype/ttpload.c @@ -352,12 +352,12 @@ goto Exit; { - FT_Short* cur = face->cvt; - FT_Short* limit = cur + face->cvt_size; + FT_Int32* cur = face->cvt; + FT_Int32* limit = cur + face->cvt_size; for ( ; cur < limit; cur++ ) - *cur = FT_GET_SHORT(); + *cur = FT_GET_SHORT() * 64; } FT_FRAME_EXIT(); diff --git a/thirdparty/freetype/src/type1/t1driver.c b/thirdparty/freetype/src/type1/t1driver.c index 8625db5b01..557733da3b 100644 --- a/thirdparty/freetype/src/type1/t1driver.c +++ b/thirdparty/freetype/src/type1/t1driver.c @@ -70,8 +70,8 @@ static FT_UInt - t1_get_name_index( T1_Face face, - FT_String* glyph_name ) + t1_get_name_index( T1_Face face, + const FT_String* glyph_name ) { FT_Int i; diff --git a/thirdparty/freetype/src/type1/t1load.c b/thirdparty/freetype/src/type1/t1load.c index 3896af70ba..5cffdfaac4 100644 --- a/thirdparty/freetype/src/type1/t1load.c +++ b/thirdparty/freetype/src/type1/t1load.c @@ -1507,12 +1507,7 @@ /* We need to `zero' out encoding_table.elements */ for ( n = 0; n < array_size; n++ ) - { - char* notdef = (char *)".notdef"; - - - (void)T1_Add_Table( char_table, n, notdef, 8 ); - } + (void)T1_Add_Table( char_table, n, ".notdef", 8 ); /* Now we need to read records of the form */ /* */ @@ -2147,7 +2142,6 @@ /* 0 333 hsbw endchar */ FT_Byte notdef_glyph[] = { 0x8B, 0xF7, 0xE1, 0x0D, 0x0E }; - char* notdef_name = (char *)".notdef"; error = T1_Add_Table( swap_table, 0, @@ -2162,7 +2156,7 @@ if ( error ) goto Fail; - error = T1_Add_Table( name_table, 0, notdef_name, 8 ); + error = T1_Add_Table( name_table, 0, ".notdef", 8 ); if ( error ) goto Fail; @@ -2633,8 +2627,7 @@ /* we must now build type1.encoding when we have a custom array */ if ( type1->encoding_type == T1_ENCODING_TYPE_ARRAY ) { - FT_Int charcode, idx, min_char, max_char; - FT_Byte* glyph_name; + FT_Int charcode, idx, min_char, max_char; /* OK, we do the following: for each element in the encoding */ @@ -2648,27 +2641,27 @@ charcode = 0; for ( ; charcode < loader.encoding_table.max_elems; charcode++ ) { - FT_Byte* char_name; + const FT_String* char_name = + (const FT_String*)loader.encoding_table.elements[charcode]; type1->encoding.char_index[charcode] = 0; - type1->encoding.char_name [charcode] = (char *)".notdef"; + type1->encoding.char_name [charcode] = ".notdef"; - char_name = loader.encoding_table.elements[charcode]; if ( char_name ) for ( idx = 0; idx < type1->num_glyphs; idx++ ) { - glyph_name = (FT_Byte*)type1->glyph_names[idx]; - if ( ft_strcmp( (const char*)char_name, - (const char*)glyph_name ) == 0 ) + const FT_String* glyph_name = type1->glyph_names[idx]; + + + if ( ft_strcmp( char_name, glyph_name ) == 0 ) { type1->encoding.char_index[charcode] = (FT_UShort)idx; - type1->encoding.char_name [charcode] = (char*)glyph_name; + type1->encoding.char_name [charcode] = glyph_name; /* Change min/max encoded char only if glyph name is */ /* not /.notdef */ - if ( ft_strcmp( (const char*)".notdef", - (const char*)glyph_name ) != 0 ) + if ( ft_strcmp( ".notdef", glyph_name ) != 0 ) { if ( charcode < min_char ) min_char = charcode; diff --git a/thirdparty/freetype/src/type42/t42drivr.c b/thirdparty/freetype/src/type42/t42drivr.c index 6d4e7a0955..09ad632e97 100644 --- a/thirdparty/freetype/src/type42/t42drivr.c +++ b/thirdparty/freetype/src/type42/t42drivr.c @@ -69,8 +69,8 @@ static FT_UInt - t42_get_name_index( T42_Face face, - FT_String* glyph_name ) + t42_get_name_index( T42_Face face, + const FT_String* glyph_name ) { FT_Int i; diff --git a/thirdparty/freetype/src/type42/t42objs.c b/thirdparty/freetype/src/type42/t42objs.c index 234c0a3e97..d31bace451 100644 --- a/thirdparty/freetype/src/type42/t42objs.c +++ b/thirdparty/freetype/src/type42/t42objs.c @@ -98,8 +98,7 @@ /* we must now build type1.encoding when we have a custom array */ if ( type1->encoding_type == T1_ENCODING_TYPE_ARRAY ) { - FT_Int charcode, idx, min_char, max_char; - FT_Byte* glyph_name; + FT_Int charcode, idx, min_char, max_char; /* OK, we do the following: for each element in the encoding */ @@ -114,27 +113,27 @@ charcode = 0; for ( ; charcode < loader.encoding_table.max_elems; charcode++ ) { - FT_Byte* char_name; + const FT_String* char_name = + (const FT_String*)loader.encoding_table.elements[charcode]; type1->encoding.char_index[charcode] = 0; - type1->encoding.char_name [charcode] = (char *)".notdef"; + type1->encoding.char_name [charcode] = ".notdef"; - char_name = loader.encoding_table.elements[charcode]; if ( char_name ) for ( idx = 0; idx < type1->num_glyphs; idx++ ) { - glyph_name = (FT_Byte*)type1->glyph_names[idx]; - if ( ft_strcmp( (const char*)char_name, - (const char*)glyph_name ) == 0 ) + const FT_String* glyph_name = type1->glyph_names[idx]; + + + if ( ft_strcmp( char_name, glyph_name ) == 0 ) { type1->encoding.char_index[charcode] = (FT_UShort)idx; - type1->encoding.char_name [charcode] = (char*)glyph_name; + type1->encoding.char_name [charcode] = glyph_name; /* Change min/max encoded char only if glyph name is */ /* not /.notdef */ - if ( ft_strcmp( (const char*)".notdef", - (const char*)glyph_name ) != 0 ) + if ( ft_strcmp( ".notdef", glyph_name ) != 0 ) { if ( charcode < min_char ) min_char = charcode; diff --git a/thirdparty/freetype/src/type42/t42parse.c b/thirdparty/freetype/src/type42/t42parse.c index b653a133a5..c47a77786d 100644 --- a/thirdparty/freetype/src/type42/t42parse.c +++ b/thirdparty/freetype/src/type42/t42parse.c @@ -226,7 +226,8 @@ if ( !parser->in_memory ) FT_FREE( parser->base_dict ); - parser->root.funcs.done( &parser->root ); + if ( parser->root.funcs.done ) + parser->root.funcs.done( &parser->root ); } @@ -373,12 +374,7 @@ /* We need to `zero' out encoding_table.elements */ for ( n = 0; n < count; n++ ) - { - char* notdef = (char *)".notdef"; - - - (void)T1_Add_Table( char_table, n, notdef, 8 ); - } + (void)T1_Add_Table( char_table, n, ".notdef", 8 ); /* Now we need to read records of the form */ /* */ @@ -1021,8 +1017,7 @@ } /* if /.notdef does not occupy index 0, do our magic. */ - if ( ft_strcmp( (const char*)".notdef", - (const char*)name_table->elements[0] ) ) + if ( ft_strcmp( ".notdef", (const char*)name_table->elements[0] ) ) { /* Swap glyph in index 0 with /.notdef glyph. First, add index 0 */ /* name and code entries to swap_table. Then place notdef_index */ diff --git a/thirdparty/glad/KHR/khrplatform.h b/thirdparty/glad/KHR/khrplatform.h index 975bbffed6..5b55ea2b98 100644 --- a/thirdparty/glad/KHR/khrplatform.h +++ b/thirdparty/glad/KHR/khrplatform.h @@ -90,12 +90,20 @@ * int arg2) KHRONOS_APIATTRIBUTES; */ +#if defined(__SCITECH_SNAP__) && !defined(KHRONOS_STATIC) +# define KHRONOS_STATIC 1 +#endif + /*------------------------------------------------------------------------- * Definition of KHRONOS_APICALL *------------------------------------------------------------------------- * This precedes the return type of the function in the function prototype. */ -#if defined(_WIN32) && !defined(__SCITECH_SNAP__) +#if defined(KHRONOS_STATIC) + /* If the preprocessor constant KHRONOS_STATIC is defined, make the + * header compatible with static linking. */ +# define KHRONOS_APICALL +#elif defined(_WIN32) # define KHRONOS_APICALL __declspec(dllimport) #elif defined (__SYMBIAN32__) # define KHRONOS_APICALL IMPORT_C @@ -111,7 +119,7 @@ * This follows the return type of the function and precedes the function * name in the function prototype. */ -#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__) +#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(KHRONOS_STATIC) /* Win32 but not WinCE */ # define KHRONOS_APIENTRY __stdcall #else diff --git a/thirdparty/glad/glad.c b/thirdparty/glad/glad.c index 9704c1079f..08c9c7e228 100644 --- a/thirdparty/glad/glad.c +++ b/thirdparty/glad/glad.c @@ -1,6 +1,6 @@ /* - OpenGL loader generated by glad 0.1.29 on Wed May 1 23:16:34 2019. + OpenGL loader generated by glad 0.1.31 on Thu Jul 11 10:09:18 2019. Language/Generator: C/C++ Specification: gl diff --git a/thirdparty/glad/glad/glad.h b/thirdparty/glad/glad/glad.h index b398faf627..acf96d8cd9 100644 --- a/thirdparty/glad/glad/glad.h +++ b/thirdparty/glad/glad/glad.h @@ -1,6 +1,6 @@ /* - OpenGL loader generated by glad 0.1.29 on Wed May 1 23:16:34 2019. + OpenGL loader generated by glad 0.1.31 on Thu Jul 11 10:09:18 2019. Language/Generator: C/C++ Specification: gl @@ -33,13 +33,7 @@ #define __gl_h_ #if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN 1 -#endif -#ifndef NOMINMAX -#define NOMINMAX 1 -#endif -#include <windows.h> +#define APIENTRY __stdcall #endif #ifndef APIENTRY diff --git a/thirdparty/mbedtls/include/mbedtls/aes.h b/thirdparty/mbedtls/include/mbedtls/aes.h index b42e564efc..94e7282d36 100644 --- a/thirdparty/mbedtls/include/mbedtls/aes.h +++ b/thirdparty/mbedtls/include/mbedtls/aes.h @@ -655,6 +655,8 @@ MBEDTLS_DEPRECATED void mbedtls_aes_decrypt( mbedtls_aes_context *ctx, #undef MBEDTLS_DEPRECATED #endif /* !MBEDTLS_DEPRECATED_REMOVED */ + +#if defined(MBEDTLS_SELF_TEST) /** * \brief Checkup routine. * @@ -663,6 +665,8 @@ MBEDTLS_DEPRECATED void mbedtls_aes_decrypt( mbedtls_aes_context *ctx, */ int mbedtls_aes_self_test( int verbose ); +#endif /* MBEDTLS_SELF_TEST */ + #ifdef __cplusplus } #endif diff --git a/thirdparty/mbedtls/include/mbedtls/aesni.h b/thirdparty/mbedtls/include/mbedtls/aesni.h index 0196f49b87..a4ca012f8a 100644 --- a/thirdparty/mbedtls/include/mbedtls/aesni.h +++ b/thirdparty/mbedtls/include/mbedtls/aesni.h @@ -27,6 +27,12 @@ #ifndef MBEDTLS_AESNI_H #define MBEDTLS_AESNI_H +#if !defined(MBEDTLS_CONFIG_FILE) +#include "config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + #include "aes.h" #define MBEDTLS_AESNI_AES 0x02000000u diff --git a/thirdparty/mbedtls/include/mbedtls/arc4.h b/thirdparty/mbedtls/include/mbedtls/arc4.h index c43f4065f1..fb044d5b7f 100644 --- a/thirdparty/mbedtls/include/mbedtls/arc4.h +++ b/thirdparty/mbedtls/include/mbedtls/arc4.h @@ -123,6 +123,8 @@ void mbedtls_arc4_setup( mbedtls_arc4_context *ctx, const unsigned char *key, int mbedtls_arc4_crypt( mbedtls_arc4_context *ctx, size_t length, const unsigned char *input, unsigned char *output ); +#if defined(MBEDTLS_SELF_TEST) + /** * \brief Checkup routine * @@ -135,6 +137,8 @@ int mbedtls_arc4_crypt( mbedtls_arc4_context *ctx, size_t length, const unsigned */ int mbedtls_arc4_self_test( int verbose ); +#endif /* MBEDTLS_SELF_TEST */ + #ifdef __cplusplus } #endif diff --git a/thirdparty/mbedtls/include/mbedtls/asn1write.h b/thirdparty/mbedtls/include/mbedtls/asn1write.h index 76c1780b59..a194243696 100644 --- a/thirdparty/mbedtls/include/mbedtls/asn1write.h +++ b/thirdparty/mbedtls/include/mbedtls/asn1write.h @@ -24,14 +24,21 @@ #ifndef MBEDTLS_ASN1_WRITE_H #define MBEDTLS_ASN1_WRITE_H +#if !defined(MBEDTLS_CONFIG_FILE) +#include "config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + #include "asn1.h" #define MBEDTLS_ASN1_CHK_ADD(g, f) \ - do { \ - if( ( ret = f ) < 0 ) \ + do \ + { \ + if( ( ret = (f) ) < 0 ) \ return( ret ); \ else \ - g += ret; \ + (g) += ret; \ } while( 0 ) #ifdef __cplusplus diff --git a/thirdparty/mbedtls/include/mbedtls/base64.h b/thirdparty/mbedtls/include/mbedtls/base64.h index 7a64f52163..0d024164c5 100644 --- a/thirdparty/mbedtls/include/mbedtls/base64.h +++ b/thirdparty/mbedtls/include/mbedtls/base64.h @@ -24,6 +24,12 @@ #ifndef MBEDTLS_BASE64_H #define MBEDTLS_BASE64_H +#if !defined(MBEDTLS_CONFIG_FILE) +#include "config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + #include <stddef.h> #define MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL -0x002A /**< Output buffer too small. */ @@ -75,6 +81,7 @@ int mbedtls_base64_encode( unsigned char *dst, size_t dlen, size_t *olen, int mbedtls_base64_decode( unsigned char *dst, size_t dlen, size_t *olen, const unsigned char *src, size_t slen ); +#if defined(MBEDTLS_SELF_TEST) /** * \brief Checkup routine * @@ -82,6 +89,8 @@ int mbedtls_base64_decode( unsigned char *dst, size_t dlen, size_t *olen, */ int mbedtls_base64_self_test( int verbose ); +#endif /* MBEDTLS_SELF_TEST */ + #ifdef __cplusplus } #endif diff --git a/thirdparty/mbedtls/include/mbedtls/bignum.h b/thirdparty/mbedtls/include/mbedtls/bignum.h index 141a8e9adf..1c8607264f 100644 --- a/thirdparty/mbedtls/include/mbedtls/bignum.h +++ b/thirdparty/mbedtls/include/mbedtls/bignum.h @@ -46,7 +46,12 @@ #define MBEDTLS_ERR_MPI_NOT_ACCEPTABLE -0x000E /**< The input arguments are not acceptable. */ #define MBEDTLS_ERR_MPI_ALLOC_FAILED -0x0010 /**< Memory allocation failed. */ -#define MBEDTLS_MPI_CHK(f) do { if( ( ret = f ) != 0 ) goto cleanup; } while( 0 ) +#define MBEDTLS_MPI_CHK(f) \ + do \ + { \ + if( ( ret = (f) ) != 0 ) \ + goto cleanup; \ + } while( 0 ) /* * Maximum size MPIs are allowed to grow to in number of limbs. @@ -943,6 +948,8 @@ int mbedtls_mpi_gen_prime( mbedtls_mpi *X, size_t nbits, int flags, int (*f_rng)(void *, unsigned char *, size_t), void *p_rng ); +#if defined(MBEDTLS_SELF_TEST) + /** * \brief Checkup routine * @@ -950,6 +957,8 @@ int mbedtls_mpi_gen_prime( mbedtls_mpi *X, size_t nbits, int flags, */ int mbedtls_mpi_self_test( int verbose ); +#endif /* MBEDTLS_SELF_TEST */ + #ifdef __cplusplus } #endif diff --git a/thirdparty/mbedtls/include/mbedtls/bn_mul.h b/thirdparty/mbedtls/include/mbedtls/bn_mul.h index 2f7b72fe4c..c33bd8d4ab 100644 --- a/thirdparty/mbedtls/include/mbedtls/bn_mul.h +++ b/thirdparty/mbedtls/include/mbedtls/bn_mul.h @@ -38,6 +38,12 @@ #ifndef MBEDTLS_BN_MUL_H #define MBEDTLS_BN_MUL_H +#if !defined(MBEDTLS_CONFIG_FILE) +#include "config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + #include "bignum.h" #if defined(MBEDTLS_HAVE_ASM) @@ -750,7 +756,7 @@ "sw $10, %2 \n\t" \ : "=m" (c), "=m" (d), "=m" (s) \ : "m" (s), "m" (d), "m" (c), "m" (b) \ - : "$9", "$10", "$11", "$12", "$13", "$14", "$15" \ + : "$9", "$10", "$11", "$12", "$13", "$14", "$15", "lo", "hi" \ ); #endif /* MIPS */ diff --git a/thirdparty/mbedtls/include/mbedtls/camellia.h b/thirdparty/mbedtls/include/mbedtls/camellia.h index 0f7c42c92d..3eeb66366d 100644 --- a/thirdparty/mbedtls/include/mbedtls/camellia.h +++ b/thirdparty/mbedtls/include/mbedtls/camellia.h @@ -308,6 +308,8 @@ int mbedtls_camellia_crypt_ctr( mbedtls_camellia_context *ctx, unsigned char *output ); #endif /* MBEDTLS_CIPHER_MODE_CTR */ +#if defined(MBEDTLS_SELF_TEST) + /** * \brief Checkup routine * @@ -315,6 +317,8 @@ int mbedtls_camellia_crypt_ctr( mbedtls_camellia_context *ctx, */ int mbedtls_camellia_self_test( int verbose ); +#endif /* MBEDTLS_SELF_TEST */ + #ifdef __cplusplus } #endif diff --git a/thirdparty/mbedtls/include/mbedtls/ccm.h b/thirdparty/mbedtls/include/mbedtls/ccm.h index 3f6b8f6709..f03e3b580e 100644 --- a/thirdparty/mbedtls/include/mbedtls/ccm.h +++ b/thirdparty/mbedtls/include/mbedtls/ccm.h @@ -49,6 +49,12 @@ #ifndef MBEDTLS_CCM_H #define MBEDTLS_CCM_H +#if !defined(MBEDTLS_CONFIG_FILE) +#include "config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + #include "cipher.h" #define MBEDTLS_ERR_CCM_BAD_INPUT -0x000D /**< Bad input parameters to the function. */ diff --git a/thirdparty/mbedtls/include/mbedtls/certs.h b/thirdparty/mbedtls/include/mbedtls/certs.h index 8dab7b5ce8..179ebbbad2 100644 --- a/thirdparty/mbedtls/include/mbedtls/certs.h +++ b/thirdparty/mbedtls/include/mbedtls/certs.h @@ -24,74 +24,226 @@ #ifndef MBEDTLS_CERTS_H #define MBEDTLS_CERTS_H +#if !defined(MBEDTLS_CONFIG_FILE) +#include "config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + #include <stddef.h> #ifdef __cplusplus extern "C" { #endif +/* List of all PEM-encoded CA certificates, terminated by NULL; + * PEM encoded if MBEDTLS_PEM_PARSE_C is enabled, DER encoded + * otherwise. */ +extern const char * mbedtls_test_cas[]; +extern const size_t mbedtls_test_cas_len[]; + +/* List of all DER-encoded CA certificates, terminated by NULL */ +extern const unsigned char * mbedtls_test_cas_der[]; +extern const size_t mbedtls_test_cas_der_len[]; + #if defined(MBEDTLS_PEM_PARSE_C) /* Concatenation of all CA certificates in PEM format if available */ extern const char mbedtls_test_cas_pem[]; extern const size_t mbedtls_test_cas_pem_len; -#endif - -/* List of all CA certificates, terminated by NULL */ -extern const char * mbedtls_test_cas[]; -extern const size_t mbedtls_test_cas_len[]; +#endif /* MBEDTLS_PEM_PARSE_C */ /* - * Convenience for users who just want a certificate: - * RSA by default, or ECDSA if RSA is not available + * CA test certificates */ + +extern const char mbedtls_test_ca_crt_ec_pem[]; +extern const char mbedtls_test_ca_key_ec_pem[]; +extern const char mbedtls_test_ca_pwd_ec_pem[]; +extern const char mbedtls_test_ca_key_rsa_pem[]; +extern const char mbedtls_test_ca_pwd_rsa_pem[]; +extern const char mbedtls_test_ca_crt_rsa_sha1_pem[]; +extern const char mbedtls_test_ca_crt_rsa_sha256_pem[]; + +extern const unsigned char mbedtls_test_ca_crt_ec_der[]; +extern const unsigned char mbedtls_test_ca_key_ec_der[]; +extern const unsigned char mbedtls_test_ca_key_rsa_der[]; +extern const unsigned char mbedtls_test_ca_crt_rsa_sha1_der[]; +extern const unsigned char mbedtls_test_ca_crt_rsa_sha256_der[]; + +extern const size_t mbedtls_test_ca_crt_ec_pem_len; +extern const size_t mbedtls_test_ca_key_ec_pem_len; +extern const size_t mbedtls_test_ca_pwd_ec_pem_len; +extern const size_t mbedtls_test_ca_key_rsa_pem_len; +extern const size_t mbedtls_test_ca_pwd_rsa_pem_len; +extern const size_t mbedtls_test_ca_crt_rsa_sha1_pem_len; +extern const size_t mbedtls_test_ca_crt_rsa_sha256_pem_len; + +extern const size_t mbedtls_test_ca_crt_ec_der_len; +extern const size_t mbedtls_test_ca_key_ec_der_len; +extern const size_t mbedtls_test_ca_pwd_ec_der_len; +extern const size_t mbedtls_test_ca_key_rsa_der_len; +extern const size_t mbedtls_test_ca_pwd_rsa_der_len; +extern const size_t mbedtls_test_ca_crt_rsa_sha1_der_len; +extern const size_t mbedtls_test_ca_crt_rsa_sha256_der_len; + +/* Config-dependent dispatch between PEM and DER encoding + * (PEM if enabled, otherwise DER) */ + +extern const char mbedtls_test_ca_crt_ec[]; +extern const char mbedtls_test_ca_key_ec[]; +extern const char mbedtls_test_ca_pwd_ec[]; +extern const char mbedtls_test_ca_key_rsa[]; +extern const char mbedtls_test_ca_pwd_rsa[]; +extern const char mbedtls_test_ca_crt_rsa_sha1[]; +extern const char mbedtls_test_ca_crt_rsa_sha256[]; + +extern const size_t mbedtls_test_ca_crt_ec_len; +extern const size_t mbedtls_test_ca_key_ec_len; +extern const size_t mbedtls_test_ca_pwd_ec_len; +extern const size_t mbedtls_test_ca_key_rsa_len; +extern const size_t mbedtls_test_ca_pwd_rsa_len; +extern const size_t mbedtls_test_ca_crt_rsa_sha1_len; +extern const size_t mbedtls_test_ca_crt_rsa_sha256_len; + +/* Config-dependent dispatch between SHA-1 and SHA-256 + * (SHA-256 if enabled, otherwise SHA-1) */ + +extern const char mbedtls_test_ca_crt_rsa[]; +extern const size_t mbedtls_test_ca_crt_rsa_len; + +/* Config-dependent dispatch between EC and RSA + * (RSA if enabled, otherwise EC) */ + extern const char * mbedtls_test_ca_crt; -extern const size_t mbedtls_test_ca_crt_len; extern const char * mbedtls_test_ca_key; -extern const size_t mbedtls_test_ca_key_len; extern const char * mbedtls_test_ca_pwd; +extern const size_t mbedtls_test_ca_crt_len; +extern const size_t mbedtls_test_ca_key_len; extern const size_t mbedtls_test_ca_pwd_len; + +/* + * Server test certificates + */ + +extern const char mbedtls_test_srv_crt_ec_pem[]; +extern const char mbedtls_test_srv_key_ec_pem[]; +extern const char mbedtls_test_srv_pwd_ec_pem[]; +extern const char mbedtls_test_srv_key_rsa_pem[]; +extern const char mbedtls_test_srv_pwd_rsa_pem[]; +extern const char mbedtls_test_srv_crt_rsa_sha1_pem[]; +extern const char mbedtls_test_srv_crt_rsa_sha256_pem[]; + +extern const unsigned char mbedtls_test_srv_crt_ec_der[]; +extern const unsigned char mbedtls_test_srv_key_ec_der[]; +extern const unsigned char mbedtls_test_srv_key_rsa_der[]; +extern const unsigned char mbedtls_test_srv_crt_rsa_sha1_der[]; +extern const unsigned char mbedtls_test_srv_crt_rsa_sha256_der[]; + +extern const size_t mbedtls_test_srv_crt_ec_pem_len; +extern const size_t mbedtls_test_srv_key_ec_pem_len; +extern const size_t mbedtls_test_srv_pwd_ec_pem_len; +extern const size_t mbedtls_test_srv_key_rsa_pem_len; +extern const size_t mbedtls_test_srv_pwd_rsa_pem_len; +extern const size_t mbedtls_test_srv_crt_rsa_sha1_pem_len; +extern const size_t mbedtls_test_srv_crt_rsa_sha256_pem_len; + +extern const size_t mbedtls_test_srv_crt_ec_der_len; +extern const size_t mbedtls_test_srv_key_ec_der_len; +extern const size_t mbedtls_test_srv_pwd_ec_der_len; +extern const size_t mbedtls_test_srv_key_rsa_der_len; +extern const size_t mbedtls_test_srv_pwd_rsa_der_len; +extern const size_t mbedtls_test_srv_crt_rsa_sha1_der_len; +extern const size_t mbedtls_test_srv_crt_rsa_sha256_der_len; + +/* Config-dependent dispatch between PEM and DER encoding + * (PEM if enabled, otherwise DER) */ + +extern const char mbedtls_test_srv_crt_ec[]; +extern const char mbedtls_test_srv_key_ec[]; +extern const char mbedtls_test_srv_pwd_ec[]; +extern const char mbedtls_test_srv_key_rsa[]; +extern const char mbedtls_test_srv_pwd_rsa[]; +extern const char mbedtls_test_srv_crt_rsa_sha1[]; +extern const char mbedtls_test_srv_crt_rsa_sha256[]; + +extern const size_t mbedtls_test_srv_crt_ec_len; +extern const size_t mbedtls_test_srv_key_ec_len; +extern const size_t mbedtls_test_srv_pwd_ec_len; +extern const size_t mbedtls_test_srv_key_rsa_len; +extern const size_t mbedtls_test_srv_pwd_rsa_len; +extern const size_t mbedtls_test_srv_crt_rsa_sha1_len; +extern const size_t mbedtls_test_srv_crt_rsa_sha256_len; + +/* Config-dependent dispatch between SHA-1 and SHA-256 + * (SHA-256 if enabled, otherwise SHA-1) */ + +extern const char mbedtls_test_srv_crt_rsa[]; +extern const size_t mbedtls_test_srv_crt_rsa_len; + +/* Config-dependent dispatch between EC and RSA + * (RSA if enabled, otherwise EC) */ + extern const char * mbedtls_test_srv_crt; -extern const size_t mbedtls_test_srv_crt_len; extern const char * mbedtls_test_srv_key; +extern const char * mbedtls_test_srv_pwd; +extern const size_t mbedtls_test_srv_crt_len; extern const size_t mbedtls_test_srv_key_len; -extern const char * mbedtls_test_cli_crt; -extern const size_t mbedtls_test_cli_crt_len; -extern const char * mbedtls_test_cli_key; -extern const size_t mbedtls_test_cli_key_len; +extern const size_t mbedtls_test_srv_pwd_len; + +/* + * Client test certificates + */ + +extern const char mbedtls_test_cli_crt_ec_pem[]; +extern const char mbedtls_test_cli_key_ec_pem[]; +extern const char mbedtls_test_cli_pwd_ec_pem[]; +extern const char mbedtls_test_cli_key_rsa_pem[]; +extern const char mbedtls_test_cli_pwd_rsa_pem[]; +extern const char mbedtls_test_cli_crt_rsa_pem[]; + +extern const unsigned char mbedtls_test_cli_crt_ec_der[]; +extern const unsigned char mbedtls_test_cli_key_ec_der[]; +extern const unsigned char mbedtls_test_cli_key_rsa_der[]; +extern const unsigned char mbedtls_test_cli_crt_rsa_der[]; + +extern const size_t mbedtls_test_cli_crt_ec_pem_len; +extern const size_t mbedtls_test_cli_key_ec_pem_len; +extern const size_t mbedtls_test_cli_pwd_ec_pem_len; +extern const size_t mbedtls_test_cli_key_rsa_pem_len; +extern const size_t mbedtls_test_cli_pwd_rsa_pem_len; +extern const size_t mbedtls_test_cli_crt_rsa_pem_len; + +extern const size_t mbedtls_test_cli_crt_ec_der_len; +extern const size_t mbedtls_test_cli_key_ec_der_len; +extern const size_t mbedtls_test_cli_key_rsa_der_len; +extern const size_t mbedtls_test_cli_crt_rsa_der_len; + +/* Config-dependent dispatch between PEM and DER encoding + * (PEM if enabled, otherwise DER) */ + +extern const char mbedtls_test_cli_crt_ec[]; +extern const char mbedtls_test_cli_key_ec[]; +extern const char mbedtls_test_cli_pwd_ec[]; +extern const char mbedtls_test_cli_key_rsa[]; +extern const char mbedtls_test_cli_pwd_rsa[]; +extern const char mbedtls_test_cli_crt_rsa[]; -#if defined(MBEDTLS_ECDSA_C) -extern const char mbedtls_test_ca_crt_ec[]; -extern const size_t mbedtls_test_ca_crt_ec_len; -extern const char mbedtls_test_ca_key_ec[]; -extern const size_t mbedtls_test_ca_key_ec_len; -extern const char mbedtls_test_ca_pwd_ec[]; -extern const size_t mbedtls_test_ca_pwd_ec_len; -extern const char mbedtls_test_srv_crt_ec[]; -extern const size_t mbedtls_test_srv_crt_ec_len; -extern const char mbedtls_test_srv_key_ec[]; -extern const size_t mbedtls_test_srv_key_ec_len; -extern const char mbedtls_test_cli_crt_ec[]; extern const size_t mbedtls_test_cli_crt_ec_len; -extern const char mbedtls_test_cli_key_ec[]; extern const size_t mbedtls_test_cli_key_ec_len; -#endif - -#if defined(MBEDTLS_RSA_C) -extern const char mbedtls_test_ca_crt_rsa[]; -extern const size_t mbedtls_test_ca_crt_rsa_len; -extern const char mbedtls_test_ca_key_rsa[]; -extern const size_t mbedtls_test_ca_key_rsa_len; -extern const char mbedtls_test_ca_pwd_rsa[]; -extern const size_t mbedtls_test_ca_pwd_rsa_len; -extern const char mbedtls_test_srv_crt_rsa[]; -extern const size_t mbedtls_test_srv_crt_rsa_len; -extern const char mbedtls_test_srv_key_rsa[]; -extern const size_t mbedtls_test_srv_key_rsa_len; -extern const char mbedtls_test_cli_crt_rsa[]; -extern const size_t mbedtls_test_cli_crt_rsa_len; -extern const char mbedtls_test_cli_key_rsa[]; +extern const size_t mbedtls_test_cli_pwd_ec_len; extern const size_t mbedtls_test_cli_key_rsa_len; -#endif +extern const size_t mbedtls_test_cli_pwd_rsa_len; +extern const size_t mbedtls_test_cli_crt_rsa_len; + +/* Config-dependent dispatch between EC and RSA + * (RSA if enabled, otherwise EC) */ + +extern const char * mbedtls_test_cli_crt; +extern const char * mbedtls_test_cli_key; +extern const char * mbedtls_test_cli_pwd; +extern const size_t mbedtls_test_cli_crt_len; +extern const size_t mbedtls_test_cli_key_len; +extern const size_t mbedtls_test_cli_pwd_len; #ifdef __cplusplus } diff --git a/thirdparty/mbedtls/include/mbedtls/cipher.h b/thirdparty/mbedtls/include/mbedtls/cipher.h index 922b6c32c6..082a691741 100644 --- a/thirdparty/mbedtls/include/mbedtls/cipher.h +++ b/thirdparty/mbedtls/include/mbedtls/cipher.h @@ -36,7 +36,7 @@ #endif #include <stddef.h> -#include "mbedtls/platform_util.h" +#include "platform_util.h" #if defined(MBEDTLS_GCM_C) || defined(MBEDTLS_CCM_C) || defined(MBEDTLS_CHACHAPOLY_C) #define MBEDTLS_CIPHER_MODE_AEAD diff --git a/thirdparty/mbedtls/include/mbedtls/cmac.h b/thirdparty/mbedtls/include/mbedtls/cmac.h index c196793531..9d42b3f209 100644 --- a/thirdparty/mbedtls/include/mbedtls/cmac.h +++ b/thirdparty/mbedtls/include/mbedtls/cmac.h @@ -28,6 +28,12 @@ #ifndef MBEDTLS_CMAC_H #define MBEDTLS_CMAC_H +#if !defined(MBEDTLS_CONFIG_FILE) +#include "config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + #include "cipher.h" #ifdef __cplusplus diff --git a/thirdparty/mbedtls/include/mbedtls/compat-1.3.h b/thirdparty/mbedtls/include/mbedtls/compat-1.3.h index 213b691403..a58b47243d 100644 --- a/thirdparty/mbedtls/include/mbedtls/compat-1.3.h +++ b/thirdparty/mbedtls/include/mbedtls/compat-1.3.h @@ -25,6 +25,12 @@ * This file is part of mbed TLS (https://tls.mbed.org) */ +#if !defined(MBEDTLS_CONFIG_FILE) +#include "config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + #if ! defined(MBEDTLS_DEPRECATED_REMOVED) #if defined(MBEDTLS_DEPRECATED_WARNING) diff --git a/thirdparty/mbedtls/include/mbedtls/config.h b/thirdparty/mbedtls/include/mbedtls/config.h index 51d66291a5..e16e1e53d3 100644 --- a/thirdparty/mbedtls/include/mbedtls/config.h +++ b/thirdparty/mbedtls/include/mbedtls/config.h @@ -687,6 +687,26 @@ #define MBEDTLS_REMOVE_ARC4_CIPHERSUITES /** + * \def MBEDTLS_REMOVE_3DES_CIPHERSUITES + * + * Remove 3DES ciphersuites by default in SSL / TLS. + * This flag removes the ciphersuites based on 3DES from the default list as + * returned by mbedtls_ssl_list_ciphersuites(). However, it is still possible + * to enable (some of) them with mbedtls_ssl_conf_ciphersuites() by including + * them explicitly. + * + * A man-in-the-browser attacker can recover authentication tokens sent through + * a TLS connection using a 3DES based cipher suite (see "On the Practical + * (In-)Security of 64-bit Block Ciphers" by Karthikeyan Bhargavan and Gaëtan + * Leurent, see https://sweet32.info/SWEET32_CCS16.pdf). If this attack falls + * in your threat model or you are unsure, then you should keep this option + * enabled to remove 3DES based cipher suites. + * + * Comment this macro to keep 3DES in the default ciphersuite list. + */ +#define MBEDTLS_REMOVE_3DES_CIPHERSUITES + +/** * \def MBEDTLS_ECP_DP_SECP192R1_ENABLED * * MBEDTLS_ECP_XXXX_ENABLED: Enables specific curves within the Elliptic Curve @@ -1622,7 +1642,9 @@ * * Uncomment this to enable pthread mutexes. */ +// -- GODOT start -- //#define MBEDTLS_THREADING_PTHREAD +// -- GODOT end -- /** * \def MBEDTLS_VERSION_FEATURES @@ -2816,7 +2838,9 @@ * * Enable this layer to allow use of mutexes within mbed TLS */ +// -- GODOT start -- //#define MBEDTLS_THREADING_C +// -- GODOT end -- /** * \def MBEDTLS_TIMING_C diff --git a/thirdparty/mbedtls/include/mbedtls/ctr_drbg.h b/thirdparty/mbedtls/include/mbedtls/ctr_drbg.h index 10f9389d9f..cc3df7b113 100644 --- a/thirdparty/mbedtls/include/mbedtls/ctr_drbg.h +++ b/thirdparty/mbedtls/include/mbedtls/ctr_drbg.h @@ -36,6 +36,12 @@ #ifndef MBEDTLS_CTR_DRBG_H #define MBEDTLS_CTR_DRBG_H +#if !defined(MBEDTLS_CONFIG_FILE) +#include "config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + #include "aes.h" #if defined(MBEDTLS_THREADING_C) @@ -350,6 +356,8 @@ int mbedtls_ctr_drbg_write_seed_file( mbedtls_ctr_drbg_context *ctx, const char int mbedtls_ctr_drbg_update_seed_file( mbedtls_ctr_drbg_context *ctx, const char *path ); #endif /* MBEDTLS_FS_IO */ +#if defined(MBEDTLS_SELF_TEST) + /** * \brief The CTR_DRBG checkup routine. * @@ -358,6 +366,8 @@ int mbedtls_ctr_drbg_update_seed_file( mbedtls_ctr_drbg_context *ctx, const char */ int mbedtls_ctr_drbg_self_test( int verbose ); +#endif /* MBEDTLS_SELF_TEST */ + /* Internal functions (do not call directly) */ int mbedtls_ctr_drbg_seed_entropy_len( mbedtls_ctr_drbg_context *, int (*)(void *, unsigned char *, size_t), void *, diff --git a/thirdparty/mbedtls/include/mbedtls/des.h b/thirdparty/mbedtls/include/mbedtls/des.h index d62042d14e..54e6b7894b 100644 --- a/thirdparty/mbedtls/include/mbedtls/des.h +++ b/thirdparty/mbedtls/include/mbedtls/des.h @@ -338,6 +338,8 @@ int mbedtls_des3_crypt_cbc( mbedtls_des3_context *ctx, void mbedtls_des_setkey( uint32_t SK[32], const unsigned char key[MBEDTLS_DES_KEY_SIZE] ); +#if defined(MBEDTLS_SELF_TEST) + /** * \brief Checkup routine * @@ -345,6 +347,8 @@ void mbedtls_des_setkey( uint32_t SK[32], */ int mbedtls_des_self_test( int verbose ); +#endif /* MBEDTLS_SELF_TEST */ + #ifdef __cplusplus } #endif diff --git a/thirdparty/mbedtls/include/mbedtls/dhm.h b/thirdparty/mbedtls/include/mbedtls/dhm.h index a5452c199a..2909f5fbc8 100644 --- a/thirdparty/mbedtls/include/mbedtls/dhm.h +++ b/thirdparty/mbedtls/include/mbedtls/dhm.h @@ -334,6 +334,8 @@ int mbedtls_dhm_parse_dhmfile( mbedtls_dhm_context *dhm, const char *path ); #endif /* MBEDTLS_FS_IO */ #endif /* MBEDTLS_ASN1_PARSE_C */ +#if defined(MBEDTLS_SELF_TEST) + /** * \brief The DMH checkup routine. * @@ -342,6 +344,7 @@ int mbedtls_dhm_parse_dhmfile( mbedtls_dhm_context *dhm, const char *path ); */ int mbedtls_dhm_self_test( int verbose ); +#endif /* MBEDTLS_SELF_TEST */ #ifdef __cplusplus } #endif diff --git a/thirdparty/mbedtls/include/mbedtls/ecdh.h b/thirdparty/mbedtls/include/mbedtls/ecdh.h index 05b2b03970..4479a1d46f 100644 --- a/thirdparty/mbedtls/include/mbedtls/ecdh.h +++ b/thirdparty/mbedtls/include/mbedtls/ecdh.h @@ -34,6 +34,12 @@ #ifndef MBEDTLS_ECDH_H #define MBEDTLS_ECDH_H +#if !defined(MBEDTLS_CONFIG_FILE) +#include "config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + #include "ecp.h" /* diff --git a/thirdparty/mbedtls/include/mbedtls/ecdsa.h b/thirdparty/mbedtls/include/mbedtls/ecdsa.h index 40fdab3729..f8b28507c2 100644 --- a/thirdparty/mbedtls/include/mbedtls/ecdsa.h +++ b/thirdparty/mbedtls/include/mbedtls/ecdsa.h @@ -32,6 +32,12 @@ #ifndef MBEDTLS_ECDSA_H #define MBEDTLS_ECDSA_H +#if !defined(MBEDTLS_CONFIG_FILE) +#include "config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + #include "ecp.h" #include "md.h" diff --git a/thirdparty/mbedtls/include/mbedtls/ecjpake.h b/thirdparty/mbedtls/include/mbedtls/ecjpake.h index b967af8385..3d8d02ae64 100644 --- a/thirdparty/mbedtls/include/mbedtls/ecjpake.h +++ b/thirdparty/mbedtls/include/mbedtls/ecjpake.h @@ -40,6 +40,11 @@ * The payloads are serialized in a way suitable for use in TLS, but could * also be use outside TLS. */ +#if !defined(MBEDTLS_CONFIG_FILE) +#include "config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif #include "ecp.h" #include "md.h" diff --git a/thirdparty/mbedtls/include/mbedtls/ecp.h b/thirdparty/mbedtls/include/mbedtls/ecp.h index de3a343cb6..065a4cc0b9 100644 --- a/thirdparty/mbedtls/include/mbedtls/ecp.h +++ b/thirdparty/mbedtls/include/mbedtls/ecp.h @@ -36,6 +36,12 @@ #ifndef MBEDTLS_ECP_H #define MBEDTLS_ECP_H +#if !defined(MBEDTLS_CONFIG_FILE) +#include "config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + #include "bignum.h" /* @@ -189,6 +195,68 @@ typedef struct mbedtls_ecp_group } mbedtls_ecp_group; +/** + * \name SECTION: Module settings + * + * The configuration options you can set for this module are in this section. + * Either change them in config.h, or define them using the compiler command line. + * \{ + */ + +#if !defined(MBEDTLS_ECP_MAX_BITS) +/** + * The maximum size of the groups, that is, of \c N and \c P. + */ +#define MBEDTLS_ECP_MAX_BITS 521 /**< The maximum size of groups, in bits. */ +#endif + +#define MBEDTLS_ECP_MAX_BYTES ( ( MBEDTLS_ECP_MAX_BITS + 7 ) / 8 ) +#define MBEDTLS_ECP_MAX_PT_LEN ( 2 * MBEDTLS_ECP_MAX_BYTES + 1 ) + +#if !defined(MBEDTLS_ECP_WINDOW_SIZE) +/* + * Maximum "window" size used for point multiplication. + * Default: 6. + * Minimum value: 2. Maximum value: 7. + * + * Result is an array of at most ( 1 << ( MBEDTLS_ECP_WINDOW_SIZE - 1 ) ) + * points used for point multiplication. This value is directly tied to EC + * peak memory usage, so decreasing it by one should roughly cut memory usage + * by two (if large curves are in use). + * + * Reduction in size may reduce speed, but larger curves are impacted first. + * Sample performances (in ECDHE handshakes/s, with FIXED_POINT_OPTIM = 1): + * w-size: 6 5 4 3 2 + * 521 145 141 135 120 97 + * 384 214 209 198 177 146 + * 256 320 320 303 262 226 + * 224 475 475 453 398 342 + * 192 640 640 633 587 476 + */ +#define MBEDTLS_ECP_WINDOW_SIZE 6 /**< The maximum window size used. */ +#endif /* MBEDTLS_ECP_WINDOW_SIZE */ + +#if !defined(MBEDTLS_ECP_FIXED_POINT_OPTIM) +/* + * Trade memory for speed on fixed-point multiplication. + * + * This speeds up repeated multiplication of the generator (that is, the + * multiplication in ECDSA signatures, and half of the multiplications in + * ECDSA verification and ECDHE) by a factor roughly 3 to 4. + * + * The cost is increasing EC peak memory usage by a factor roughly 2. + * + * Change this value to 0 to reduce peak memory usage. + */ +#define MBEDTLS_ECP_FIXED_POINT_OPTIM 1 /**< Enable fixed-point speed-up. */ +#endif /* MBEDTLS_ECP_FIXED_POINT_OPTIM */ + +/* \} name SECTION: Module settings */ + +#else /* MBEDTLS_ECP_ALT */ +#include "ecp_alt.h" +#endif /* MBEDTLS_ECP_ALT */ + #if defined(MBEDTLS_ECP_RESTARTABLE) /** @@ -254,68 +322,6 @@ typedef void mbedtls_ecp_restart_ctx; #endif /* MBEDTLS_ECP_RESTARTABLE */ /** - * \name SECTION: Module settings - * - * The configuration options you can set for this module are in this section. - * Either change them in config.h, or define them using the compiler command line. - * \{ - */ - -#if !defined(MBEDTLS_ECP_MAX_BITS) -/** - * The maximum size of the groups, that is, of \c N and \c P. - */ -#define MBEDTLS_ECP_MAX_BITS 521 /**< The maximum size of groups, in bits. */ -#endif - -#define MBEDTLS_ECP_MAX_BYTES ( ( MBEDTLS_ECP_MAX_BITS + 7 ) / 8 ) -#define MBEDTLS_ECP_MAX_PT_LEN ( 2 * MBEDTLS_ECP_MAX_BYTES + 1 ) - -#if !defined(MBEDTLS_ECP_WINDOW_SIZE) -/* - * Maximum "window" size used for point multiplication. - * Default: 6. - * Minimum value: 2. Maximum value: 7. - * - * Result is an array of at most ( 1 << ( MBEDTLS_ECP_WINDOW_SIZE - 1 ) ) - * points used for point multiplication. This value is directly tied to EC - * peak memory usage, so decreasing it by one should roughly cut memory usage - * by two (if large curves are in use). - * - * Reduction in size may reduce speed, but larger curves are impacted first. - * Sample performances (in ECDHE handshakes/s, with FIXED_POINT_OPTIM = 1): - * w-size: 6 5 4 3 2 - * 521 145 141 135 120 97 - * 384 214 209 198 177 146 - * 256 320 320 303 262 226 - * 224 475 475 453 398 342 - * 192 640 640 633 587 476 - */ -#define MBEDTLS_ECP_WINDOW_SIZE 6 /**< The maximum window size used. */ -#endif /* MBEDTLS_ECP_WINDOW_SIZE */ - -#if !defined(MBEDTLS_ECP_FIXED_POINT_OPTIM) -/* - * Trade memory for speed on fixed-point multiplication. - * - * This speeds up repeated multiplication of the generator (that is, the - * multiplication in ECDSA signatures, and half of the multiplications in - * ECDSA verification and ECDHE) by a factor roughly 3 to 4. - * - * The cost is increasing EC peak memory usage by a factor roughly 2. - * - * Change this value to 0 to reduce peak memory usage. - */ -#define MBEDTLS_ECP_FIXED_POINT_OPTIM 1 /**< Enable fixed-point speed-up. */ -#endif /* MBEDTLS_ECP_FIXED_POINT_OPTIM */ - -/* \} name SECTION: Module settings */ - -#else /* MBEDTLS_ECP_ALT */ -#include "ecp_alt.h" -#endif /* MBEDTLS_ECP_ALT */ - -/** * \brief The ECP key-pair structure. * * A generic key-pair that may be used for ECDSA and fixed ECDH, for example. @@ -476,7 +482,7 @@ void mbedtls_ecp_point_init( mbedtls_ecp_point *pt ); * * \note After this function is called, domain parameters * for various ECP groups can be loaded through the - * mbedtls_ecp_load() or mbedtls_ecp_tls_read_group() + * mbedtls_ecp_group_load() or mbedtls_ecp_tls_read_group() * functions. */ void mbedtls_ecp_group_init( mbedtls_ecp_group *grp ); diff --git a/thirdparty/mbedtls/include/mbedtls/ecp_internal.h b/thirdparty/mbedtls/include/mbedtls/ecp_internal.h index 18040697ad..7625ed48e1 100644 --- a/thirdparty/mbedtls/include/mbedtls/ecp_internal.h +++ b/thirdparty/mbedtls/include/mbedtls/ecp_internal.h @@ -61,6 +61,12 @@ #ifndef MBEDTLS_ECP_INTERNAL_H #define MBEDTLS_ECP_INTERNAL_H +#if !defined(MBEDTLS_CONFIG_FILE) +#include "config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + #if defined(MBEDTLS_ECP_INTERNAL_ALT) /** diff --git a/thirdparty/mbedtls/include/mbedtls/error.h b/thirdparty/mbedtls/include/mbedtls/error.h index 647a11a566..bee0fe485a 100644 --- a/thirdparty/mbedtls/include/mbedtls/error.h +++ b/thirdparty/mbedtls/include/mbedtls/error.h @@ -24,6 +24,12 @@ #ifndef MBEDTLS_ERROR_H #define MBEDTLS_ERROR_H +#if !defined(MBEDTLS_CONFIG_FILE) +#include "config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + #include <stddef.h> /** diff --git a/thirdparty/mbedtls/include/mbedtls/gcm.h b/thirdparty/mbedtls/include/mbedtls/gcm.h index fccabb0d97..fd130abd7c 100644 --- a/thirdparty/mbedtls/include/mbedtls/gcm.h +++ b/thirdparty/mbedtls/include/mbedtls/gcm.h @@ -33,6 +33,12 @@ #ifndef MBEDTLS_GCM_H #define MBEDTLS_GCM_H +#if !defined(MBEDTLS_CONFIG_FILE) +#include "config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + #include "cipher.h" #include <stdint.h> @@ -300,6 +306,8 @@ int mbedtls_gcm_finish( mbedtls_gcm_context *ctx, */ void mbedtls_gcm_free( mbedtls_gcm_context *ctx ); +#if defined(MBEDTLS_SELF_TEST) + /** * \brief The GCM checkup routine. * @@ -308,6 +316,8 @@ void mbedtls_gcm_free( mbedtls_gcm_context *ctx ); */ int mbedtls_gcm_self_test( int verbose ); +#endif /* MBEDTLS_SELF_TEST */ + #ifdef __cplusplus } #endif diff --git a/thirdparty/mbedtls/include/mbedtls/havege.h b/thirdparty/mbedtls/include/mbedtls/havege.h index 57e8c40943..4c1c86087a 100644 --- a/thirdparty/mbedtls/include/mbedtls/havege.h +++ b/thirdparty/mbedtls/include/mbedtls/havege.h @@ -24,6 +24,12 @@ #ifndef MBEDTLS_HAVEGE_H #define MBEDTLS_HAVEGE_H +#if !defined(MBEDTLS_CONFIG_FILE) +#include "config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + #include <stddef.h> #define MBEDTLS_HAVEGE_COLLECT_SIZE 1024 diff --git a/thirdparty/mbedtls/include/mbedtls/hkdf.h b/thirdparty/mbedtls/include/mbedtls/hkdf.h index e6ed7cde97..40ee64eb03 100644 --- a/thirdparty/mbedtls/include/mbedtls/hkdf.h +++ b/thirdparty/mbedtls/include/mbedtls/hkdf.h @@ -27,6 +27,12 @@ #ifndef MBEDTLS_HKDF_H #define MBEDTLS_HKDF_H +#if !defined(MBEDTLS_CONFIG_FILE) +#include "config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + #include "md.h" /** diff --git a/thirdparty/mbedtls/include/mbedtls/hmac_drbg.h b/thirdparty/mbedtls/include/mbedtls/hmac_drbg.h index 146367b9de..7eae32bbd6 100644 --- a/thirdparty/mbedtls/include/mbedtls/hmac_drbg.h +++ b/thirdparty/mbedtls/include/mbedtls/hmac_drbg.h @@ -24,6 +24,12 @@ #ifndef MBEDTLS_HMAC_DRBG_H #define MBEDTLS_HMAC_DRBG_H +#if !defined(MBEDTLS_CONFIG_FILE) +#include "config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + #include "md.h" #if defined(MBEDTLS_THREADING_C) diff --git a/thirdparty/mbedtls/include/mbedtls/md2.h b/thirdparty/mbedtls/include/mbedtls/md2.h index f9bd98f804..fe97cf08d4 100644 --- a/thirdparty/mbedtls/include/mbedtls/md2.h +++ b/thirdparty/mbedtls/include/mbedtls/md2.h @@ -283,6 +283,8 @@ MBEDTLS_DEPRECATED void mbedtls_md2( const unsigned char *input, #undef MBEDTLS_DEPRECATED #endif /* !MBEDTLS_DEPRECATED_REMOVED */ +#if defined(MBEDTLS_SELF_TEST) + /** * \brief Checkup routine * @@ -295,6 +297,8 @@ MBEDTLS_DEPRECATED void mbedtls_md2( const unsigned char *input, */ int mbedtls_md2_self_test( int verbose ); +#endif /* MBEDTLS_SELF_TEST */ + #ifdef __cplusplus } #endif diff --git a/thirdparty/mbedtls/include/mbedtls/md4.h b/thirdparty/mbedtls/include/mbedtls/md4.h index dc3c048949..ce703c0ba4 100644 --- a/thirdparty/mbedtls/include/mbedtls/md4.h +++ b/thirdparty/mbedtls/include/mbedtls/md4.h @@ -288,6 +288,8 @@ MBEDTLS_DEPRECATED void mbedtls_md4( const unsigned char *input, #undef MBEDTLS_DEPRECATED #endif /* !MBEDTLS_DEPRECATED_REMOVED */ +#if defined(MBEDTLS_SELF_TEST) + /** * \brief Checkup routine * @@ -300,6 +302,8 @@ MBEDTLS_DEPRECATED void mbedtls_md4( const unsigned char *input, */ int mbedtls_md4_self_test( int verbose ); +#endif /* MBEDTLS_SELF_TEST */ + #ifdef __cplusplus } #endif diff --git a/thirdparty/mbedtls/include/mbedtls/md5.h b/thirdparty/mbedtls/include/mbedtls/md5.h index 6c3354fd30..6eed6cc864 100644 --- a/thirdparty/mbedtls/include/mbedtls/md5.h +++ b/thirdparty/mbedtls/include/mbedtls/md5.h @@ -288,6 +288,8 @@ MBEDTLS_DEPRECATED void mbedtls_md5( const unsigned char *input, #undef MBEDTLS_DEPRECATED #endif /* !MBEDTLS_DEPRECATED_REMOVED */ +#if defined(MBEDTLS_SELF_TEST) + /** * \brief Checkup routine * @@ -300,6 +302,8 @@ MBEDTLS_DEPRECATED void mbedtls_md5( const unsigned char *input, */ int mbedtls_md5_self_test( int verbose ); +#endif /* MBEDTLS_SELF_TEST */ + #ifdef __cplusplus } #endif diff --git a/thirdparty/mbedtls/include/mbedtls/net.h b/thirdparty/mbedtls/include/mbedtls/net.h index 6c13b53fb9..8cead58e5d 100644 --- a/thirdparty/mbedtls/include/mbedtls/net.h +++ b/thirdparty/mbedtls/include/mbedtls/net.h @@ -23,6 +23,11 @@ * * This file is part of mbed TLS (https://tls.mbed.org) */ +#if !defined(MBEDTLS_CONFIG_FILE) +#include "config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif #if !defined(MBEDTLS_DEPRECATED_REMOVED) #include "net_sockets.h" diff --git a/thirdparty/mbedtls/include/mbedtls/nist_kw.h b/thirdparty/mbedtls/include/mbedtls/nist_kw.h index 5a0f656a8f..3b67b59cd2 100644 --- a/thirdparty/mbedtls/include/mbedtls/nist_kw.h +++ b/thirdparty/mbedtls/include/mbedtls/nist_kw.h @@ -37,6 +37,12 @@ #ifndef MBEDTLS_NIST_KW_H #define MBEDTLS_NIST_KW_H +#if !defined(MBEDTLS_CONFIG_FILE) +#include "config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + #include "cipher.h" #ifdef __cplusplus diff --git a/thirdparty/mbedtls/include/mbedtls/padlock.h b/thirdparty/mbedtls/include/mbedtls/padlock.h index 7a5d083a95..721a5d4930 100644 --- a/thirdparty/mbedtls/include/mbedtls/padlock.h +++ b/thirdparty/mbedtls/include/mbedtls/padlock.h @@ -28,6 +28,12 @@ #ifndef MBEDTLS_PADLOCK_H #define MBEDTLS_PADLOCK_H +#if !defined(MBEDTLS_CONFIG_FILE) +#include "config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + #include "aes.h" #define MBEDTLS_ERR_PADLOCK_DATA_MISALIGNED -0x0030 /**< Input data should be aligned. */ @@ -53,7 +59,7 @@ #define MBEDTLS_PADLOCK_PHE 0x0C00 #define MBEDTLS_PADLOCK_PMM 0x3000 -#define MBEDTLS_PADLOCK_ALIGN16(x) (uint32_t *) (16 + ((int32_t) x & ~15)) +#define MBEDTLS_PADLOCK_ALIGN16(x) (uint32_t *) (16 + ((int32_t) (x) & ~15)) #ifdef __cplusplus extern "C" { diff --git a/thirdparty/mbedtls/include/mbedtls/pem.h b/thirdparty/mbedtls/include/mbedtls/pem.h index fa82f7bdbd..a29e9ce300 100644 --- a/thirdparty/mbedtls/include/mbedtls/pem.h +++ b/thirdparty/mbedtls/include/mbedtls/pem.h @@ -24,6 +24,12 @@ #ifndef MBEDTLS_PEM_H #define MBEDTLS_PEM_H +#if !defined(MBEDTLS_CONFIG_FILE) +#include "config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + #include <stddef.h> /** diff --git a/thirdparty/mbedtls/include/mbedtls/pkcs12.h b/thirdparty/mbedtls/include/mbedtls/pkcs12.h index 69f04177c8..d441357b7f 100644 --- a/thirdparty/mbedtls/include/mbedtls/pkcs12.h +++ b/thirdparty/mbedtls/include/mbedtls/pkcs12.h @@ -24,6 +24,12 @@ #ifndef MBEDTLS_PKCS12_H #define MBEDTLS_PKCS12_H +#if !defined(MBEDTLS_CONFIG_FILE) +#include "config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + #include "md.h" #include "cipher.h" #include "asn1.h" diff --git a/thirdparty/mbedtls/include/mbedtls/pkcs5.h b/thirdparty/mbedtls/include/mbedtls/pkcs5.h index d4bb36dfae..c92185f7a6 100644 --- a/thirdparty/mbedtls/include/mbedtls/pkcs5.h +++ b/thirdparty/mbedtls/include/mbedtls/pkcs5.h @@ -26,6 +26,12 @@ #ifndef MBEDTLS_PKCS5_H #define MBEDTLS_PKCS5_H +#if !defined(MBEDTLS_CONFIG_FILE) +#include "config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + #include "asn1.h" #include "md.h" @@ -85,6 +91,8 @@ int mbedtls_pkcs5_pbkdf2_hmac( mbedtls_md_context_t *ctx, const unsigned char *p unsigned int iteration_count, uint32_t key_length, unsigned char *output ); +#if defined(MBEDTLS_SELF_TEST) + /** * \brief Checkup routine * @@ -92,6 +100,8 @@ int mbedtls_pkcs5_pbkdf2_hmac( mbedtls_md_context_t *ctx, const unsigned char *p */ int mbedtls_pkcs5_self_test( int verbose ); +#endif /* MBEDTLS_SELF_TEST */ + #ifdef __cplusplus } #endif diff --git a/thirdparty/mbedtls/include/mbedtls/platform_util.h b/thirdparty/mbedtls/include/mbedtls/platform_util.h index b0e72ad149..dba6d45982 100644 --- a/thirdparty/mbedtls/include/mbedtls/platform_util.h +++ b/thirdparty/mbedtls/include/mbedtls/platform_util.h @@ -26,14 +26,14 @@ #define MBEDTLS_PLATFORM_UTIL_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" +#include "config.h" #else #include MBEDTLS_CONFIG_FILE #endif #include <stddef.h> #if defined(MBEDTLS_HAVE_TIME_DATE) -#include "mbedtls/platform_time.h" +#include "platform_time.h" #include <time.h> #endif /* MBEDTLS_HAVE_TIME_DATE */ diff --git a/thirdparty/mbedtls/include/mbedtls/poly1305.h b/thirdparty/mbedtls/include/mbedtls/poly1305.h index 05866a2da6..f0ec44c968 100644 --- a/thirdparty/mbedtls/include/mbedtls/poly1305.h +++ b/thirdparty/mbedtls/include/mbedtls/poly1305.h @@ -34,7 +34,7 @@ #define MBEDTLS_POLY1305_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" +#include "config.h" #else #include MBEDTLS_CONFIG_FILE #endif diff --git a/thirdparty/mbedtls/include/mbedtls/ripemd160.h b/thirdparty/mbedtls/include/mbedtls/ripemd160.h index c74b7d2c6c..b42f6d2a95 100644 --- a/thirdparty/mbedtls/include/mbedtls/ripemd160.h +++ b/thirdparty/mbedtls/include/mbedtls/ripemd160.h @@ -219,6 +219,8 @@ MBEDTLS_DEPRECATED void mbedtls_ripemd160( const unsigned char *input, #undef MBEDTLS_DEPRECATED #endif /* !MBEDTLS_DEPRECATED_REMOVED */ +#if defined(MBEDTLS_SELF_TEST) + /** * \brief Checkup routine * @@ -226,6 +228,8 @@ MBEDTLS_DEPRECATED void mbedtls_ripemd160( const unsigned char *input, */ int mbedtls_ripemd160_self_test( int verbose ); +#endif /* MBEDTLS_SELF_TEST */ + #ifdef __cplusplus } #endif diff --git a/thirdparty/mbedtls/include/mbedtls/rsa.h b/thirdparty/mbedtls/include/mbedtls/rsa.h index ed65a34452..906c427332 100644 --- a/thirdparty/mbedtls/include/mbedtls/rsa.h +++ b/thirdparty/mbedtls/include/mbedtls/rsa.h @@ -1252,6 +1252,8 @@ int mbedtls_rsa_copy( mbedtls_rsa_context *dst, const mbedtls_rsa_context *src ) */ void mbedtls_rsa_free( mbedtls_rsa_context *ctx ); +#if defined(MBEDTLS_SELF_TEST) + /** * \brief The RSA checkup routine. * @@ -1260,6 +1262,8 @@ void mbedtls_rsa_free( mbedtls_rsa_context *ctx ); */ int mbedtls_rsa_self_test( int verbose ); +#endif /* MBEDTLS_SELF_TEST */ + #ifdef __cplusplus } #endif diff --git a/thirdparty/mbedtls/include/mbedtls/sha1.h b/thirdparty/mbedtls/include/mbedtls/sha1.h index 38ea10b137..bb6ecf05a4 100644 --- a/thirdparty/mbedtls/include/mbedtls/sha1.h +++ b/thirdparty/mbedtls/include/mbedtls/sha1.h @@ -328,6 +328,8 @@ MBEDTLS_DEPRECATED void mbedtls_sha1( const unsigned char *input, #undef MBEDTLS_DEPRECATED #endif /* !MBEDTLS_DEPRECATED_REMOVED */ +#if defined(MBEDTLS_SELF_TEST) + /** * \brief The SHA-1 checkup routine. * @@ -341,6 +343,8 @@ MBEDTLS_DEPRECATED void mbedtls_sha1( const unsigned char *input, */ int mbedtls_sha1_self_test( int verbose ); +#endif /* MBEDTLS_SELF_TEST */ + #ifdef __cplusplus } #endif diff --git a/thirdparty/mbedtls/include/mbedtls/sha256.h b/thirdparty/mbedtls/include/mbedtls/sha256.h index 0e42f0abba..d64739820c 100644 --- a/thirdparty/mbedtls/include/mbedtls/sha256.h +++ b/thirdparty/mbedtls/include/mbedtls/sha256.h @@ -278,6 +278,8 @@ MBEDTLS_DEPRECATED void mbedtls_sha256( const unsigned char *input, #undef MBEDTLS_DEPRECATED #endif /* !MBEDTLS_DEPRECATED_REMOVED */ +#if defined(MBEDTLS_SELF_TEST) + /** * \brief The SHA-224 and SHA-256 checkup routine. * @@ -286,6 +288,8 @@ MBEDTLS_DEPRECATED void mbedtls_sha256( const unsigned char *input, */ int mbedtls_sha256_self_test( int verbose ); +#endif /* MBEDTLS_SELF_TEST */ + #ifdef __cplusplus } #endif diff --git a/thirdparty/mbedtls/include/mbedtls/sha512.h b/thirdparty/mbedtls/include/mbedtls/sha512.h index 7b26cf5cc3..c06ceed1d1 100644 --- a/thirdparty/mbedtls/include/mbedtls/sha512.h +++ b/thirdparty/mbedtls/include/mbedtls/sha512.h @@ -253,6 +253,7 @@ int mbedtls_sha512_ret( const unsigned char *input, #else #define MBEDTLS_DEPRECATED #endif + /** * \brief This function calculates the SHA-512 or SHA-384 * checksum of a buffer. @@ -280,6 +281,9 @@ MBEDTLS_DEPRECATED void mbedtls_sha512( const unsigned char *input, #undef MBEDTLS_DEPRECATED #endif /* !MBEDTLS_DEPRECATED_REMOVED */ + +#if defined(MBEDTLS_SELF_TEST) + /** * \brief The SHA-384 or SHA-512 checkup routine. * @@ -287,6 +291,7 @@ MBEDTLS_DEPRECATED void mbedtls_sha512( const unsigned char *input, * \return \c 1 on failure. */ int mbedtls_sha512_self_test( int verbose ); +#endif /* MBEDTLS_SELF_TEST */ #ifdef __cplusplus } diff --git a/thirdparty/mbedtls/include/mbedtls/ssl.h b/thirdparty/mbedtls/include/mbedtls/ssl.h index 8106bb4ab0..d31f6cdd56 100644 --- a/thirdparty/mbedtls/include/mbedtls/ssl.h +++ b/thirdparty/mbedtls/include/mbedtls/ssl.h @@ -2532,22 +2532,28 @@ void mbedtls_ssl_conf_cert_req_ca_list( mbedtls_ssl_config *conf, #if defined(MBEDTLS_SSL_MAX_FRAGMENT_LENGTH) /** - * \brief Set the maximum fragment length to emit and/or negotiate - * (Default: the smaller of MBEDTLS_SSL_IN_CONTENT_LEN and - * MBEDTLS_SSL_OUT_CONTENT_LEN, usually 2^14 bytes) + * \brief Set the maximum fragment length to emit and/or negotiate. + * (Typical: the smaller of #MBEDTLS_SSL_IN_CONTENT_LEN and + * #MBEDTLS_SSL_OUT_CONTENT_LEN, usually `2^14` bytes) * (Server: set maximum fragment length to emit, - * usually negotiated by the client during handshake + * usually negotiated by the client during handshake) * (Client: set maximum fragment length to emit *and* * negotiate with the server during handshake) + * (Default: #MBEDTLS_SSL_MAX_FRAG_LEN_NONE) * - * \note With TLS, this currently only affects ApplicationData (sent - * with \c mbedtls_ssl_read()), not handshake messages. - * With DTLS, this affects both ApplicationData and handshake. + * \note On the client side, the maximum fragment length extension + * *will not* be used, unless the maximum fragment length has + * been set via this function to a value different than + * #MBEDTLS_SSL_MAX_FRAG_LEN_NONE. * * \note This sets the maximum length for a record's payload, * excluding record overhead that will be added to it, see * \c mbedtls_ssl_get_record_expansion(). * + * \note With TLS, this currently only affects ApplicationData (sent + * with \c mbedtls_ssl_read()), not handshake messages. + * With DTLS, this affects both ApplicationData and handshake. + * * \note For DTLS, it is also possible to set a limit for the total * size of daragrams passed to the transport layer, including * record overhead, see \c mbedtls_ssl_set_mtu(). diff --git a/thirdparty/mbedtls/include/mbedtls/ssl_cache.h b/thirdparty/mbedtls/include/mbedtls/ssl_cache.h index ec081e6d24..52ba0948c5 100644 --- a/thirdparty/mbedtls/include/mbedtls/ssl_cache.h +++ b/thirdparty/mbedtls/include/mbedtls/ssl_cache.h @@ -24,6 +24,12 @@ #ifndef MBEDTLS_SSL_CACHE_H #define MBEDTLS_SSL_CACHE_H +#if !defined(MBEDTLS_CONFIG_FILE) +#include "config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + #include "ssl.h" #if defined(MBEDTLS_THREADING_C) diff --git a/thirdparty/mbedtls/include/mbedtls/ssl_ciphersuites.h b/thirdparty/mbedtls/include/mbedtls/ssl_ciphersuites.h index cda8b4835b..71053e5ba7 100644 --- a/thirdparty/mbedtls/include/mbedtls/ssl_ciphersuites.h +++ b/thirdparty/mbedtls/include/mbedtls/ssl_ciphersuites.h @@ -24,6 +24,12 @@ #ifndef MBEDTLS_SSL_CIPHERSUITES_H #define MBEDTLS_SSL_CIPHERSUITES_H +#if !defined(MBEDTLS_CONFIG_FILE) +#include "config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + #include "pk.h" #include "cipher.h" #include "md.h" diff --git a/thirdparty/mbedtls/include/mbedtls/ssl_cookie.h b/thirdparty/mbedtls/include/mbedtls/ssl_cookie.h index 6a0ad4fa96..e34760ae85 100644 --- a/thirdparty/mbedtls/include/mbedtls/ssl_cookie.h +++ b/thirdparty/mbedtls/include/mbedtls/ssl_cookie.h @@ -24,6 +24,12 @@ #ifndef MBEDTLS_SSL_COOKIE_H #define MBEDTLS_SSL_COOKIE_H +#if !defined(MBEDTLS_CONFIG_FILE) +#include "config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + #include "ssl.h" #if defined(MBEDTLS_THREADING_C) diff --git a/thirdparty/mbedtls/include/mbedtls/ssl_internal.h b/thirdparty/mbedtls/include/mbedtls/ssl_internal.h index 97abb9f90b..bd5ad94dbf 100644 --- a/thirdparty/mbedtls/include/mbedtls/ssl_internal.h +++ b/thirdparty/mbedtls/include/mbedtls/ssl_internal.h @@ -24,6 +24,12 @@ #ifndef MBEDTLS_SSL_INTERNAL_H #define MBEDTLS_SSL_INTERNAL_H +#if !defined(MBEDTLS_CONFIG_FILE) +#include "config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + #include "ssl.h" #include "cipher.h" diff --git a/thirdparty/mbedtls/include/mbedtls/ssl_ticket.h b/thirdparty/mbedtls/include/mbedtls/ssl_ticket.h index b2686df09f..a84e7816e4 100644 --- a/thirdparty/mbedtls/include/mbedtls/ssl_ticket.h +++ b/thirdparty/mbedtls/include/mbedtls/ssl_ticket.h @@ -24,6 +24,12 @@ #ifndef MBEDTLS_SSL_TICKET_H #define MBEDTLS_SSL_TICKET_H +#if !defined(MBEDTLS_CONFIG_FILE) +#include "config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + /* * This implementation of the session ticket callbacks includes key * management, rotating the keys periodically in order to preserve forward diff --git a/thirdparty/mbedtls/include/mbedtls/version.h b/thirdparty/mbedtls/include/mbedtls/version.h index 56e7398a2a..ef8e4c1f4f 100644 --- a/thirdparty/mbedtls/include/mbedtls/version.h +++ b/thirdparty/mbedtls/include/mbedtls/version.h @@ -40,16 +40,16 @@ */ #define MBEDTLS_VERSION_MAJOR 2 #define MBEDTLS_VERSION_MINOR 16 -#define MBEDTLS_VERSION_PATCH 0 +#define MBEDTLS_VERSION_PATCH 2 /** * The single version number has the following structure: * MMNNPP00 * Major version | Minor version | Patch version */ -#define MBEDTLS_VERSION_NUMBER 0x02100000 -#define MBEDTLS_VERSION_STRING "2.16.0" -#define MBEDTLS_VERSION_STRING_FULL "mbed TLS 2.16.0" +#define MBEDTLS_VERSION_NUMBER 0x02100200 +#define MBEDTLS_VERSION_STRING "2.16.2" +#define MBEDTLS_VERSION_STRING_FULL "mbed TLS 2.16.2" #if defined(MBEDTLS_VERSION_C) diff --git a/thirdparty/mbedtls/include/mbedtls/x509.h b/thirdparty/mbedtls/include/mbedtls/x509.h index d6db9c6e37..9ae825c183 100644 --- a/thirdparty/mbedtls/include/mbedtls/x509.h +++ b/thirdparty/mbedtls/include/mbedtls/x509.h @@ -269,6 +269,8 @@ int mbedtls_x509_time_is_past( const mbedtls_x509_time *to ); */ int mbedtls_x509_time_is_future( const mbedtls_x509_time *from ); +#if defined(MBEDTLS_SELF_TEST) + /** * \brief Checkup routine * @@ -276,6 +278,8 @@ int mbedtls_x509_time_is_future( const mbedtls_x509_time *from ); */ int mbedtls_x509_self_test( int verbose ); +#endif /* MBEDTLS_SELF_TEST */ + /* * Internal module functions. You probably do not want to use these unless you * know you do. diff --git a/thirdparty/mbedtls/include/mbedtls/x509_crt.h b/thirdparty/mbedtls/include/mbedtls/x509_crt.h index 3dd5922486..670bd10d89 100644 --- a/thirdparty/mbedtls/include/mbedtls/x509_crt.h +++ b/thirdparty/mbedtls/include/mbedtls/x509_crt.h @@ -98,7 +98,7 @@ mbedtls_x509_crt; * Build flag from an algorithm/curve identifier (pk, md, ecp) * Since 0 is always XXX_NONE, ignore it. */ -#define MBEDTLS_X509_ID_FLAG( id ) ( 1 << ( id - 1 ) ) +#define MBEDTLS_X509_ID_FLAG( id ) ( 1 << ( (id) - 1 ) ) /** * Security profile for certificate verification. diff --git a/thirdparty/mbedtls/include/mbedtls/x509_csr.h b/thirdparty/mbedtls/include/mbedtls/x509_csr.h index 0c6ccad78d..a3c28048e0 100644 --- a/thirdparty/mbedtls/include/mbedtls/x509_csr.h +++ b/thirdparty/mbedtls/include/mbedtls/x509_csr.h @@ -205,6 +205,14 @@ void mbedtls_x509write_csr_set_md_alg( mbedtls_x509write_csr *ctx, mbedtls_md_ty * \param key_usage key usage flags to set * * \return 0 if successful, or MBEDTLS_ERR_X509_ALLOC_FAILED + * + * \note The <code>decipherOnly</code> flag from the Key Usage + * extension is represented by bit 8 (i.e. + * <code>0x8000</code>), which cannot typically be represented + * in an unsigned char. Therefore, the flag + * <code>decipherOnly</code> (i.e. + * #MBEDTLS_X509_KU_DECIPHER_ONLY) cannot be set using this + * function. */ int mbedtls_x509write_csr_set_key_usage( mbedtls_x509write_csr *ctx, unsigned char key_usage ); diff --git a/thirdparty/mbedtls/include/mbedtls/xtea.h b/thirdparty/mbedtls/include/mbedtls/xtea.h index 6430c1318a..b47f553508 100644 --- a/thirdparty/mbedtls/include/mbedtls/xtea.h +++ b/thirdparty/mbedtls/include/mbedtls/xtea.h @@ -121,6 +121,8 @@ int mbedtls_xtea_crypt_cbc( mbedtls_xtea_context *ctx, unsigned char *output); #endif /* MBEDTLS_CIPHER_MODE_CBC */ +#if defined(MBEDTLS_SELF_TEST) + /** * \brief Checkup routine * @@ -128,6 +130,8 @@ int mbedtls_xtea_crypt_cbc( mbedtls_xtea_context *ctx, */ int mbedtls_xtea_self_test( int verbose ); +#endif /* MBEDTLS_SELF_TEST */ + #ifdef __cplusplus } #endif diff --git a/thirdparty/mbedtls/library/aes.c b/thirdparty/mbedtls/library/aes.c index 0543cd7817..aff0a9939a 100644 --- a/thirdparty/mbedtls/library/aes.c +++ b/thirdparty/mbedtls/library/aes.c @@ -395,9 +395,9 @@ static uint32_t RCON[10]; /* * Tables generation code */ -#define ROTL8(x) ( ( x << 8 ) & 0xFFFFFFFF ) | ( x >> 24 ) -#define XTIME(x) ( ( x << 1 ) ^ ( ( x & 0x80 ) ? 0x1B : 0x00 ) ) -#define MUL(x,y) ( ( x && y ) ? pow[(log[x]+log[y]) % 255] : 0 ) +#define ROTL8(x) ( ( (x) << 8 ) & 0xFFFFFFFF ) | ( (x) >> 24 ) +#define XTIME(x) ( ( (x) << 1 ) ^ ( ( (x) & 0x80 ) ? 0x1B : 0x00 ) ) +#define MUL(x,y) ( ( (x) && (y) ) ? pow[(log[(x)]+log[(y)]) % 255] : 0 ) static int aes_init_done = 0; @@ -815,51 +815,53 @@ int mbedtls_aes_xts_setkey_dec( mbedtls_aes_xts_context *ctx, #endif /* !MBEDTLS_AES_SETKEY_DEC_ALT */ -#define AES_FROUND(X0,X1,X2,X3,Y0,Y1,Y2,Y3) \ -{ \ - X0 = *RK++ ^ AES_FT0( ( Y0 ) & 0xFF ) ^ \ - AES_FT1( ( Y1 >> 8 ) & 0xFF ) ^ \ - AES_FT2( ( Y2 >> 16 ) & 0xFF ) ^ \ - AES_FT3( ( Y3 >> 24 ) & 0xFF ); \ - \ - X1 = *RK++ ^ AES_FT0( ( Y1 ) & 0xFF ) ^ \ - AES_FT1( ( Y2 >> 8 ) & 0xFF ) ^ \ - AES_FT2( ( Y3 >> 16 ) & 0xFF ) ^ \ - AES_FT3( ( Y0 >> 24 ) & 0xFF ); \ - \ - X2 = *RK++ ^ AES_FT0( ( Y2 ) & 0xFF ) ^ \ - AES_FT1( ( Y3 >> 8 ) & 0xFF ) ^ \ - AES_FT2( ( Y0 >> 16 ) & 0xFF ) ^ \ - AES_FT3( ( Y1 >> 24 ) & 0xFF ); \ - \ - X3 = *RK++ ^ AES_FT0( ( Y3 ) & 0xFF ) ^ \ - AES_FT1( ( Y0 >> 8 ) & 0xFF ) ^ \ - AES_FT2( ( Y1 >> 16 ) & 0xFF ) ^ \ - AES_FT3( ( Y2 >> 24 ) & 0xFF ); \ -} - -#define AES_RROUND(X0,X1,X2,X3,Y0,Y1,Y2,Y3) \ -{ \ - X0 = *RK++ ^ AES_RT0( ( Y0 ) & 0xFF ) ^ \ - AES_RT1( ( Y3 >> 8 ) & 0xFF ) ^ \ - AES_RT2( ( Y2 >> 16 ) & 0xFF ) ^ \ - AES_RT3( ( Y1 >> 24 ) & 0xFF ); \ - \ - X1 = *RK++ ^ AES_RT0( ( Y1 ) & 0xFF ) ^ \ - AES_RT1( ( Y0 >> 8 ) & 0xFF ) ^ \ - AES_RT2( ( Y3 >> 16 ) & 0xFF ) ^ \ - AES_RT3( ( Y2 >> 24 ) & 0xFF ); \ - \ - X2 = *RK++ ^ AES_RT0( ( Y2 ) & 0xFF ) ^ \ - AES_RT1( ( Y1 >> 8 ) & 0xFF ) ^ \ - AES_RT2( ( Y0 >> 16 ) & 0xFF ) ^ \ - AES_RT3( ( Y3 >> 24 ) & 0xFF ); \ - \ - X3 = *RK++ ^ AES_RT0( ( Y3 ) & 0xFF ) ^ \ - AES_RT1( ( Y2 >> 8 ) & 0xFF ) ^ \ - AES_RT2( ( Y1 >> 16 ) & 0xFF ) ^ \ - AES_RT3( ( Y0 >> 24 ) & 0xFF ); \ -} +#define AES_FROUND(X0,X1,X2,X3,Y0,Y1,Y2,Y3) \ + do \ + { \ + (X0) = *RK++ ^ AES_FT0( ( (Y0) ) & 0xFF ) ^ \ + AES_FT1( ( (Y1) >> 8 ) & 0xFF ) ^ \ + AES_FT2( ( (Y2) >> 16 ) & 0xFF ) ^ \ + AES_FT3( ( (Y3) >> 24 ) & 0xFF ); \ + \ + (X1) = *RK++ ^ AES_FT0( ( (Y1) ) & 0xFF ) ^ \ + AES_FT1( ( (Y2) >> 8 ) & 0xFF ) ^ \ + AES_FT2( ( (Y3) >> 16 ) & 0xFF ) ^ \ + AES_FT3( ( (Y0) >> 24 ) & 0xFF ); \ + \ + (X2) = *RK++ ^ AES_FT0( ( (Y2) ) & 0xFF ) ^ \ + AES_FT1( ( (Y3) >> 8 ) & 0xFF ) ^ \ + AES_FT2( ( (Y0) >> 16 ) & 0xFF ) ^ \ + AES_FT3( ( (Y1) >> 24 ) & 0xFF ); \ + \ + (X3) = *RK++ ^ AES_FT0( ( (Y3) ) & 0xFF ) ^ \ + AES_FT1( ( (Y0) >> 8 ) & 0xFF ) ^ \ + AES_FT2( ( (Y1) >> 16 ) & 0xFF ) ^ \ + AES_FT3( ( (Y2) >> 24 ) & 0xFF ); \ + } while( 0 ) + +#define AES_RROUND(X0,X1,X2,X3,Y0,Y1,Y2,Y3) \ + do \ + { \ + (X0) = *RK++ ^ AES_RT0( ( (Y0) ) & 0xFF ) ^ \ + AES_RT1( ( (Y3) >> 8 ) & 0xFF ) ^ \ + AES_RT2( ( (Y2) >> 16 ) & 0xFF ) ^ \ + AES_RT3( ( (Y1) >> 24 ) & 0xFF ); \ + \ + (X1) = *RK++ ^ AES_RT0( ( (Y1) ) & 0xFF ) ^ \ + AES_RT1( ( (Y0) >> 8 ) & 0xFF ) ^ \ + AES_RT2( ( (Y3) >> 16 ) & 0xFF ) ^ \ + AES_RT3( ( (Y2) >> 24 ) & 0xFF ); \ + \ + (X2) = *RK++ ^ AES_RT0( ( (Y2) ) & 0xFF ) ^ \ + AES_RT1( ( (Y1) >> 8 ) & 0xFF ) ^ \ + AES_RT2( ( (Y0) >> 16 ) & 0xFF ) ^ \ + AES_RT3( ( (Y3) >> 24 ) & 0xFF ); \ + \ + (X3) = *RK++ ^ AES_RT0( ( (Y3) ) & 0xFF ) ^ \ + AES_RT1( ( (Y2) >> 8 ) & 0xFF ) ^ \ + AES_RT2( ( (Y1) >> 16 ) & 0xFF ) ^ \ + AES_RT3( ( (Y0) >> 24 ) & 0xFF ); \ + } while( 0 ) /* * AES-ECB block encryption diff --git a/thirdparty/mbedtls/library/asn1write.c b/thirdparty/mbedtls/library/asn1write.c index a4d23f6196..c0b4622d58 100644 --- a/thirdparty/mbedtls/library/asn1write.c +++ b/thirdparty/mbedtls/library/asn1write.c @@ -294,22 +294,28 @@ int mbedtls_asn1_write_bitstring( unsigned char **p, unsigned char *start, const unsigned char *buf, size_t bits ) { int ret; - size_t len = 0, size; + size_t len = 0; + size_t unused_bits, byte_len; - size = ( bits / 8 ) + ( ( bits % 8 ) ? 1 : 0 ); + byte_len = ( bits + 7 ) / 8; + unused_bits = ( byte_len * 8 ) - bits; - // Calculate byte length - // - if( *p < start || (size_t)( *p - start ) < size + 1 ) + if( *p < start || (size_t)( *p - start ) < byte_len + 1 ) return( MBEDTLS_ERR_ASN1_BUF_TOO_SMALL ); - len = size + 1; - (*p) -= size; - memcpy( *p, buf, size ); + len = byte_len + 1; - // Write unused bits - // - *--(*p) = (unsigned char) (size * 8 - bits); + /* Write the bitstring. Ensure the unused bits are zeroed */ + if( byte_len > 0 ) + { + byte_len--; + *--( *p ) = buf[byte_len] & ~( ( 0x1 << unused_bits ) - 1 ); + ( *p ) -= byte_len; + memcpy( *p, buf, byte_len ); + } + + /* Write unused bits */ + *--( *p ) = (unsigned char)unused_bits; MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( p, start, len ) ); MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( p, start, MBEDTLS_ASN1_BIT_STRING ) ); diff --git a/thirdparty/mbedtls/library/bignum.c b/thirdparty/mbedtls/library/bignum.c index f968a0ad7d..41946183c5 100644 --- a/thirdparty/mbedtls/library/bignum.c +++ b/thirdparty/mbedtls/library/bignum.c @@ -527,26 +527,38 @@ cleanup: } /* - * Helper to write the digits high-order first + * Helper to write the digits high-order first. */ -static int mpi_write_hlp( mbedtls_mpi *X, int radix, char **p ) +static int mpi_write_hlp( mbedtls_mpi *X, int radix, + char **p, const size_t buflen ) { int ret; mbedtls_mpi_uint r; + size_t length = 0; + char *p_end = *p + buflen; - if( radix < 2 || radix > 16 ) - return( MBEDTLS_ERR_MPI_BAD_INPUT_DATA ); + do + { + if( length >= buflen ) + { + return( MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL ); + } - MBEDTLS_MPI_CHK( mbedtls_mpi_mod_int( &r, X, radix ) ); - MBEDTLS_MPI_CHK( mbedtls_mpi_div_int( X, NULL, X, radix ) ); + MBEDTLS_MPI_CHK( mbedtls_mpi_mod_int( &r, X, radix ) ); + MBEDTLS_MPI_CHK( mbedtls_mpi_div_int( X, NULL, X, radix ) ); + /* + * Write the residue in the current position, as an ASCII character. + */ + if( r < 0xA ) + *(--p_end) = (char)( '0' + r ); + else + *(--p_end) = (char)( 'A' + ( r - 0xA ) ); - if( mbedtls_mpi_cmp_int( X, 0 ) != 0 ) - MBEDTLS_MPI_CHK( mpi_write_hlp( X, radix, p ) ); + length++; + } while( mbedtls_mpi_cmp_int( X, 0 ) != 0 ); - if( r < 10 ) - *(*p)++ = (char)( r + 0x30 ); - else - *(*p)++ = (char)( r + 0x37 ); + memmove( *p, p_end, length ); + *p += length; cleanup: @@ -570,15 +582,20 @@ int mbedtls_mpi_write_string( const mbedtls_mpi *X, int radix, if( radix < 2 || radix > 16 ) return( MBEDTLS_ERR_MPI_BAD_INPUT_DATA ); - n = mbedtls_mpi_bitlen( X ); - if( radix >= 4 ) n >>= 1; - if( radix >= 16 ) n >>= 1; - /* - * Round up the buffer length to an even value to ensure that there is - * enough room for hexadecimal values that can be represented in an odd - * number of digits. - */ - n += 3 + ( ( n + 1 ) & 1 ); + n = mbedtls_mpi_bitlen( X ); /* Number of bits necessary to present `n`. */ + if( radix >= 4 ) n >>= 1; /* Number of 4-adic digits necessary to present + * `n`. If radix > 4, this might be a strict + * overapproximation of the number of + * radix-adic digits needed to present `n`. */ + if( radix >= 16 ) n >>= 1; /* Number of hexadecimal digits necessary to + * present `n`. */ + + n += 1; /* Terminating null byte */ + n += 1; /* Compensate for the divisions above, which round down `n` + * in case it's not even. */ + n += 1; /* Potential '-'-sign. */ + n += ( n & 1 ); /* Make n even to have enough space for hexadecimal writing, + * which always uses an even number of hex-digits. */ if( buflen < n ) { @@ -590,7 +607,10 @@ int mbedtls_mpi_write_string( const mbedtls_mpi *X, int radix, mbedtls_mpi_init( &T ); if( X->s == -1 ) + { *p++ = '-'; + buflen--; + } if( radix == 16 ) { @@ -619,7 +639,7 @@ int mbedtls_mpi_write_string( const mbedtls_mpi *X, int radix, if( T.s == -1 ) T.s = 1; - MBEDTLS_MPI_CHK( mpi_write_hlp( &T, radix, &p ) ); + MBEDTLS_MPI_CHK( mpi_write_hlp( &T, radix, &p, buflen ) ); } *p++ = '\0'; @@ -715,14 +735,101 @@ cleanup: } #endif /* MBEDTLS_FS_IO */ + +/* Convert a big-endian byte array aligned to the size of mbedtls_mpi_uint + * into the storage form used by mbedtls_mpi. */ + +static mbedtls_mpi_uint mpi_uint_bigendian_to_host_c( mbedtls_mpi_uint x ) +{ + uint8_t i; + mbedtls_mpi_uint tmp = 0; + /* This works regardless of the endianness. */ + for( i = 0; i < ciL; i++, x >>= 8 ) + tmp |= ( x & 0xFF ) << ( ( ciL - 1 - i ) << 3 ); + return( tmp ); +} + +static mbedtls_mpi_uint mpi_uint_bigendian_to_host( mbedtls_mpi_uint x ) +{ +#if defined(__BYTE_ORDER__) + +/* Nothing to do on bigendian systems. */ +#if ( __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ ) + return( x ); +#endif /* __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ */ + +#if ( __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ ) + +/* For GCC and Clang, have builtins for byte swapping. */ +#if defined(__GNUC__) && defined(__GNUC_PREREQ) +#if __GNUC_PREREQ(4,3) +#define have_bswap +#endif +#endif + +#if defined(__clang__) && defined(__has_builtin) +#if __has_builtin(__builtin_bswap32) && \ + __has_builtin(__builtin_bswap64) +#define have_bswap +#endif +#endif + +#if defined(have_bswap) + /* The compiler is hopefully able to statically evaluate this! */ + switch( sizeof(mbedtls_mpi_uint) ) + { + case 4: + return( __builtin_bswap32(x) ); + case 8: + return( __builtin_bswap64(x) ); + } +#endif +#endif /* __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ */ +#endif /* __BYTE_ORDER__ */ + + /* Fall back to C-based reordering if we don't know the byte order + * or we couldn't use a compiler-specific builtin. */ + return( mpi_uint_bigendian_to_host_c( x ) ); +} + +static void mpi_bigendian_to_host( mbedtls_mpi_uint * const p, size_t limbs ) +{ + mbedtls_mpi_uint *cur_limb_left; + mbedtls_mpi_uint *cur_limb_right; + if( limbs == 0 ) + return; + + /* + * Traverse limbs and + * - adapt byte-order in each limb + * - swap the limbs themselves. + * For that, simultaneously traverse the limbs from left to right + * and from right to left, as long as the left index is not bigger + * than the right index (it's not a problem if limbs is odd and the + * indices coincide in the last iteration). + */ + for( cur_limb_left = p, cur_limb_right = p + ( limbs - 1 ); + cur_limb_left <= cur_limb_right; + cur_limb_left++, cur_limb_right-- ) + { + mbedtls_mpi_uint tmp; + /* Note that if cur_limb_left == cur_limb_right, + * this code effectively swaps the bytes only once. */ + tmp = mpi_uint_bigendian_to_host( *cur_limb_left ); + *cur_limb_left = mpi_uint_bigendian_to_host( *cur_limb_right ); + *cur_limb_right = tmp; + } +} + /* * Import X from unsigned binary data, big endian */ int mbedtls_mpi_read_binary( mbedtls_mpi *X, const unsigned char *buf, size_t buflen ) { int ret; - size_t i, j; - size_t const limbs = CHARS_TO_LIMBS( buflen ); + size_t const limbs = CHARS_TO_LIMBS( buflen ); + size_t const overhead = ( limbs * ciL ) - buflen; + unsigned char *Xp; MPI_VALIDATE_RET( X != NULL ); MPI_VALIDATE_RET( buflen == 0 || buf != NULL ); @@ -734,11 +841,17 @@ int mbedtls_mpi_read_binary( mbedtls_mpi *X, const unsigned char *buf, size_t bu mbedtls_mpi_init( X ); MBEDTLS_MPI_CHK( mbedtls_mpi_grow( X, limbs ) ); } - MBEDTLS_MPI_CHK( mbedtls_mpi_lset( X, 0 ) ); - for( i = buflen, j = 0; i > 0; i--, j++ ) - X->p[j / ciL] |= ((mbedtls_mpi_uint) buf[i - 1]) << ((j % ciL) << 3); + /* Avoid calling `memcpy` with NULL source argument, + * even if buflen is 0. */ + if( buf != NULL ) + { + Xp = (unsigned char*) X->p; + memcpy( Xp + overhead, buf, buflen ); + + mpi_bigendian_to_host( X->p, limbs ); + } cleanup: @@ -1764,8 +1877,10 @@ int mbedtls_mpi_exp_mod( mbedtls_mpi *X, const mbedtls_mpi *A, wsize = ( i > 671 ) ? 6 : ( i > 239 ) ? 5 : ( i > 79 ) ? 4 : ( i > 23 ) ? 3 : 1; +#if( MBEDTLS_MPI_WINDOW_SIZE < 6 ) if( wsize > MBEDTLS_MPI_WINDOW_SIZE ) wsize = MBEDTLS_MPI_WINDOW_SIZE; +#endif j = N->n + 1; MBEDTLS_MPI_CHK( mbedtls_mpi_grow( X, j ) ); @@ -2008,18 +2123,28 @@ int mbedtls_mpi_fill_random( mbedtls_mpi *X, size_t size, void *p_rng ) { int ret; - unsigned char buf[MBEDTLS_MPI_MAX_SIZE]; + size_t const limbs = CHARS_TO_LIMBS( size ); + size_t const overhead = ( limbs * ciL ) - size; + unsigned char *Xp; + MPI_VALIDATE_RET( X != NULL ); MPI_VALIDATE_RET( f_rng != NULL ); - if( size > MBEDTLS_MPI_MAX_SIZE ) - return( MBEDTLS_ERR_MPI_BAD_INPUT_DATA ); + /* Ensure that target MPI has exactly the necessary number of limbs */ + if( X->n != limbs ) + { + mbedtls_mpi_free( X ); + mbedtls_mpi_init( X ); + MBEDTLS_MPI_CHK( mbedtls_mpi_grow( X, limbs ) ); + } + MBEDTLS_MPI_CHK( mbedtls_mpi_lset( X, 0 ) ); + + Xp = (unsigned char*) X->p; + f_rng( p_rng, Xp + overhead, size ); - MBEDTLS_MPI_CHK( f_rng( p_rng, buf, size ) ); - MBEDTLS_MPI_CHK( mbedtls_mpi_read_binary( X, buf, size ) ); + mpi_bigendian_to_host( X->p, limbs ); cleanup: - mbedtls_platform_zeroize( buf, sizeof( buf ) ); return( ret ); } diff --git a/thirdparty/mbedtls/library/ccm.c b/thirdparty/mbedtls/library/ccm.c index 01e58b0436..c6211ee773 100644 --- a/thirdparty/mbedtls/library/ccm.c +++ b/thirdparty/mbedtls/library/ccm.c @@ -134,11 +134,17 @@ void mbedtls_ccm_free( mbedtls_ccm_context *ctx ) * This avoids allocating one more 16 bytes buffer while allowing src == dst. */ #define CTR_CRYPT( dst, src, len ) \ - if( ( ret = mbedtls_cipher_update( &ctx->cipher_ctx, ctr, 16, b, &olen ) ) != 0 ) \ - return( ret ); \ - \ - for( i = 0; i < len; i++ ) \ - dst[i] = src[i] ^ b[i]; + do \ + { \ + if( ( ret = mbedtls_cipher_update( &ctx->cipher_ctx, ctr, \ + 16, b, &olen ) ) != 0 ) \ + { \ + return( ret ); \ + } \ + \ + for( i = 0; i < (len); i++ ) \ + (dst)[i] = (src)[i] ^ b[i]; \ + } while( 0 ) /* * Authenticated encryption or decryption diff --git a/thirdparty/mbedtls/library/certs.c b/thirdparty/mbedtls/library/certs.c index ff0f11e923..b07fd8a3a1 100644 --- a/thirdparty/mbedtls/library/certs.c +++ b/thirdparty/mbedtls/library/certs.c @@ -29,328 +29,1673 @@ #if defined(MBEDTLS_CERTS_C) -#if defined(MBEDTLS_ECDSA_C) -#define TEST_CA_CRT_EC \ -"-----BEGIN CERTIFICATE-----\r\n" \ -"MIICUjCCAdegAwIBAgIJAMFD4n5iQ8zoMAoGCCqGSM49BAMCMD4xCzAJBgNVBAYT\r\n" \ -"Ak5MMREwDwYDVQQKEwhQb2xhclNTTDEcMBoGA1UEAxMTUG9sYXJzc2wgVGVzdCBF\r\n" \ -"QyBDQTAeFw0xMzA5MjQxNTQ5NDhaFw0yMzA5MjIxNTQ5NDhaMD4xCzAJBgNVBAYT\r\n" \ -"Ak5MMREwDwYDVQQKEwhQb2xhclNTTDEcMBoGA1UEAxMTUG9sYXJzc2wgVGVzdCBF\r\n" \ -"QyBDQTB2MBAGByqGSM49AgEGBSuBBAAiA2IABMPaKzRBN1gvh1b+/Im6KUNLTuBu\r\n" \ -"ww5XUzM5WNRStJGVOQsj318XJGJI/BqVKc4sLYfCiFKAr9ZqqyHduNMcbli4yuiy\r\n" \ -"aY7zQa0pw7RfdadHb9UZKVVpmlM7ILRmFmAzHqOBoDCBnTAdBgNVHQ4EFgQUnW0g\r\n" \ -"JEkBPyvLeLUZvH4kydv7NnwwbgYDVR0jBGcwZYAUnW0gJEkBPyvLeLUZvH4kydv7\r\n" \ -"NnyhQqRAMD4xCzAJBgNVBAYTAk5MMREwDwYDVQQKEwhQb2xhclNTTDEcMBoGA1UE\r\n" \ -"AxMTUG9sYXJzc2wgVGVzdCBFQyBDQYIJAMFD4n5iQ8zoMAwGA1UdEwQFMAMBAf8w\r\n" \ -"CgYIKoZIzj0EAwIDaQAwZgIxAMO0YnNWKJUAfXgSJtJxexn4ipg+kv4znuR50v56\r\n" \ -"t4d0PCu412mUC6Nnd7izvtE2MgIxAP1nnJQjZ8BWukszFQDG48wxCCyci9qpdSMv\r\n" \ -"uCjn8pwUOkABXK8Mss90fzCfCEOtIA==\r\n" \ -"-----END CERTIFICATE-----\r\n" -const char mbedtls_test_ca_crt_ec[] = TEST_CA_CRT_EC; -const size_t mbedtls_test_ca_crt_ec_len = sizeof( mbedtls_test_ca_crt_ec ); - -const char mbedtls_test_ca_key_ec[] = -"-----BEGIN EC PRIVATE KEY-----\r\n" -"Proc-Type: 4,ENCRYPTED\r\n" -"DEK-Info: DES-EDE3-CBC,307EAB469933D64E\r\n" -"\r\n" -"IxbrRmKcAzctJqPdTQLA4SWyBYYGYJVkYEna+F7Pa5t5Yg/gKADrFKcm6B72e7DG\r\n" -"ihExtZI648s0zdYw6qSJ74vrPSuWDe5qm93BqsfVH9svtCzWHW0pm1p0KTBCFfUq\r\n" -"UsuWTITwJImcnlAs1gaRZ3sAWm7cOUidL0fo2G0fYUFNcYoCSLffCFTEHBuPnagb\r\n" -"a77x/sY1Bvii8S9/XhDTb6pTMx06wzrm\r\n" -"-----END EC PRIVATE KEY-----\r\n"; -const size_t mbedtls_test_ca_key_ec_len = sizeof( mbedtls_test_ca_key_ec ); - -const char mbedtls_test_ca_pwd_ec[] = "PolarSSLTest"; -const size_t mbedtls_test_ca_pwd_ec_len = sizeof( mbedtls_test_ca_pwd_ec ) - 1; - -const char mbedtls_test_srv_crt_ec[] = -"-----BEGIN CERTIFICATE-----\r\n" -"MIICHzCCAaWgAwIBAgIBCTAKBggqhkjOPQQDAjA+MQswCQYDVQQGEwJOTDERMA8G\r\n" -"A1UEChMIUG9sYXJTU0wxHDAaBgNVBAMTE1BvbGFyc3NsIFRlc3QgRUMgQ0EwHhcN\r\n" -"MTMwOTI0MTU1MjA0WhcNMjMwOTIyMTU1MjA0WjA0MQswCQYDVQQGEwJOTDERMA8G\r\n" -"A1UEChMIUG9sYXJTU0wxEjAQBgNVBAMTCWxvY2FsaG9zdDBZMBMGByqGSM49AgEG\r\n" -"CCqGSM49AwEHA0IABDfMVtl2CR5acj7HWS3/IG7ufPkGkXTQrRS192giWWKSTuUA\r\n" -"2CMR/+ov0jRdXRa9iojCa3cNVc2KKg76Aci07f+jgZ0wgZowCQYDVR0TBAIwADAd\r\n" -"BgNVHQ4EFgQUUGGlj9QH2deCAQzlZX+MY0anE74wbgYDVR0jBGcwZYAUnW0gJEkB\r\n" -"PyvLeLUZvH4kydv7NnyhQqRAMD4xCzAJBgNVBAYTAk5MMREwDwYDVQQKEwhQb2xh\r\n" -"clNTTDEcMBoGA1UEAxMTUG9sYXJzc2wgVGVzdCBFQyBDQYIJAMFD4n5iQ8zoMAoG\r\n" -"CCqGSM49BAMCA2gAMGUCMQCaLFzXptui5WQN8LlO3ddh1hMxx6tzgLvT03MTVK2S\r\n" -"C12r0Lz3ri/moSEpNZWqPjkCMCE2f53GXcYLqyfyJR078c/xNSUU5+Xxl7VZ414V\r\n" -"fGa5kHvHARBPc8YAIVIqDvHH1Q==\r\n" -"-----END CERTIFICATE-----\r\n"; -const size_t mbedtls_test_srv_crt_ec_len = sizeof( mbedtls_test_srv_crt_ec ); - -const char mbedtls_test_srv_key_ec[] = -"-----BEGIN EC PRIVATE KEY-----\r\n" -"MHcCAQEEIPEqEyB2AnCoPL/9U/YDHvdqXYbIogTywwyp6/UfDw6noAoGCCqGSM49\r\n" -"AwEHoUQDQgAEN8xW2XYJHlpyPsdZLf8gbu58+QaRdNCtFLX3aCJZYpJO5QDYIxH/\r\n" -"6i/SNF1dFr2KiMJrdw1VzYoqDvoByLTt/w==\r\n" -"-----END EC PRIVATE KEY-----\r\n"; -const size_t mbedtls_test_srv_key_ec_len = sizeof( mbedtls_test_srv_key_ec ); - -const char mbedtls_test_cli_crt_ec[] = -"-----BEGIN CERTIFICATE-----\r\n" -"MIICLDCCAbKgAwIBAgIBDTAKBggqhkjOPQQDAjA+MQswCQYDVQQGEwJOTDERMA8G\r\n" -"A1UEChMIUG9sYXJTU0wxHDAaBgNVBAMTE1BvbGFyc3NsIFRlc3QgRUMgQ0EwHhcN\r\n" -"MTMwOTI0MTU1MjA0WhcNMjMwOTIyMTU1MjA0WjBBMQswCQYDVQQGEwJOTDERMA8G\r\n" -"A1UEChMIUG9sYXJTU0wxHzAdBgNVBAMTFlBvbGFyU1NMIFRlc3QgQ2xpZW50IDIw\r\n" -"WTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAARX5a6xc9/TrLuTuIH/Eq7u5lOszlVT\r\n" -"9jQOzC7jYyUL35ji81xgNpbA1RgUcOV/n9VLRRjlsGzVXPiWj4dwo+THo4GdMIGa\r\n" -"MAkGA1UdEwQCMAAwHQYDVR0OBBYEFHoAX4Zk/OBd5REQO7LmO8QmP8/iMG4GA1Ud\r\n" -"IwRnMGWAFJ1tICRJAT8ry3i1Gbx+JMnb+zZ8oUKkQDA+MQswCQYDVQQGEwJOTDER\r\n" -"MA8GA1UEChMIUG9sYXJTU0wxHDAaBgNVBAMTE1BvbGFyc3NsIFRlc3QgRUMgQ0GC\r\n" -"CQDBQ+J+YkPM6DAKBggqhkjOPQQDAgNoADBlAjBKZQ17IIOimbmoD/yN7o89u3BM\r\n" -"lgOsjnhw3fIOoLIWy2WOGsk/LGF++DzvrRzuNiACMQCd8iem1XS4JK7haj8xocpU\r\n" -"LwjQje5PDGHfd3h9tP38Qknu5bJqws0md2KOKHyeV0U=\r\n" -"-----END CERTIFICATE-----\r\n"; -const size_t mbedtls_test_cli_crt_ec_len = sizeof( mbedtls_test_cli_crt_ec ); - -const char mbedtls_test_cli_key_ec[] = -"-----BEGIN EC PRIVATE KEY-----\r\n" -"MHcCAQEEIPb3hmTxZ3/mZI3vyk7p3U3wBf+WIop6hDhkFzJhmLcqoAoGCCqGSM49\r\n" -"AwEHoUQDQgAEV+WusXPf06y7k7iB/xKu7uZTrM5VU/Y0Dswu42MlC9+Y4vNcYDaW\r\n" -"wNUYFHDlf5/VS0UY5bBs1Vz4lo+HcKPkxw==\r\n" -"-----END EC PRIVATE KEY-----\r\n"; -const size_t mbedtls_test_cli_key_ec_len = sizeof( mbedtls_test_cli_key_ec ); -#endif /* MBEDTLS_ECDSA_C */ +/* + * Test CA Certificates + * + * We define test CA certificates for each choice of the following parameters: + * - PEM or DER encoding + * - SHA-1 or SHA-256 hash + * - RSA or EC key + * + * Things to add: + * - multiple EC curve types + * + */ -#if defined(MBEDTLS_RSA_C) +/* This is taken from tests/data_files/test-ca2.crt */ +/* BEGIN FILE string macro TEST_CA_CRT_EC_PEM tests/data_files/test-ca2.crt */ +#define TEST_CA_CRT_EC_PEM \ + "-----BEGIN CERTIFICATE-----\r\n" \ + "MIICUjCCAdegAwIBAgIJAMFD4n5iQ8zoMAoGCCqGSM49BAMCMD4xCzAJBgNVBAYT\r\n" \ + "Ak5MMREwDwYDVQQKEwhQb2xhclNTTDEcMBoGA1UEAxMTUG9sYXJzc2wgVGVzdCBF\r\n" \ + "QyBDQTAeFw0xMzA5MjQxNTQ5NDhaFw0yMzA5MjIxNTQ5NDhaMD4xCzAJBgNVBAYT\r\n" \ + "Ak5MMREwDwYDVQQKEwhQb2xhclNTTDEcMBoGA1UEAxMTUG9sYXJzc2wgVGVzdCBF\r\n" \ + "QyBDQTB2MBAGByqGSM49AgEGBSuBBAAiA2IABMPaKzRBN1gvh1b+/Im6KUNLTuBu\r\n" \ + "ww5XUzM5WNRStJGVOQsj318XJGJI/BqVKc4sLYfCiFKAr9ZqqyHduNMcbli4yuiy\r\n" \ + "aY7zQa0pw7RfdadHb9UZKVVpmlM7ILRmFmAzHqOBoDCBnTAdBgNVHQ4EFgQUnW0g\r\n" \ + "JEkBPyvLeLUZvH4kydv7NnwwbgYDVR0jBGcwZYAUnW0gJEkBPyvLeLUZvH4kydv7\r\n" \ + "NnyhQqRAMD4xCzAJBgNVBAYTAk5MMREwDwYDVQQKEwhQb2xhclNTTDEcMBoGA1UE\r\n" \ + "AxMTUG9sYXJzc2wgVGVzdCBFQyBDQYIJAMFD4n5iQ8zoMAwGA1UdEwQFMAMBAf8w\r\n" \ + "CgYIKoZIzj0EAwIDaQAwZgIxAMO0YnNWKJUAfXgSJtJxexn4ipg+kv4znuR50v56\r\n" \ + "t4d0PCu412mUC6Nnd7izvtE2MgIxAP1nnJQjZ8BWukszFQDG48wxCCyci9qpdSMv\r\n" \ + "uCjn8pwUOkABXK8Mss90fzCfCEOtIA==\r\n" \ + "-----END CERTIFICATE-----\r\n" +/* END FILE */ + +/* This is generated from tests/data_files/test-ca2.crt.der using `xxd -i`. */ +/* BEGIN FILE binary macro TEST_CA_CRT_EC_DER tests/data_files/test-ca2.crt.der */ +#define TEST_CA_CRT_EC_DER { \ + 0x30, 0x82, 0x02, 0x52, 0x30, 0x82, 0x01, 0xd7, 0xa0, 0x03, 0x02, 0x01, \ + 0x02, 0x02, 0x09, 0x00, 0xc1, 0x43, 0xe2, 0x7e, 0x62, 0x43, 0xcc, 0xe8, \ + 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, \ + 0x30, 0x3e, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, \ + 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, \ + 0x13, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, 0x31, 0x1c, \ + 0x30, 0x1a, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x13, 0x50, 0x6f, 0x6c, \ + 0x61, 0x72, 0x73, 0x73, 0x6c, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x45, \ + 0x43, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x33, 0x30, 0x39, \ + 0x32, 0x34, 0x31, 0x35, 0x34, 0x39, 0x34, 0x38, 0x5a, 0x17, 0x0d, 0x32, \ + 0x33, 0x30, 0x39, 0x32, 0x32, 0x31, 0x35, 0x34, 0x39, 0x34, 0x38, 0x5a, \ + 0x30, 0x3e, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, \ + 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, \ + 0x13, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, 0x31, 0x1c, \ + 0x30, 0x1a, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x13, 0x50, 0x6f, 0x6c, \ + 0x61, 0x72, 0x73, 0x73, 0x6c, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x45, \ + 0x43, 0x20, 0x43, 0x41, 0x30, 0x76, 0x30, 0x10, 0x06, 0x07, 0x2a, 0x86, \ + 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x05, 0x2b, 0x81, 0x04, 0x00, 0x22, \ + 0x03, 0x62, 0x00, 0x04, 0xc3, 0xda, 0x2b, 0x34, 0x41, 0x37, 0x58, 0x2f, \ + 0x87, 0x56, 0xfe, 0xfc, 0x89, 0xba, 0x29, 0x43, 0x4b, 0x4e, 0xe0, 0x6e, \ + 0xc3, 0x0e, 0x57, 0x53, 0x33, 0x39, 0x58, 0xd4, 0x52, 0xb4, 0x91, 0x95, \ + 0x39, 0x0b, 0x23, 0xdf, 0x5f, 0x17, 0x24, 0x62, 0x48, 0xfc, 0x1a, 0x95, \ + 0x29, 0xce, 0x2c, 0x2d, 0x87, 0xc2, 0x88, 0x52, 0x80, 0xaf, 0xd6, 0x6a, \ + 0xab, 0x21, 0xdd, 0xb8, 0xd3, 0x1c, 0x6e, 0x58, 0xb8, 0xca, 0xe8, 0xb2, \ + 0x69, 0x8e, 0xf3, 0x41, 0xad, 0x29, 0xc3, 0xb4, 0x5f, 0x75, 0xa7, 0x47, \ + 0x6f, 0xd5, 0x19, 0x29, 0x55, 0x69, 0x9a, 0x53, 0x3b, 0x20, 0xb4, 0x66, \ + 0x16, 0x60, 0x33, 0x1e, 0xa3, 0x81, 0xa0, 0x30, 0x81, 0x9d, 0x30, 0x1d, \ + 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x9d, 0x6d, 0x20, \ + 0x24, 0x49, 0x01, 0x3f, 0x2b, 0xcb, 0x78, 0xb5, 0x19, 0xbc, 0x7e, 0x24, \ + 0xc9, 0xdb, 0xfb, 0x36, 0x7c, 0x30, 0x6e, 0x06, 0x03, 0x55, 0x1d, 0x23, \ + 0x04, 0x67, 0x30, 0x65, 0x80, 0x14, 0x9d, 0x6d, 0x20, 0x24, 0x49, 0x01, \ + 0x3f, 0x2b, 0xcb, 0x78, 0xb5, 0x19, 0xbc, 0x7e, 0x24, 0xc9, 0xdb, 0xfb, \ + 0x36, 0x7c, 0xa1, 0x42, 0xa4, 0x40, 0x30, 0x3e, 0x31, 0x0b, 0x30, 0x09, \ + 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, \ + 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x08, 0x50, 0x6f, 0x6c, 0x61, \ + 0x72, 0x53, 0x53, 0x4c, 0x31, 0x1c, 0x30, 0x1a, 0x06, 0x03, 0x55, 0x04, \ + 0x03, 0x13, 0x13, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x73, 0x73, 0x6c, 0x20, \ + 0x54, 0x65, 0x73, 0x74, 0x20, 0x45, 0x43, 0x20, 0x43, 0x41, 0x82, 0x09, \ + 0x00, 0xc1, 0x43, 0xe2, 0x7e, 0x62, 0x43, 0xcc, 0xe8, 0x30, 0x0c, 0x06, \ + 0x03, 0x55, 0x1d, 0x13, 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, \ + 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, \ + 0x69, 0x00, 0x30, 0x66, 0x02, 0x31, 0x00, 0xc3, 0xb4, 0x62, 0x73, 0x56, \ + 0x28, 0x95, 0x00, 0x7d, 0x78, 0x12, 0x26, 0xd2, 0x71, 0x7b, 0x19, 0xf8, \ + 0x8a, 0x98, 0x3e, 0x92, 0xfe, 0x33, 0x9e, 0xe4, 0x79, 0xd2, 0xfe, 0x7a, \ + 0xb7, 0x87, 0x74, 0x3c, 0x2b, 0xb8, 0xd7, 0x69, 0x94, 0x0b, 0xa3, 0x67, \ + 0x77, 0xb8, 0xb3, 0xbe, 0xd1, 0x36, 0x32, 0x02, 0x31, 0x00, 0xfd, 0x67, \ + 0x9c, 0x94, 0x23, 0x67, 0xc0, 0x56, 0xba, 0x4b, 0x33, 0x15, 0x00, 0xc6, \ + 0xe3, 0xcc, 0x31, 0x08, 0x2c, 0x9c, 0x8b, 0xda, 0xa9, 0x75, 0x23, 0x2f, \ + 0xb8, 0x28, 0xe7, 0xf2, 0x9c, 0x14, 0x3a, 0x40, 0x01, 0x5c, 0xaf, 0x0c, \ + 0xb2, 0xcf, 0x74, 0x7f, 0x30, 0x9f, 0x08, 0x43, 0xad, 0x20 \ +} +/* END FILE */ + +/* This is taken from tests/data_files/test-ca2.key.enc */ +/* BEGIN FILE string macro TEST_CA_KEY_EC_PEM tests/data_files/test-ca2.key.enc */ +#define TEST_CA_KEY_EC_PEM \ + "-----BEGIN EC PRIVATE KEY-----\r\n" \ + "Proc-Type: 4,ENCRYPTED\r\n" \ + "DEK-Info: DES-EDE3-CBC,307EAB469933D64E\r\n" \ + "\r\n" \ + "IxbrRmKcAzctJqPdTQLA4SWyBYYGYJVkYEna+F7Pa5t5Yg/gKADrFKcm6B72e7DG\r\n" \ + "ihExtZI648s0zdYw6qSJ74vrPSuWDe5qm93BqsfVH9svtCzWHW0pm1p0KTBCFfUq\r\n" \ + "UsuWTITwJImcnlAs1gaRZ3sAWm7cOUidL0fo2G0fYUFNcYoCSLffCFTEHBuPnagb\r\n" \ + "a77x/sY1Bvii8S9/XhDTb6pTMx06wzrm\r\n" \ + "-----END EC PRIVATE KEY-----\r\n" +/* END FILE */ + +#define TEST_CA_PWD_EC_PEM "PolarSSLTest" + +/* This is generated from tests/data_files/test-ca2.key.der using `xxd -i`. */ +/* BEGIN FILE binary macro TEST_CA_KEY_EC_DER tests/data_files/test-ca2.key.der */ +#define TEST_CA_KEY_EC_DER { \ + 0x30, 0x81, 0xa4, 0x02, 0x01, 0x01, 0x04, 0x30, 0x83, 0xd9, 0x15, 0x0e, \ + 0xa0, 0x71, 0xf0, 0x57, 0x10, 0x33, 0xa3, 0x38, 0xb8, 0x86, 0xc1, 0xa6, \ + 0x11, 0x5d, 0x6d, 0xb4, 0x03, 0xe1, 0x29, 0x76, 0x45, 0xd7, 0x87, 0x6f, \ + 0x23, 0xab, 0x44, 0x20, 0xea, 0x64, 0x7b, 0x85, 0xb1, 0x76, 0xe7, 0x85, \ + 0x95, 0xaa, 0x74, 0xd6, 0xd1, 0xa4, 0x5e, 0xea, 0xa0, 0x07, 0x06, 0x05, \ + 0x2b, 0x81, 0x04, 0x00, 0x22, 0xa1, 0x64, 0x03, 0x62, 0x00, 0x04, 0xc3, \ + 0xda, 0x2b, 0x34, 0x41, 0x37, 0x58, 0x2f, 0x87, 0x56, 0xfe, 0xfc, 0x89, \ + 0xba, 0x29, 0x43, 0x4b, 0x4e, 0xe0, 0x6e, 0xc3, 0x0e, 0x57, 0x53, 0x33, \ + 0x39, 0x58, 0xd4, 0x52, 0xb4, 0x91, 0x95, 0x39, 0x0b, 0x23, 0xdf, 0x5f, \ + 0x17, 0x24, 0x62, 0x48, 0xfc, 0x1a, 0x95, 0x29, 0xce, 0x2c, 0x2d, 0x87, \ + 0xc2, 0x88, 0x52, 0x80, 0xaf, 0xd6, 0x6a, 0xab, 0x21, 0xdd, 0xb8, 0xd3, \ + 0x1c, 0x6e, 0x58, 0xb8, 0xca, 0xe8, 0xb2, 0x69, 0x8e, 0xf3, 0x41, 0xad, \ + 0x29, 0xc3, 0xb4, 0x5f, 0x75, 0xa7, 0x47, 0x6f, 0xd5, 0x19, 0x29, 0x55, \ + 0x69, 0x9a, 0x53, 0x3b, 0x20, 0xb4, 0x66, 0x16, 0x60, 0x33, 0x1e \ +} +/* END FILE */ + +/* This is taken from tests/data_files/test-ca-sha256.crt. */ +/* BEGIN FILE string macro TEST_CA_CRT_RSA_SHA256_PEM tests/data_files/test-ca-sha256.crt */ +#define TEST_CA_CRT_RSA_SHA256_PEM \ + "-----BEGIN CERTIFICATE-----\r\n" \ + "MIIDQTCCAimgAwIBAgIBAzANBgkqhkiG9w0BAQsFADA7MQswCQYDVQQGEwJOTDER\r\n" \ + "MA8GA1UECgwIUG9sYXJTU0wxGTAXBgNVBAMMEFBvbGFyU1NMIFRlc3QgQ0EwHhcN\r\n" \ + "MTEwMjEyMTQ0NDAwWhcNMjEwMjEyMTQ0NDAwWjA7MQswCQYDVQQGEwJOTDERMA8G\r\n" \ + "A1UECgwIUG9sYXJTU0wxGTAXBgNVBAMMEFBvbGFyU1NMIFRlc3QgQ0EwggEiMA0G\r\n" \ + "CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDA3zf8F7vglp0/ht6WMn1EpRagzSHx\r\n" \ + "mdTs6st8GFgIlKXsm8WL3xoemTiZhx57wI053zhdcHgH057Zk+i5clHFzqMwUqny\r\n" \ + "50BwFMtEonILwuVA+T7lpg6z+exKY8C4KQB0nFc7qKUEkHHxvYPZP9al4jwqj+8n\r\n" \ + "YMPGn8u67GB9t+aEMr5P+1gmIgNb1LTV+/Xjli5wwOQuvfwu7uJBVcA0Ln0kcmnL\r\n" \ + "R7EUQIN9Z/SG9jGr8XmksrUuEvmEF/Bibyc+E1ixVA0hmnM3oTDPb5Lc9un8rNsu\r\n" \ + "KNF+AksjoBXyOGVkCeoMbo4bF6BxyLObyavpw/LPh5aPgAIynplYb6LVAgMBAAGj\r\n" \ + "UDBOMAwGA1UdEwQFMAMBAf8wHQYDVR0OBBYEFLRa5KWz3tJS9rnVppUP6z68x/3/\r\n" \ + "MB8GA1UdIwQYMBaAFLRa5KWz3tJS9rnVppUP6z68x/3/MA0GCSqGSIb3DQEBCwUA\r\n" \ + "A4IBAQB2W2dIy4q4KysbrTL4HIaOqu62RceGuQ/KhyiI6O0ndCtQ/PgCBqHHTP8u\r\n" \ + "8F1X2ivb60ynHV6baMLPI4Kf1k4MONtLSf/++1qh0Gdycd3A8IDAfy0YnC1F3OPK\r\n" \ + "vWO/cZGitKoTbEpP4y4Rng3sFCDndRCWIRIDOEEW/H3lCcfL7sOQojdLl85ajFkh\r\n" \ + "YvcDqjmnTcspUnuq9Y00C7porXJthZwz1S18qVjcFNk0zEhVMUbupSrdXVmKtOJW\r\n" \ + "MWZjgcA+OXzcnb2hSKWbhjykH/u6/PqkuHPkD723rwXbmHdxRVS9CW57kDkn5ezJ\r\n" \ + "5pE6Sam4qFsCNFJNBV9FRf3ZBMFi\r\n" \ + "-----END CERTIFICATE-----\r\n" +/* END FILE */ + +/* This is generated from tests/data_files/test-ca-sha256.crt.der + * using `xxd -i`. */ +/* BEGIN FILE binary macro TEST_CA_CRT_RSA_SHA256_DER tests/data_files/test-ca-sha256.crt.der */ +#define TEST_CA_CRT_RSA_SHA256_DER { \ + 0x30, 0x82, 0x03, 0x41, 0x30, 0x82, 0x02, 0x29, 0xa0, 0x03, 0x02, 0x01, \ + 0x02, 0x02, 0x01, 0x03, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, \ + 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30, 0x3b, 0x31, 0x0b, 0x30, \ + 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, \ + 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, \ + 0x61, 0x72, 0x53, 0x53, 0x4c, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, \ + 0x04, 0x03, 0x0c, 0x10, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, \ + 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, \ + 0x31, 0x31, 0x30, 0x32, 0x31, 0x32, 0x31, 0x34, 0x34, 0x34, 0x30, 0x30, \ + 0x5a, 0x17, 0x0d, 0x32, 0x31, 0x30, 0x32, 0x31, 0x32, 0x31, 0x34, 0x34, \ + 0x34, 0x30, 0x30, 0x5a, 0x30, 0x3b, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, \ + 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, \ + 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, \ + 0x53, 0x4c, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, \ + 0x10, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, 0x20, 0x54, 0x65, \ + 0x73, 0x74, 0x20, 0x43, 0x41, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, \ + 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, \ + 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, \ + 0x01, 0x00, 0xc0, 0xdf, 0x37, 0xfc, 0x17, 0xbb, 0xe0, 0x96, 0x9d, 0x3f, \ + 0x86, 0xde, 0x96, 0x32, 0x7d, 0x44, 0xa5, 0x16, 0xa0, 0xcd, 0x21, 0xf1, \ + 0x99, 0xd4, 0xec, 0xea, 0xcb, 0x7c, 0x18, 0x58, 0x08, 0x94, 0xa5, 0xec, \ + 0x9b, 0xc5, 0x8b, 0xdf, 0x1a, 0x1e, 0x99, 0x38, 0x99, 0x87, 0x1e, 0x7b, \ + 0xc0, 0x8d, 0x39, 0xdf, 0x38, 0x5d, 0x70, 0x78, 0x07, 0xd3, 0x9e, 0xd9, \ + 0x93, 0xe8, 0xb9, 0x72, 0x51, 0xc5, 0xce, 0xa3, 0x30, 0x52, 0xa9, 0xf2, \ + 0xe7, 0x40, 0x70, 0x14, 0xcb, 0x44, 0xa2, 0x72, 0x0b, 0xc2, 0xe5, 0x40, \ + 0xf9, 0x3e, 0xe5, 0xa6, 0x0e, 0xb3, 0xf9, 0xec, 0x4a, 0x63, 0xc0, 0xb8, \ + 0x29, 0x00, 0x74, 0x9c, 0x57, 0x3b, 0xa8, 0xa5, 0x04, 0x90, 0x71, 0xf1, \ + 0xbd, 0x83, 0xd9, 0x3f, 0xd6, 0xa5, 0xe2, 0x3c, 0x2a, 0x8f, 0xef, 0x27, \ + 0x60, 0xc3, 0xc6, 0x9f, 0xcb, 0xba, 0xec, 0x60, 0x7d, 0xb7, 0xe6, 0x84, \ + 0x32, 0xbe, 0x4f, 0xfb, 0x58, 0x26, 0x22, 0x03, 0x5b, 0xd4, 0xb4, 0xd5, \ + 0xfb, 0xf5, 0xe3, 0x96, 0x2e, 0x70, 0xc0, 0xe4, 0x2e, 0xbd, 0xfc, 0x2e, \ + 0xee, 0xe2, 0x41, 0x55, 0xc0, 0x34, 0x2e, 0x7d, 0x24, 0x72, 0x69, 0xcb, \ + 0x47, 0xb1, 0x14, 0x40, 0x83, 0x7d, 0x67, 0xf4, 0x86, 0xf6, 0x31, 0xab, \ + 0xf1, 0x79, 0xa4, 0xb2, 0xb5, 0x2e, 0x12, 0xf9, 0x84, 0x17, 0xf0, 0x62, \ + 0x6f, 0x27, 0x3e, 0x13, 0x58, 0xb1, 0x54, 0x0d, 0x21, 0x9a, 0x73, 0x37, \ + 0xa1, 0x30, 0xcf, 0x6f, 0x92, 0xdc, 0xf6, 0xe9, 0xfc, 0xac, 0xdb, 0x2e, \ + 0x28, 0xd1, 0x7e, 0x02, 0x4b, 0x23, 0xa0, 0x15, 0xf2, 0x38, 0x65, 0x64, \ + 0x09, 0xea, 0x0c, 0x6e, 0x8e, 0x1b, 0x17, 0xa0, 0x71, 0xc8, 0xb3, 0x9b, \ + 0xc9, 0xab, 0xe9, 0xc3, 0xf2, 0xcf, 0x87, 0x96, 0x8f, 0x80, 0x02, 0x32, \ + 0x9e, 0x99, 0x58, 0x6f, 0xa2, 0xd5, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, \ + 0x50, 0x30, 0x4e, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04, 0x05, \ + 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, \ + 0x04, 0x16, 0x04, 0x14, 0xb4, 0x5a, 0xe4, 0xa5, 0xb3, 0xde, 0xd2, 0x52, \ + 0xf6, 0xb9, 0xd5, 0xa6, 0x95, 0x0f, 0xeb, 0x3e, 0xbc, 0xc7, 0xfd, 0xff, \ + 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, \ + 0x14, 0xb4, 0x5a, 0xe4, 0xa5, 0xb3, 0xde, 0xd2, 0x52, 0xf6, 0xb9, 0xd5, \ + 0xa6, 0x95, 0x0f, 0xeb, 0x3e, 0xbc, 0xc7, 0xfd, 0xff, 0x30, 0x0d, 0x06, \ + 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, \ + 0x03, 0x82, 0x01, 0x01, 0x00, 0x76, 0x5b, 0x67, 0x48, 0xcb, 0x8a, 0xb8, \ + 0x2b, 0x2b, 0x1b, 0xad, 0x32, 0xf8, 0x1c, 0x86, 0x8e, 0xaa, 0xee, 0xb6, \ + 0x45, 0xc7, 0x86, 0xb9, 0x0f, 0xca, 0x87, 0x28, 0x88, 0xe8, 0xed, 0x27, \ + 0x74, 0x2b, 0x50, 0xfc, 0xf8, 0x02, 0x06, 0xa1, 0xc7, 0x4c, 0xff, 0x2e, \ + 0xf0, 0x5d, 0x57, 0xda, 0x2b, 0xdb, 0xeb, 0x4c, 0xa7, 0x1d, 0x5e, 0x9b, \ + 0x68, 0xc2, 0xcf, 0x23, 0x82, 0x9f, 0xd6, 0x4e, 0x0c, 0x38, 0xdb, 0x4b, \ + 0x49, 0xff, 0xfe, 0xfb, 0x5a, 0xa1, 0xd0, 0x67, 0x72, 0x71, 0xdd, 0xc0, \ + 0xf0, 0x80, 0xc0, 0x7f, 0x2d, 0x18, 0x9c, 0x2d, 0x45, 0xdc, 0xe3, 0xca, \ + 0xbd, 0x63, 0xbf, 0x71, 0x91, 0xa2, 0xb4, 0xaa, 0x13, 0x6c, 0x4a, 0x4f, \ + 0xe3, 0x2e, 0x11, 0x9e, 0x0d, 0xec, 0x14, 0x20, 0xe7, 0x75, 0x10, 0x96, \ + 0x21, 0x12, 0x03, 0x38, 0x41, 0x16, 0xfc, 0x7d, 0xe5, 0x09, 0xc7, 0xcb, \ + 0xee, 0xc3, 0x90, 0xa2, 0x37, 0x4b, 0x97, 0xce, 0x5a, 0x8c, 0x59, 0x21, \ + 0x62, 0xf7, 0x03, 0xaa, 0x39, 0xa7, 0x4d, 0xcb, 0x29, 0x52, 0x7b, 0xaa, \ + 0xf5, 0x8d, 0x34, 0x0b, 0xba, 0x68, 0xad, 0x72, 0x6d, 0x85, 0x9c, 0x33, \ + 0xd5, 0x2d, 0x7c, 0xa9, 0x58, 0xdc, 0x14, 0xd9, 0x34, 0xcc, 0x48, 0x55, \ + 0x31, 0x46, 0xee, 0xa5, 0x2a, 0xdd, 0x5d, 0x59, 0x8a, 0xb4, 0xe2, 0x56, \ + 0x31, 0x66, 0x63, 0x81, 0xc0, 0x3e, 0x39, 0x7c, 0xdc, 0x9d, 0xbd, 0xa1, \ + 0x48, 0xa5, 0x9b, 0x86, 0x3c, 0xa4, 0x1f, 0xfb, 0xba, 0xfc, 0xfa, 0xa4, \ + 0xb8, 0x73, 0xe4, 0x0f, 0xbd, 0xb7, 0xaf, 0x05, 0xdb, 0x98, 0x77, 0x71, \ + 0x45, 0x54, 0xbd, 0x09, 0x6e, 0x7b, 0x90, 0x39, 0x27, 0xe5, 0xec, 0xc9, \ + 0xe6, 0x91, 0x3a, 0x49, 0xa9, 0xb8, 0xa8, 0x5b, 0x02, 0x34, 0x52, 0x4d, \ + 0x05, 0x5f, 0x45, 0x45, 0xfd, 0xd9, 0x04, 0xc1, 0x62 \ +} +/* END FILE */ + +/* This is taken from tests/data_files/test-ca-sha1.crt. */ +/* BEGIN FILE string macro TEST_CA_CRT_RSA_SHA1_PEM tests/data_files/test-ca-sha1.crt */ +#define TEST_CA_CRT_RSA_SHA1_PEM \ + "-----BEGIN CERTIFICATE-----\r\n" \ + "MIIDQTCCAimgAwIBAgIBAzANBgkqhkiG9w0BAQUFADA7MQswCQYDVQQGEwJOTDER\r\n" \ + "MA8GA1UECgwIUG9sYXJTU0wxGTAXBgNVBAMMEFBvbGFyU1NMIFRlc3QgQ0EwHhcN\r\n" \ + "MTEwMjEyMTQ0NDAwWhcNMjEwMjEyMTQ0NDAwWjA7MQswCQYDVQQGEwJOTDERMA8G\r\n" \ + "A1UECgwIUG9sYXJTU0wxGTAXBgNVBAMMEFBvbGFyU1NMIFRlc3QgQ0EwggEiMA0G\r\n" \ + "CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDA3zf8F7vglp0/ht6WMn1EpRagzSHx\r\n" \ + "mdTs6st8GFgIlKXsm8WL3xoemTiZhx57wI053zhdcHgH057Zk+i5clHFzqMwUqny\r\n" \ + "50BwFMtEonILwuVA+T7lpg6z+exKY8C4KQB0nFc7qKUEkHHxvYPZP9al4jwqj+8n\r\n" \ + "YMPGn8u67GB9t+aEMr5P+1gmIgNb1LTV+/Xjli5wwOQuvfwu7uJBVcA0Ln0kcmnL\r\n" \ + "R7EUQIN9Z/SG9jGr8XmksrUuEvmEF/Bibyc+E1ixVA0hmnM3oTDPb5Lc9un8rNsu\r\n" \ + "KNF+AksjoBXyOGVkCeoMbo4bF6BxyLObyavpw/LPh5aPgAIynplYb6LVAgMBAAGj\r\n" \ + "UDBOMAwGA1UdEwQFMAMBAf8wHQYDVR0OBBYEFLRa5KWz3tJS9rnVppUP6z68x/3/\r\n" \ + "MB8GA1UdIwQYMBaAFLRa5KWz3tJS9rnVppUP6z68x/3/MA0GCSqGSIb3DQEBBQUA\r\n" \ + "A4IBAQABE3OEPfEd/bcJW5ZdU3/VgPNS4tMzh8gnJP/V2FcvFtGylMpQq6YnEBYI\r\n" \ + "yBHAL4DRvlMY5rnXGBp3ODR8MpqHC6AquRTCLzjS57iYff//4QFQqW9n92zctspv\r\n" \ + "czkaPKgjqo1No3Uq0Xaz10rcxyTUPrf5wNVRZ2V0KvllvAAVSzbI4mpdUXztjhST\r\n" \ + "S5A2BeWQAAOr0zq1F7TSRVJpJs7jmB2ai/igkh1IAjcuwV6VwlP+sbw0gjQ0NpGM\r\n" \ + "iHpnlzRAi/tIbtOvMIGOBU2TIfax/5jq1agUx5aPmT5TWAiJPOOP6l5xXnDwxeYS\r\n" \ + "NWqiX9GyusBZjezaCaHabjDLU0qQ\r\n" \ + "-----END CERTIFICATE-----\r\n" +/* END FILE */ + +/* This is taken from tests/data_files/test-ca-sha1.crt.der. */ +/* BEGIN FILE binary macro TEST_CA_CRT_RSA_SHA1_DER tests/data_files/test-ca-sha1.crt.der */ +#define TEST_CA_CRT_RSA_SHA1_DER { \ + 0x30, 0x82, 0x03, 0x41, 0x30, 0x82, 0x02, 0x29, 0xa0, 0x03, 0x02, 0x01, \ + 0x02, 0x02, 0x01, 0x03, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, \ + 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x3b, 0x31, 0x0b, 0x30, \ + 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, \ + 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, \ + 0x61, 0x72, 0x53, 0x53, 0x4c, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, \ + 0x04, 0x03, 0x0c, 0x10, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, \ + 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, \ + 0x31, 0x31, 0x30, 0x32, 0x31, 0x32, 0x31, 0x34, 0x34, 0x34, 0x30, 0x30, \ + 0x5a, 0x17, 0x0d, 0x32, 0x31, 0x30, 0x32, 0x31, 0x32, 0x31, 0x34, 0x34, \ + 0x34, 0x30, 0x30, 0x5a, 0x30, 0x3b, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, \ + 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, \ + 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, \ + 0x53, 0x4c, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, \ + 0x10, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, 0x20, 0x54, 0x65, \ + 0x73, 0x74, 0x20, 0x43, 0x41, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, \ + 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, \ + 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, \ + 0x01, 0x00, 0xc0, 0xdf, 0x37, 0xfc, 0x17, 0xbb, 0xe0, 0x96, 0x9d, 0x3f, \ + 0x86, 0xde, 0x96, 0x32, 0x7d, 0x44, 0xa5, 0x16, 0xa0, 0xcd, 0x21, 0xf1, \ + 0x99, 0xd4, 0xec, 0xea, 0xcb, 0x7c, 0x18, 0x58, 0x08, 0x94, 0xa5, 0xec, \ + 0x9b, 0xc5, 0x8b, 0xdf, 0x1a, 0x1e, 0x99, 0x38, 0x99, 0x87, 0x1e, 0x7b, \ + 0xc0, 0x8d, 0x39, 0xdf, 0x38, 0x5d, 0x70, 0x78, 0x07, 0xd3, 0x9e, 0xd9, \ + 0x93, 0xe8, 0xb9, 0x72, 0x51, 0xc5, 0xce, 0xa3, 0x30, 0x52, 0xa9, 0xf2, \ + 0xe7, 0x40, 0x70, 0x14, 0xcb, 0x44, 0xa2, 0x72, 0x0b, 0xc2, 0xe5, 0x40, \ + 0xf9, 0x3e, 0xe5, 0xa6, 0x0e, 0xb3, 0xf9, 0xec, 0x4a, 0x63, 0xc0, 0xb8, \ + 0x29, 0x00, 0x74, 0x9c, 0x57, 0x3b, 0xa8, 0xa5, 0x04, 0x90, 0x71, 0xf1, \ + 0xbd, 0x83, 0xd9, 0x3f, 0xd6, 0xa5, 0xe2, 0x3c, 0x2a, 0x8f, 0xef, 0x27, \ + 0x60, 0xc3, 0xc6, 0x9f, 0xcb, 0xba, 0xec, 0x60, 0x7d, 0xb7, 0xe6, 0x84, \ + 0x32, 0xbe, 0x4f, 0xfb, 0x58, 0x26, 0x22, 0x03, 0x5b, 0xd4, 0xb4, 0xd5, \ + 0xfb, 0xf5, 0xe3, 0x96, 0x2e, 0x70, 0xc0, 0xe4, 0x2e, 0xbd, 0xfc, 0x2e, \ + 0xee, 0xe2, 0x41, 0x55, 0xc0, 0x34, 0x2e, 0x7d, 0x24, 0x72, 0x69, 0xcb, \ + 0x47, 0xb1, 0x14, 0x40, 0x83, 0x7d, 0x67, 0xf4, 0x86, 0xf6, 0x31, 0xab, \ + 0xf1, 0x79, 0xa4, 0xb2, 0xb5, 0x2e, 0x12, 0xf9, 0x84, 0x17, 0xf0, 0x62, \ + 0x6f, 0x27, 0x3e, 0x13, 0x58, 0xb1, 0x54, 0x0d, 0x21, 0x9a, 0x73, 0x37, \ + 0xa1, 0x30, 0xcf, 0x6f, 0x92, 0xdc, 0xf6, 0xe9, 0xfc, 0xac, 0xdb, 0x2e, \ + 0x28, 0xd1, 0x7e, 0x02, 0x4b, 0x23, 0xa0, 0x15, 0xf2, 0x38, 0x65, 0x64, \ + 0x09, 0xea, 0x0c, 0x6e, 0x8e, 0x1b, 0x17, 0xa0, 0x71, 0xc8, 0xb3, 0x9b, \ + 0xc9, 0xab, 0xe9, 0xc3, 0xf2, 0xcf, 0x87, 0x96, 0x8f, 0x80, 0x02, 0x32, \ + 0x9e, 0x99, 0x58, 0x6f, 0xa2, 0xd5, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, \ + 0x50, 0x30, 0x4e, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04, 0x05, \ + 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, \ + 0x04, 0x16, 0x04, 0x14, 0xb4, 0x5a, 0xe4, 0xa5, 0xb3, 0xde, 0xd2, 0x52, \ + 0xf6, 0xb9, 0xd5, 0xa6, 0x95, 0x0f, 0xeb, 0x3e, 0xbc, 0xc7, 0xfd, 0xff, \ + 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, \ + 0x14, 0xb4, 0x5a, 0xe4, 0xa5, 0xb3, 0xde, 0xd2, 0x52, 0xf6, 0xb9, 0xd5, \ + 0xa6, 0x95, 0x0f, 0xeb, 0x3e, 0xbc, 0xc7, 0xfd, 0xff, 0x30, 0x0d, 0x06, \ + 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, \ + 0x03, 0x82, 0x01, 0x01, 0x00, 0x01, 0x13, 0x73, 0x84, 0x3d, 0xf1, 0x1d, \ + 0xfd, 0xb7, 0x09, 0x5b, 0x96, 0x5d, 0x53, 0x7f, 0xd5, 0x80, 0xf3, 0x52, \ + 0xe2, 0xd3, 0x33, 0x87, 0xc8, 0x27, 0x24, 0xff, 0xd5, 0xd8, 0x57, 0x2f, \ + 0x16, 0xd1, 0xb2, 0x94, 0xca, 0x50, 0xab, 0xa6, 0x27, 0x10, 0x16, 0x08, \ + 0xc8, 0x11, 0xc0, 0x2f, 0x80, 0xd1, 0xbe, 0x53, 0x18, 0xe6, 0xb9, 0xd7, \ + 0x18, 0x1a, 0x77, 0x38, 0x34, 0x7c, 0x32, 0x9a, 0x87, 0x0b, 0xa0, 0x2a, \ + 0xb9, 0x14, 0xc2, 0x2f, 0x38, 0xd2, 0xe7, 0xb8, 0x98, 0x7d, 0xff, 0xff, \ + 0xe1, 0x01, 0x50, 0xa9, 0x6f, 0x67, 0xf7, 0x6c, 0xdc, 0xb6, 0xca, 0x6f, \ + 0x73, 0x39, 0x1a, 0x3c, 0xa8, 0x23, 0xaa, 0x8d, 0x4d, 0xa3, 0x75, 0x2a, \ + 0xd1, 0x76, 0xb3, 0xd7, 0x4a, 0xdc, 0xc7, 0x24, 0xd4, 0x3e, 0xb7, 0xf9, \ + 0xc0, 0xd5, 0x51, 0x67, 0x65, 0x74, 0x2a, 0xf9, 0x65, 0xbc, 0x00, 0x15, \ + 0x4b, 0x36, 0xc8, 0xe2, 0x6a, 0x5d, 0x51, 0x7c, 0xed, 0x8e, 0x14, 0x93, \ + 0x4b, 0x90, 0x36, 0x05, 0xe5, 0x90, 0x00, 0x03, 0xab, 0xd3, 0x3a, 0xb5, \ + 0x17, 0xb4, 0xd2, 0x45, 0x52, 0x69, 0x26, 0xce, 0xe3, 0x98, 0x1d, 0x9a, \ + 0x8b, 0xf8, 0xa0, 0x92, 0x1d, 0x48, 0x02, 0x37, 0x2e, 0xc1, 0x5e, 0x95, \ + 0xc2, 0x53, 0xfe, 0xb1, 0xbc, 0x34, 0x82, 0x34, 0x34, 0x36, 0x91, 0x8c, \ + 0x88, 0x7a, 0x67, 0x97, 0x34, 0x40, 0x8b, 0xfb, 0x48, 0x6e, 0xd3, 0xaf, \ + 0x30, 0x81, 0x8e, 0x05, 0x4d, 0x93, 0x21, 0xf6, 0xb1, 0xff, 0x98, 0xea, \ + 0xd5, 0xa8, 0x14, 0xc7, 0x96, 0x8f, 0x99, 0x3e, 0x53, 0x58, 0x08, 0x89, \ + 0x3c, 0xe3, 0x8f, 0xea, 0x5e, 0x71, 0x5e, 0x70, 0xf0, 0xc5, 0xe6, 0x12, \ + 0x35, 0x6a, 0xa2, 0x5f, 0xd1, 0xb2, 0xba, 0xc0, 0x59, 0x8d, 0xec, 0xda, \ + 0x09, 0xa1, 0xda, 0x6e, 0x30, 0xcb, 0x53, 0x4a, 0x90 \ +} +/* END FILE */ + +/* This is taken from tests/data_files/test-ca.key */ +/* BEGIN FILE string macro TEST_CA_KEY_RSA_PEM tests/data_files/test-ca.key */ +#define TEST_CA_KEY_RSA_PEM \ + "-----BEGIN RSA PRIVATE KEY-----\r\n" \ + "Proc-Type: 4,ENCRYPTED\r\n" \ + "DEK-Info: DES-EDE3-CBC,A8A95B05D5B7206B\r\n" \ + "\r\n" \ + "9Qd9GeArejl1GDVh2lLV1bHt0cPtfbh5h/5zVpAVaFpqtSPMrElp50Rntn9et+JA\r\n" \ + "7VOyboR+Iy2t/HU4WvA687k3Bppe9GwKHjHhtl//8xFKwZr3Xb5yO5JUP8AUctQq\r\n" \ + "Nb8CLlZyuUC+52REAAthdWgsX+7dJO4yabzUcQ22Tp9JSD0hiL43BlkWYUNK3dAo\r\n" \ + "PZlmiptjnzVTjg1MxsBSydZinWOLBV8/JQgxSPo2yD4uEfig28qbvQ2wNIn0pnAb\r\n" \ + "GxnSAOazkongEGfvcjIIs+LZN9gXFhxcOh6kc4Q/c99B7QWETwLLkYgZ+z1a9VY9\r\n" \ + "gEU7CwCxYCD+h9hY6FPmsK0/lC4O7aeRKpYq00rPPxs6i7phiexg6ax6yTMmArQq\r\n" \ + "QmK3TAsJm8V/J5AWpLEV6jAFgRGymGGHnof0DXzVWZidrcZJWTNuGEX90nB3ee2w\r\n" \ + "PXJEFWKoD3K3aFcSLdHYr3mLGxP7H9ThQai9VsycxZKS5kwvBKQ//YMrmFfwPk8x\r\n" \ + "vTeY4KZMaUrveEel5tWZC94RSMKgxR6cyE1nBXyTQnDOGbfpNNgBKxyKbINWoOJU\r\n" \ + "WJZAwlsQn+QzCDwpri7+sV1mS3gBE6UY7aQmnmiiaC2V3Hbphxct/en5QsfDOt1X\r\n" \ + "JczSfpRWLlbPznZg8OQh/VgCMA58N5DjOzTIK7sJJ5r+94ZBTCpgAMbF588f0NTR\r\n" \ + "KCe4yrxGJR7X02M4nvD4IwOlpsQ8xQxZtOSgXv4LkxvdU9XJJKWZ/XNKJeWztxSe\r\n" \ + "Z1vdTc2YfsDBA2SEv33vxHx2g1vqtw8SjDRT2RaQSS0QuSaMJimdOX6mTOCBKk1J\r\n" \ + "9Q5mXTrER+/LnK0jEmXsBXWA5bqqVZIyahXSx4VYZ7l7w/PHiUDtDgyRhMMKi4n2\r\n" \ + "iQvQcWSQTjrpnlJbca1/DkpRt3YwrvJwdqb8asZU2VrNETh5x0QVefDRLFiVpif/\r\n" \ + "tUaeAe/P1F8OkS7OIZDs1SUbv/sD2vMbhNkUoCms3/PvNtdnvgL4F0zhaDpKCmlT\r\n" \ + "P8vx49E7v5CyRNmED9zZg4o3wmMqrQO93PtTug3Eu9oVx1zPQM1NVMyBa2+f29DL\r\n" \ + "1nuTCeXdo9+ni45xx+jAI4DCwrRdhJ9uzZyC6962H37H6D+5naNvClFR1s6li1Gb\r\n" \ + "nqPoiy/OBsEx9CaDGcqQBp5Wme/3XW+6z1ISOx+igwNTVCT14mHdBMbya0eIKft5\r\n" \ + "X+GnwtgEMyCYyyWuUct8g4RzErcY9+yW9Om5Hzpx4zOuW4NPZgPDTgK+t2RSL/Yq\r\n" \ + "rE1njrgeGYcVeG3f+OftH4s6fPbq7t1A5ZgUscbLMBqr9tK+OqygR4EgKBPsH6Cz\r\n" \ + "L6zlv/2RV0qAHvVuDJcIDIgwY5rJtINEm32rhOeFNJwZS5MNIC1czXZx5//ugX7l\r\n" \ + "I4sy5nbVhwSjtAk8Xg5dZbdTZ6mIrb7xqH+fdakZor1khG7bC2uIwibD3cSl2XkR\r\n" \ + "wN48lslbHnqqagr6Xm1nNOSVl8C/6kbJEsMpLhAezfRtGwvOucoaE+WbeUNolGde\r\n" \ + "P/eQiddSf0brnpiLJRh7qZrl9XuqYdpUqnoEdMAfotDOID8OtV7gt8a48ad8VPW2\r\n" \ + "-----END RSA PRIVATE KEY-----\r\n" +/* END FILE */ + +#define TEST_CA_PWD_RSA_PEM "PolarSSLTest" + +/* This was generated from test-ca.key.der using `xxd -i`. */ +/* BEGIN FILE binary macro TEST_CA_KEY_RSA_DER tests/data_files/test-ca.key.der */ +#define TEST_CA_KEY_RSA_DER { \ + 0x30, 0x82, 0x04, 0xa4, 0x02, 0x01, 0x00, 0x02, 0x82, 0x01, 0x01, 0x00, \ + 0xc0, 0xdf, 0x37, 0xfc, 0x17, 0xbb, 0xe0, 0x96, 0x9d, 0x3f, 0x86, 0xde, \ + 0x96, 0x32, 0x7d, 0x44, 0xa5, 0x16, 0xa0, 0xcd, 0x21, 0xf1, 0x99, 0xd4, \ + 0xec, 0xea, 0xcb, 0x7c, 0x18, 0x58, 0x08, 0x94, 0xa5, 0xec, 0x9b, 0xc5, \ + 0x8b, 0xdf, 0x1a, 0x1e, 0x99, 0x38, 0x99, 0x87, 0x1e, 0x7b, 0xc0, 0x8d, \ + 0x39, 0xdf, 0x38, 0x5d, 0x70, 0x78, 0x07, 0xd3, 0x9e, 0xd9, 0x93, 0xe8, \ + 0xb9, 0x72, 0x51, 0xc5, 0xce, 0xa3, 0x30, 0x52, 0xa9, 0xf2, 0xe7, 0x40, \ + 0x70, 0x14, 0xcb, 0x44, 0xa2, 0x72, 0x0b, 0xc2, 0xe5, 0x40, 0xf9, 0x3e, \ + 0xe5, 0xa6, 0x0e, 0xb3, 0xf9, 0xec, 0x4a, 0x63, 0xc0, 0xb8, 0x29, 0x00, \ + 0x74, 0x9c, 0x57, 0x3b, 0xa8, 0xa5, 0x04, 0x90, 0x71, 0xf1, 0xbd, 0x83, \ + 0xd9, 0x3f, 0xd6, 0xa5, 0xe2, 0x3c, 0x2a, 0x8f, 0xef, 0x27, 0x60, 0xc3, \ + 0xc6, 0x9f, 0xcb, 0xba, 0xec, 0x60, 0x7d, 0xb7, 0xe6, 0x84, 0x32, 0xbe, \ + 0x4f, 0xfb, 0x58, 0x26, 0x22, 0x03, 0x5b, 0xd4, 0xb4, 0xd5, 0xfb, 0xf5, \ + 0xe3, 0x96, 0x2e, 0x70, 0xc0, 0xe4, 0x2e, 0xbd, 0xfc, 0x2e, 0xee, 0xe2, \ + 0x41, 0x55, 0xc0, 0x34, 0x2e, 0x7d, 0x24, 0x72, 0x69, 0xcb, 0x47, 0xb1, \ + 0x14, 0x40, 0x83, 0x7d, 0x67, 0xf4, 0x86, 0xf6, 0x31, 0xab, 0xf1, 0x79, \ + 0xa4, 0xb2, 0xb5, 0x2e, 0x12, 0xf9, 0x84, 0x17, 0xf0, 0x62, 0x6f, 0x27, \ + 0x3e, 0x13, 0x58, 0xb1, 0x54, 0x0d, 0x21, 0x9a, 0x73, 0x37, 0xa1, 0x30, \ + 0xcf, 0x6f, 0x92, 0xdc, 0xf6, 0xe9, 0xfc, 0xac, 0xdb, 0x2e, 0x28, 0xd1, \ + 0x7e, 0x02, 0x4b, 0x23, 0xa0, 0x15, 0xf2, 0x38, 0x65, 0x64, 0x09, 0xea, \ + 0x0c, 0x6e, 0x8e, 0x1b, 0x17, 0xa0, 0x71, 0xc8, 0xb3, 0x9b, 0xc9, 0xab, \ + 0xe9, 0xc3, 0xf2, 0xcf, 0x87, 0x96, 0x8f, 0x80, 0x02, 0x32, 0x9e, 0x99, \ + 0x58, 0x6f, 0xa2, 0xd5, 0x02, 0x03, 0x01, 0x00, 0x01, 0x02, 0x82, 0x01, \ + 0x00, 0x3f, 0xf7, 0x07, 0xd3, 0x34, 0x6f, 0xdb, 0xc9, 0x37, 0xb7, 0x84, \ + 0xdc, 0x37, 0x45, 0xe1, 0x63, 0xad, 0xb8, 0xb6, 0x75, 0xb1, 0xc7, 0x35, \ + 0xb4, 0x77, 0x2a, 0x5b, 0x77, 0xf9, 0x7e, 0xe0, 0xc1, 0xa3, 0xd1, 0xb7, \ + 0xcb, 0xa9, 0x5a, 0xc1, 0x87, 0xda, 0x5a, 0xfa, 0x17, 0xe4, 0xd5, 0x38, \ + 0x03, 0xde, 0x68, 0x98, 0x81, 0xec, 0xb5, 0xf2, 0x2a, 0x8d, 0xe9, 0x2c, \ + 0xf3, 0xa6, 0xe5, 0x32, 0x17, 0x7f, 0x33, 0x81, 0xe8, 0x38, 0x72, 0xd5, \ + 0x9c, 0xfa, 0x4e, 0xfb, 0x26, 0xf5, 0x15, 0x0b, 0xaf, 0x84, 0x66, 0xab, \ + 0x02, 0xe0, 0x18, 0xd5, 0x91, 0x7c, 0xd6, 0x8f, 0xc9, 0x4b, 0x76, 0x08, \ + 0x2b, 0x1d, 0x81, 0x68, 0x30, 0xe1, 0xfa, 0x70, 0x6c, 0x13, 0x4e, 0x10, \ + 0x03, 0x35, 0x3e, 0xc5, 0xca, 0x58, 0x20, 0x8a, 0x21, 0x18, 0x38, 0xa0, \ + 0x0f, 0xed, 0xc4, 0xbb, 0x45, 0x6f, 0xf5, 0x84, 0x5b, 0xb0, 0xcf, 0x4e, \ + 0x9d, 0x58, 0x13, 0x6b, 0x35, 0x35, 0x69, 0xa1, 0xd2, 0xc4, 0xf2, 0xc1, \ + 0x48, 0x04, 0x20, 0x51, 0xb9, 0x6b, 0xa4, 0x5d, 0xa5, 0x4b, 0x84, 0x88, \ + 0x43, 0x48, 0x99, 0x2c, 0xbb, 0xa4, 0x97, 0xd6, 0xd6, 0x18, 0xf6, 0xec, \ + 0x5c, 0xd1, 0x31, 0x49, 0xc9, 0xf2, 0x8f, 0x0b, 0x4d, 0xef, 0x09, 0x02, \ + 0xfe, 0x7d, 0xfd, 0xbb, 0xaf, 0x2b, 0x83, 0x94, 0x22, 0xc4, 0xa7, 0x3e, \ + 0x66, 0xf5, 0xe0, 0x57, 0xdc, 0xf2, 0xed, 0x2c, 0x3e, 0x81, 0x74, 0x76, \ + 0x1e, 0x96, 0x6f, 0x74, 0x1e, 0x32, 0x0e, 0x14, 0x31, 0xd0, 0x74, 0xf0, \ + 0xf4, 0x07, 0xbd, 0xc3, 0xd1, 0x22, 0xc2, 0xa8, 0x95, 0x92, 0x06, 0x7f, \ + 0x43, 0x02, 0x91, 0xbc, 0xdd, 0x23, 0x01, 0x89, 0x94, 0x20, 0x44, 0x64, \ + 0xf5, 0x1d, 0x67, 0xd2, 0x8f, 0xe8, 0x69, 0xa5, 0x29, 0x25, 0xe6, 0x50, \ + 0x9c, 0xe3, 0xe9, 0xcb, 0x75, 0x02, 0x81, 0x81, 0x00, 0xe2, 0x29, 0x3e, \ + 0xaa, 0x6b, 0xd5, 0x59, 0x1e, 0x9c, 0xe6, 0x47, 0xd5, 0xb6, 0xd7, 0xe3, \ + 0xf1, 0x8e, 0x9e, 0xe9, 0x83, 0x5f, 0x10, 0x9f, 0x63, 0xec, 0x04, 0x44, \ + 0xcc, 0x3f, 0xf8, 0xd9, 0x3a, 0x17, 0xe0, 0x4f, 0xfe, 0xd8, 0x4d, 0xcd, \ + 0x46, 0x54, 0x74, 0xbf, 0x0a, 0xc4, 0x67, 0x9c, 0xa7, 0xd8, 0x89, 0x65, \ + 0x4c, 0xfd, 0x58, 0x2a, 0x47, 0x0f, 0xf4, 0x37, 0xb6, 0x55, 0xb0, 0x1d, \ + 0xed, 0xa7, 0x39, 0xfc, 0x4f, 0xa3, 0xc4, 0x75, 0x3a, 0xa3, 0x98, 0xa7, \ + 0x45, 0xf5, 0x66, 0xcb, 0x7c, 0x65, 0xfb, 0x80, 0x23, 0xe6, 0xff, 0xfd, \ + 0x99, 0x1f, 0x8e, 0x6b, 0xff, 0x5e, 0x93, 0x66, 0xdf, 0x6c, 0x6f, 0xc3, \ + 0xf6, 0x38, 0x2e, 0xff, 0x69, 0xb5, 0xac, 0xae, 0xbb, 0xc6, 0x71, 0x16, \ + 0x6b, 0xd0, 0xf8, 0x22, 0xd9, 0xf8, 0xa2, 0x72, 0x20, 0xd2, 0xe2, 0x3a, \ + 0x70, 0x4b, 0xde, 0xab, 0x2f, 0x02, 0x81, 0x81, 0x00, 0xda, 0x51, 0x9b, \ + 0xb8, 0xb2, 0x2a, 0x14, 0x75, 0x58, 0x40, 0x8d, 0x27, 0x70, 0xfa, 0x31, \ + 0x48, 0xb0, 0x20, 0x21, 0x34, 0xfa, 0x4c, 0x57, 0xa8, 0x11, 0x88, 0xf3, \ + 0xa7, 0xae, 0x21, 0xe9, 0xb6, 0x2b, 0xd1, 0xcd, 0xa7, 0xf8, 0xd8, 0x0c, \ + 0x8a, 0x76, 0x22, 0x35, 0x44, 0xce, 0x3f, 0x25, 0x29, 0x83, 0x7d, 0x79, \ + 0xa7, 0x31, 0xd6, 0xec, 0xb2, 0xbf, 0xda, 0x34, 0xb6, 0xf6, 0xb2, 0x3b, \ + 0xf3, 0x78, 0x5a, 0x04, 0x83, 0x33, 0x3e, 0xa2, 0xe2, 0x81, 0x82, 0x13, \ + 0xd4, 0x35, 0x17, 0x63, 0x9b, 0x9e, 0xc4, 0x8d, 0x91, 0x4c, 0x03, 0x77, \ + 0xc7, 0x71, 0x5b, 0xee, 0x83, 0x6d, 0xd5, 0x78, 0x88, 0xf6, 0x2c, 0x79, \ + 0xc2, 0x4a, 0xb4, 0x79, 0x90, 0x70, 0xbf, 0xdf, 0x34, 0x56, 0x96, 0x71, \ + 0xe3, 0x0e, 0x68, 0x91, 0xbc, 0xea, 0xcb, 0x33, 0xc0, 0xbe, 0x45, 0xd7, \ + 0xfc, 0x30, 0xfd, 0x01, 0x3b, 0x02, 0x81, 0x81, 0x00, 0xd2, 0x9f, 0x2a, \ + 0xb7, 0x38, 0x19, 0xc7, 0x17, 0x95, 0x73, 0x78, 0xae, 0xf5, 0xcb, 0x75, \ + 0x83, 0x7f, 0x19, 0x4b, 0xcb, 0x86, 0xfb, 0x4a, 0x15, 0x9a, 0xb6, 0x17, \ + 0x04, 0x49, 0x07, 0x8d, 0xf6, 0x66, 0x4a, 0x06, 0xf6, 0x05, 0xa7, 0xdf, \ + 0x66, 0x82, 0x3c, 0xff, 0xb6, 0x1d, 0x57, 0x89, 0x33, 0x5f, 0x9c, 0x05, \ + 0x75, 0x7f, 0xf3, 0x5d, 0xdc, 0x34, 0x65, 0x72, 0x85, 0x22, 0xa4, 0x14, \ + 0x1b, 0x41, 0xc3, 0xe4, 0xd0, 0x9e, 0x69, 0xd5, 0xeb, 0x38, 0x74, 0x70, \ + 0x43, 0xdc, 0xd9, 0x50, 0xe4, 0x97, 0x6d, 0x73, 0xd6, 0xfb, 0xc8, 0xa7, \ + 0xfa, 0xb4, 0xc2, 0xc4, 0x9d, 0x5d, 0x0c, 0xd5, 0x9f, 0x79, 0xb3, 0x54, \ + 0xc2, 0xb7, 0x6c, 0x3d, 0x7d, 0xcb, 0x2d, 0xf8, 0xc4, 0xf3, 0x78, 0x5a, \ + 0x33, 0x2a, 0xb8, 0x0c, 0x6d, 0x06, 0xfa, 0xf2, 0x62, 0xd3, 0x42, 0xd0, \ + 0xbd, 0xc8, 0x4a, 0xa5, 0x0d, 0x02, 0x81, 0x81, 0x00, 0xd4, 0xa9, 0x90, \ + 0x15, 0xde, 0xbf, 0x2c, 0xc4, 0x8d, 0x9d, 0xfb, 0xa1, 0xc2, 0xe4, 0x83, \ + 0xe3, 0x79, 0x65, 0x22, 0xd3, 0xb7, 0x49, 0x6c, 0x4d, 0x94, 0x1f, 0x22, \ + 0xb1, 0x60, 0xe7, 0x3a, 0x00, 0xb1, 0x38, 0xa2, 0xab, 0x0f, 0xb4, 0x6c, \ + 0xaa, 0xe7, 0x9e, 0x34, 0xe3, 0x7c, 0x40, 0x78, 0x53, 0xb2, 0xf9, 0x23, \ + 0xea, 0xa0, 0x9a, 0xea, 0x60, 0xc8, 0x8f, 0xa6, 0xaf, 0xdf, 0x29, 0x09, \ + 0x4b, 0x06, 0x1e, 0x31, 0xad, 0x17, 0xda, 0xd8, 0xd1, 0xe9, 0x33, 0xab, \ + 0x5b, 0x18, 0x08, 0x5b, 0x87, 0xf8, 0xa5, 0x1f, 0xfd, 0xbb, 0xdc, 0xd8, \ + 0xed, 0x97, 0x57, 0xe4, 0xc3, 0x73, 0xd6, 0xf0, 0x9e, 0x01, 0xa6, 0x9b, \ + 0x48, 0x8e, 0x7a, 0xb4, 0xbb, 0xe5, 0x88, 0x91, 0xc5, 0x2a, 0xdf, 0x4b, \ + 0xba, 0xd0, 0x8b, 0x3e, 0x03, 0x97, 0x77, 0x2f, 0x47, 0x7e, 0x51, 0x0c, \ + 0xae, 0x65, 0x8d, 0xde, 0x87, 0x02, 0x81, 0x80, 0x20, 0x24, 0x0f, 0xd2, \ + 0xaf, 0xc2, 0x28, 0x3b, 0x97, 0x20, 0xb2, 0x92, 0x49, 0xeb, 0x09, 0x68, \ + 0x40, 0xb2, 0xbe, 0xd1, 0xc3, 0x83, 0x94, 0x34, 0x38, 0xd6, 0xc9, 0xec, \ + 0x34, 0x09, 0xf9, 0x41, 0x6d, 0x5c, 0x42, 0x94, 0xf7, 0x04, 0xfc, 0x32, \ + 0x39, 0x69, 0xbc, 0x1c, 0xfb, 0x3e, 0x61, 0x98, 0xc0, 0x80, 0xd8, 0x36, \ + 0x47, 0xc3, 0x6d, 0xc2, 0x2e, 0xe7, 0x81, 0x2a, 0x17, 0x34, 0x64, 0x30, \ + 0x4e, 0x96, 0xbb, 0x26, 0x16, 0xb9, 0x41, 0x36, 0xfe, 0x8a, 0xd6, 0x53, \ + 0x7c, 0xaa, 0xec, 0x39, 0x42, 0x50, 0xef, 0xe3, 0xb3, 0x01, 0x28, 0x32, \ + 0xca, 0x6d, 0xf5, 0x9a, 0x1e, 0x9f, 0x37, 0xbe, 0xfe, 0x38, 0x20, 0x22, \ + 0x91, 0x8c, 0xcd, 0x95, 0x02, 0xf2, 0x4d, 0x6f, 0x1a, 0xb4, 0x43, 0xf0, \ + 0x19, 0xdf, 0x65, 0xc0, 0x92, 0xe7, 0x9d, 0x2f, 0x09, 0xe7, 0xec, 0x69, \ + 0xa8, 0xc2, 0x8f, 0x0d \ +} +/* END FILE */ + +/* + * Test server Certificates + * + * Test server certificates are defined for each choice + * of the following parameters: + * - PEM or DER encoding + * - SHA-1 or SHA-256 hash + * - RSA or EC key + * + * Things to add: + * - multiple EC curve types + */ + +/* This is taken from tests/data_files/server5.crt. */ +/* BEGIN FILE string macro TEST_SRV_CRT_EC_PEM tests/data_files/server5.crt */ +#define TEST_SRV_CRT_EC_PEM \ + "-----BEGIN CERTIFICATE-----\r\n" \ + "MIICHzCCAaWgAwIBAgIBCTAKBggqhkjOPQQDAjA+MQswCQYDVQQGEwJOTDERMA8G\r\n" \ + "A1UEChMIUG9sYXJTU0wxHDAaBgNVBAMTE1BvbGFyc3NsIFRlc3QgRUMgQ0EwHhcN\r\n" \ + "MTMwOTI0MTU1MjA0WhcNMjMwOTIyMTU1MjA0WjA0MQswCQYDVQQGEwJOTDERMA8G\r\n" \ + "A1UEChMIUG9sYXJTU0wxEjAQBgNVBAMTCWxvY2FsaG9zdDBZMBMGByqGSM49AgEG\r\n" \ + "CCqGSM49AwEHA0IABDfMVtl2CR5acj7HWS3/IG7ufPkGkXTQrRS192giWWKSTuUA\r\n" \ + "2CMR/+ov0jRdXRa9iojCa3cNVc2KKg76Aci07f+jgZ0wgZowCQYDVR0TBAIwADAd\r\n" \ + "BgNVHQ4EFgQUUGGlj9QH2deCAQzlZX+MY0anE74wbgYDVR0jBGcwZYAUnW0gJEkB\r\n" \ + "PyvLeLUZvH4kydv7NnyhQqRAMD4xCzAJBgNVBAYTAk5MMREwDwYDVQQKEwhQb2xh\r\n" \ + "clNTTDEcMBoGA1UEAxMTUG9sYXJzc2wgVGVzdCBFQyBDQYIJAMFD4n5iQ8zoMAoG\r\n" \ + "CCqGSM49BAMCA2gAMGUCMQCaLFzXptui5WQN8LlO3ddh1hMxx6tzgLvT03MTVK2S\r\n" \ + "C12r0Lz3ri/moSEpNZWqPjkCMCE2f53GXcYLqyfyJR078c/xNSUU5+Xxl7VZ414V\r\n" \ + "fGa5kHvHARBPc8YAIVIqDvHH1Q==\r\n" \ + "-----END CERTIFICATE-----\r\n" +/* END FILE */ + +/* This is generated from tests/data_files/server5.crt.der using `xxd -i`. */ +/* BEGIN FILE binary macro TEST_SRV_CRT_EC_DER tests/data_files/server5.crt.der */ +#define TEST_SRV_CRT_EC_DER { \ + 0x30, 0x82, 0x02, 0x1f, 0x30, 0x82, 0x01, 0xa5, 0xa0, 0x03, 0x02, 0x01, \ + 0x02, 0x02, 0x01, 0x09, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, \ + 0x3d, 0x04, 0x03, 0x02, 0x30, 0x3e, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, \ + 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, \ + 0x03, 0x55, 0x04, 0x0a, 0x13, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, \ + 0x53, 0x4c, 0x31, 0x1c, 0x30, 0x1a, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, \ + 0x13, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x73, 0x73, 0x6c, 0x20, 0x54, 0x65, \ + 0x73, 0x74, 0x20, 0x45, 0x43, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, \ + 0x31, 0x33, 0x30, 0x39, 0x32, 0x34, 0x31, 0x35, 0x35, 0x32, 0x30, 0x34, \ + 0x5a, 0x17, 0x0d, 0x32, 0x33, 0x30, 0x39, 0x32, 0x32, 0x31, 0x35, 0x35, \ + 0x32, 0x30, 0x34, 0x5a, 0x30, 0x34, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, \ + 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, \ + 0x03, 0x55, 0x04, 0x0a, 0x13, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, \ + 0x53, 0x4c, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, \ + 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x30, 0x59, \ + 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, \ + 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, \ + 0x04, 0x37, 0xcc, 0x56, 0xd9, 0x76, 0x09, 0x1e, 0x5a, 0x72, 0x3e, 0xc7, \ + 0x59, 0x2d, 0xff, 0x20, 0x6e, 0xee, 0x7c, 0xf9, 0x06, 0x91, 0x74, 0xd0, \ + 0xad, 0x14, 0xb5, 0xf7, 0x68, 0x22, 0x59, 0x62, 0x92, 0x4e, 0xe5, 0x00, \ + 0xd8, 0x23, 0x11, 0xff, 0xea, 0x2f, 0xd2, 0x34, 0x5d, 0x5d, 0x16, 0xbd, \ + 0x8a, 0x88, 0xc2, 0x6b, 0x77, 0x0d, 0x55, 0xcd, 0x8a, 0x2a, 0x0e, 0xfa, \ + 0x01, 0xc8, 0xb4, 0xed, 0xff, 0xa3, 0x81, 0x9d, 0x30, 0x81, 0x9a, 0x30, \ + 0x09, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04, 0x02, 0x30, 0x00, 0x30, 0x1d, \ + 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x50, 0x61, 0xa5, \ + 0x8f, 0xd4, 0x07, 0xd9, 0xd7, 0x82, 0x01, 0x0c, 0xe5, 0x65, 0x7f, 0x8c, \ + 0x63, 0x46, 0xa7, 0x13, 0xbe, 0x30, 0x6e, 0x06, 0x03, 0x55, 0x1d, 0x23, \ + 0x04, 0x67, 0x30, 0x65, 0x80, 0x14, 0x9d, 0x6d, 0x20, 0x24, 0x49, 0x01, \ + 0x3f, 0x2b, 0xcb, 0x78, 0xb5, 0x19, 0xbc, 0x7e, 0x24, 0xc9, 0xdb, 0xfb, \ + 0x36, 0x7c, 0xa1, 0x42, 0xa4, 0x40, 0x30, 0x3e, 0x31, 0x0b, 0x30, 0x09, \ + 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, \ + 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x08, 0x50, 0x6f, 0x6c, 0x61, \ + 0x72, 0x53, 0x53, 0x4c, 0x31, 0x1c, 0x30, 0x1a, 0x06, 0x03, 0x55, 0x04, \ + 0x03, 0x13, 0x13, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x73, 0x73, 0x6c, 0x20, \ + 0x54, 0x65, 0x73, 0x74, 0x20, 0x45, 0x43, 0x20, 0x43, 0x41, 0x82, 0x09, \ + 0x00, 0xc1, 0x43, 0xe2, 0x7e, 0x62, 0x43, 0xcc, 0xe8, 0x30, 0x0a, 0x06, \ + 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x68, 0x00, \ + 0x30, 0x65, 0x02, 0x31, 0x00, 0x9a, 0x2c, 0x5c, 0xd7, 0xa6, 0xdb, 0xa2, \ + 0xe5, 0x64, 0x0d, 0xf0, 0xb9, 0x4e, 0xdd, 0xd7, 0x61, 0xd6, 0x13, 0x31, \ + 0xc7, 0xab, 0x73, 0x80, 0xbb, 0xd3, 0xd3, 0x73, 0x13, 0x54, 0xad, 0x92, \ + 0x0b, 0x5d, 0xab, 0xd0, 0xbc, 0xf7, 0xae, 0x2f, 0xe6, 0xa1, 0x21, 0x29, \ + 0x35, 0x95, 0xaa, 0x3e, 0x39, 0x02, 0x30, 0x21, 0x36, 0x7f, 0x9d, 0xc6, \ + 0x5d, 0xc6, 0x0b, 0xab, 0x27, 0xf2, 0x25, 0x1d, 0x3b, 0xf1, 0xcf, 0xf1, \ + 0x35, 0x25, 0x14, 0xe7, 0xe5, 0xf1, 0x97, 0xb5, 0x59, 0xe3, 0x5e, 0x15, \ + 0x7c, 0x66, 0xb9, 0x90, 0x7b, 0xc7, 0x01, 0x10, 0x4f, 0x73, 0xc6, 0x00, \ + 0x21, 0x52, 0x2a, 0x0e, 0xf1, 0xc7, 0xd5 \ +} +/* END FILE */ + +/* This is taken from tests/data_files/server5.key. */ +/* BEGIN FILE string macro TEST_SRV_KEY_EC_PEM tests/data_files/server5.key */ +#define TEST_SRV_KEY_EC_PEM \ + "-----BEGIN EC PRIVATE KEY-----\r\n" \ + "MHcCAQEEIPEqEyB2AnCoPL/9U/YDHvdqXYbIogTywwyp6/UfDw6noAoGCCqGSM49\r\n" \ + "AwEHoUQDQgAEN8xW2XYJHlpyPsdZLf8gbu58+QaRdNCtFLX3aCJZYpJO5QDYIxH/\r\n" \ + "6i/SNF1dFr2KiMJrdw1VzYoqDvoByLTt/w==\r\n" \ + "-----END EC PRIVATE KEY-----\r\n" +/* END FILE */ + +/* This is generated from tests/data_files/server5.key.der using `xxd -i`. */ +/* BEGIN FILE binary macro TEST_SRV_KEY_EC_DER tests/data_files/server5.key.der */ +#define TEST_SRV_KEY_EC_DER { \ + 0x30, 0x77, 0x02, 0x01, 0x01, 0x04, 0x20, 0xf1, 0x2a, 0x13, 0x20, 0x76, \ + 0x02, 0x70, 0xa8, 0x3c, 0xbf, 0xfd, 0x53, 0xf6, 0x03, 0x1e, 0xf7, 0x6a, \ + 0x5d, 0x86, 0xc8, 0xa2, 0x04, 0xf2, 0xc3, 0x0c, 0xa9, 0xeb, 0xf5, 0x1f, \ + 0x0f, 0x0e, 0xa7, 0xa0, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, \ + 0x03, 0x01, 0x07, 0xa1, 0x44, 0x03, 0x42, 0x00, 0x04, 0x37, 0xcc, 0x56, \ + 0xd9, 0x76, 0x09, 0x1e, 0x5a, 0x72, 0x3e, 0xc7, 0x59, 0x2d, 0xff, 0x20, \ + 0x6e, 0xee, 0x7c, 0xf9, 0x06, 0x91, 0x74, 0xd0, 0xad, 0x14, 0xb5, 0xf7, \ + 0x68, 0x22, 0x59, 0x62, 0x92, 0x4e, 0xe5, 0x00, 0xd8, 0x23, 0x11, 0xff, \ + 0xea, 0x2f, 0xd2, 0x34, 0x5d, 0x5d, 0x16, 0xbd, 0x8a, 0x88, 0xc2, 0x6b, \ + 0x77, 0x0d, 0x55, 0xcd, 0x8a, 0x2a, 0x0e, 0xfa, 0x01, 0xc8, 0xb4, 0xed, \ + 0xff \ +} +/* END FILE */ + +/* This is taken from tests/data_files/server2-sha256.crt. */ +/* BEGIN FILE string macro TEST_SRV_CRT_RSA_SHA256_PEM tests/data_files/server2-sha256.crt */ +#define TEST_SRV_CRT_RSA_SHA256_PEM \ + "-----BEGIN CERTIFICATE-----\r\n" \ + "MIIDNzCCAh+gAwIBAgIBAjANBgkqhkiG9w0BAQsFADA7MQswCQYDVQQGEwJOTDER\r\n" \ + "MA8GA1UECgwIUG9sYXJTU0wxGTAXBgNVBAMMEFBvbGFyU1NMIFRlc3QgQ0EwHhcN\r\n" \ + "MTEwMjEyMTQ0NDA2WhcNMjEwMjEyMTQ0NDA2WjA0MQswCQYDVQQGEwJOTDERMA8G\r\n" \ + "A1UECgwIUG9sYXJTU0wxEjAQBgNVBAMMCWxvY2FsaG9zdDCCASIwDQYJKoZIhvcN\r\n" \ + "AQEBBQADggEPADCCAQoCggEBAMFNo93nzR3RBNdJcriZrA545Do8Ss86ExbQWuTN\r\n" \ + "owCIp+4ea5anUrSQ7y1yej4kmvy2NKwk9XfgJmSMnLAofaHa6ozmyRyWvP7BBFKz\r\n" \ + "NtSj+uGxdtiQwWG0ZlI2oiZTqqt0Xgd9GYLbKtgfoNkNHC1JZvdbJXNG6AuKT2kM\r\n" \ + "tQCQ4dqCEGZ9rlQri2V5kaHiYcPNQEkI7mgM8YuG0ka/0LiqEQMef1aoGh5EGA8P\r\n" \ + "hYvai0Re4hjGYi/HZo36Xdh98yeJKQHFkA4/J/EwyEoO79bex8cna8cFPXrEAjya\r\n" \ + "HT4P6DSYW8tzS1KW2BGiLICIaTla0w+w3lkvEcf36hIBMJcCAwEAAaNNMEswCQYD\r\n" \ + "VR0TBAIwADAdBgNVHQ4EFgQUpQXoZLjc32APUBJNYKhkr02LQ5MwHwYDVR0jBBgw\r\n" \ + "FoAUtFrkpbPe0lL2udWmlQ/rPrzH/f8wDQYJKoZIhvcNAQELBQADggEBAGGEshT5\r\n" \ + "kvnRmLVScVeUEdwIrvW7ezbGbUvJ8VxeJ79/HSjlLiGbMc4uUathwtzEdi9R/4C5\r\n" \ + "DXBNeEPTkbB+fhG1W06iHYj/Dp8+aaG7fuDxKVKHVZSqBnmQLn73ymyclZNHii5A\r\n" \ + "3nTS8WUaHAzxN/rajOtoM7aH1P9tULpHrl+7HOeLMpxUnwI12ZqZaLIzxbcdJVcr\r\n" \ + "ra2F00aXCGkYVLvyvbZIq7LC+yVysej5gCeQYD7VFOEks0jhFjrS06gP0/XnWv6v\r\n" \ + "eBoPez9d+CCjkrhseiWzXOiriIMICX48EloO/DrsMRAtvlwq7EDz4QhILz6ffndm\r\n" \ + "e4K1cVANRPN2o9Y=\r\n" \ + "-----END CERTIFICATE-----\r\n" +/* END FILE */ + +/* This is taken from tests/data_files/server2-sha256.crt.der. */ +/* BEGIN FILE binary macro TEST_SRV_CRT_RSA_SHA256_DER tests/data_files/server2-sha256.crt.der */ +#define TEST_SRV_CRT_RSA_SHA256_DER { \ + 0x30, 0x82, 0x03, 0x37, 0x30, 0x82, 0x02, 0x1f, 0xa0, 0x03, 0x02, 0x01, \ + 0x02, 0x02, 0x01, 0x02, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, \ + 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30, 0x3b, 0x31, 0x0b, 0x30, \ + 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, \ + 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, \ + 0x61, 0x72, 0x53, 0x53, 0x4c, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, \ + 0x04, 0x03, 0x0c, 0x10, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, \ + 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, \ + 0x31, 0x31, 0x30, 0x32, 0x31, 0x32, 0x31, 0x34, 0x34, 0x34, 0x30, 0x36, \ + 0x5a, 0x17, 0x0d, 0x32, 0x31, 0x30, 0x32, 0x31, 0x32, 0x31, 0x34, 0x34, \ + 0x34, 0x30, 0x36, 0x5a, 0x30, 0x34, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, \ + 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, \ + 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, \ + 0x53, 0x4c, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, \ + 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x30, 0x82, \ + 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, \ + 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, \ + 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xc1, 0x4d, 0xa3, 0xdd, 0xe7, \ + 0xcd, 0x1d, 0xd1, 0x04, 0xd7, 0x49, 0x72, 0xb8, 0x99, 0xac, 0x0e, 0x78, \ + 0xe4, 0x3a, 0x3c, 0x4a, 0xcf, 0x3a, 0x13, 0x16, 0xd0, 0x5a, 0xe4, 0xcd, \ + 0xa3, 0x00, 0x88, 0xa7, 0xee, 0x1e, 0x6b, 0x96, 0xa7, 0x52, 0xb4, 0x90, \ + 0xef, 0x2d, 0x72, 0x7a, 0x3e, 0x24, 0x9a, 0xfc, 0xb6, 0x34, 0xac, 0x24, \ + 0xf5, 0x77, 0xe0, 0x26, 0x64, 0x8c, 0x9c, 0xb0, 0x28, 0x7d, 0xa1, 0xda, \ + 0xea, 0x8c, 0xe6, 0xc9, 0x1c, 0x96, 0xbc, 0xfe, 0xc1, 0x04, 0x52, 0xb3, \ + 0x36, 0xd4, 0xa3, 0xfa, 0xe1, 0xb1, 0x76, 0xd8, 0x90, 0xc1, 0x61, 0xb4, \ + 0x66, 0x52, 0x36, 0xa2, 0x26, 0x53, 0xaa, 0xab, 0x74, 0x5e, 0x07, 0x7d, \ + 0x19, 0x82, 0xdb, 0x2a, 0xd8, 0x1f, 0xa0, 0xd9, 0x0d, 0x1c, 0x2d, 0x49, \ + 0x66, 0xf7, 0x5b, 0x25, 0x73, 0x46, 0xe8, 0x0b, 0x8a, 0x4f, 0x69, 0x0c, \ + 0xb5, 0x00, 0x90, 0xe1, 0xda, 0x82, 0x10, 0x66, 0x7d, 0xae, 0x54, 0x2b, \ + 0x8b, 0x65, 0x79, 0x91, 0xa1, 0xe2, 0x61, 0xc3, 0xcd, 0x40, 0x49, 0x08, \ + 0xee, 0x68, 0x0c, 0xf1, 0x8b, 0x86, 0xd2, 0x46, 0xbf, 0xd0, 0xb8, 0xaa, \ + 0x11, 0x03, 0x1e, 0x7f, 0x56, 0xa8, 0x1a, 0x1e, 0x44, 0x18, 0x0f, 0x0f, \ + 0x85, 0x8b, 0xda, 0x8b, 0x44, 0x5e, 0xe2, 0x18, 0xc6, 0x62, 0x2f, 0xc7, \ + 0x66, 0x8d, 0xfa, 0x5d, 0xd8, 0x7d, 0xf3, 0x27, 0x89, 0x29, 0x01, 0xc5, \ + 0x90, 0x0e, 0x3f, 0x27, 0xf1, 0x30, 0xc8, 0x4a, 0x0e, 0xef, 0xd6, 0xde, \ + 0xc7, 0xc7, 0x27, 0x6b, 0xc7, 0x05, 0x3d, 0x7a, 0xc4, 0x02, 0x3c, 0x9a, \ + 0x1d, 0x3e, 0x0f, 0xe8, 0x34, 0x98, 0x5b, 0xcb, 0x73, 0x4b, 0x52, 0x96, \ + 0xd8, 0x11, 0xa2, 0x2c, 0x80, 0x88, 0x69, 0x39, 0x5a, 0xd3, 0x0f, 0xb0, \ + 0xde, 0x59, 0x2f, 0x11, 0xc7, 0xf7, 0xea, 0x12, 0x01, 0x30, 0x97, 0x02, \ + 0x03, 0x01, 0x00, 0x01, 0xa3, 0x4d, 0x30, 0x4b, 0x30, 0x09, 0x06, 0x03, \ + 0x55, 0x1d, 0x13, 0x04, 0x02, 0x30, 0x00, 0x30, 0x1d, 0x06, 0x03, 0x55, \ + 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xa5, 0x05, 0xe8, 0x64, 0xb8, 0xdc, \ + 0xdf, 0x60, 0x0f, 0x50, 0x12, 0x4d, 0x60, 0xa8, 0x64, 0xaf, 0x4d, 0x8b, \ + 0x43, 0x93, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, \ + 0x16, 0x80, 0x14, 0xb4, 0x5a, 0xe4, 0xa5, 0xb3, 0xde, 0xd2, 0x52, 0xf6, \ + 0xb9, 0xd5, 0xa6, 0x95, 0x0f, 0xeb, 0x3e, 0xbc, 0xc7, 0xfd, 0xff, 0x30, \ + 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, \ + 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00, 0x61, 0x84, 0xb2, 0x14, 0xf9, \ + 0x92, 0xf9, 0xd1, 0x98, 0xb5, 0x52, 0x71, 0x57, 0x94, 0x11, 0xdc, 0x08, \ + 0xae, 0xf5, 0xbb, 0x7b, 0x36, 0xc6, 0x6d, 0x4b, 0xc9, 0xf1, 0x5c, 0x5e, \ + 0x27, 0xbf, 0x7f, 0x1d, 0x28, 0xe5, 0x2e, 0x21, 0x9b, 0x31, 0xce, 0x2e, \ + 0x51, 0xab, 0x61, 0xc2, 0xdc, 0xc4, 0x76, 0x2f, 0x51, 0xff, 0x80, 0xb9, \ + 0x0d, 0x70, 0x4d, 0x78, 0x43, 0xd3, 0x91, 0xb0, 0x7e, 0x7e, 0x11, 0xb5, \ + 0x5b, 0x4e, 0xa2, 0x1d, 0x88, 0xff, 0x0e, 0x9f, 0x3e, 0x69, 0xa1, 0xbb, \ + 0x7e, 0xe0, 0xf1, 0x29, 0x52, 0x87, 0x55, 0x94, 0xaa, 0x06, 0x79, 0x90, \ + 0x2e, 0x7e, 0xf7, 0xca, 0x6c, 0x9c, 0x95, 0x93, 0x47, 0x8a, 0x2e, 0x40, \ + 0xde, 0x74, 0xd2, 0xf1, 0x65, 0x1a, 0x1c, 0x0c, 0xf1, 0x37, 0xfa, 0xda, \ + 0x8c, 0xeb, 0x68, 0x33, 0xb6, 0x87, 0xd4, 0xff, 0x6d, 0x50, 0xba, 0x47, \ + 0xae, 0x5f, 0xbb, 0x1c, 0xe7, 0x8b, 0x32, 0x9c, 0x54, 0x9f, 0x02, 0x35, \ + 0xd9, 0x9a, 0x99, 0x68, 0xb2, 0x33, 0xc5, 0xb7, 0x1d, 0x25, 0x57, 0x2b, \ + 0xad, 0xad, 0x85, 0xd3, 0x46, 0x97, 0x08, 0x69, 0x18, 0x54, 0xbb, 0xf2, \ + 0xbd, 0xb6, 0x48, 0xab, 0xb2, 0xc2, 0xfb, 0x25, 0x72, 0xb1, 0xe8, 0xf9, \ + 0x80, 0x27, 0x90, 0x60, 0x3e, 0xd5, 0x14, 0xe1, 0x24, 0xb3, 0x48, 0xe1, \ + 0x16, 0x3a, 0xd2, 0xd3, 0xa8, 0x0f, 0xd3, 0xf5, 0xe7, 0x5a, 0xfe, 0xaf, \ + 0x78, 0x1a, 0x0f, 0x7b, 0x3f, 0x5d, 0xf8, 0x20, 0xa3, 0x92, 0xb8, 0x6c, \ + 0x7a, 0x25, 0xb3, 0x5c, 0xe8, 0xab, 0x88, 0x83, 0x08, 0x09, 0x7e, 0x3c, \ + 0x12, 0x5a, 0x0e, 0xfc, 0x3a, 0xec, 0x31, 0x10, 0x2d, 0xbe, 0x5c, 0x2a, \ + 0xec, 0x40, 0xf3, 0xe1, 0x08, 0x48, 0x2f, 0x3e, 0x9f, 0x7e, 0x77, 0x66, \ + 0x7b, 0x82, 0xb5, 0x71, 0x50, 0x0d, 0x44, 0xf3, 0x76, 0xa3, 0xd6 \ +} +/* END FILE */ + +/* This is taken from tests/data_files/server2.crt. */ +/* BEGIN FILE string macro TEST_SRV_CRT_RSA_SHA1_PEM tests/data_files/server2.crt */ +#define TEST_SRV_CRT_RSA_SHA1_PEM \ + "-----BEGIN CERTIFICATE-----\r\n" \ + "MIIDNzCCAh+gAwIBAgIBAjANBgkqhkiG9w0BAQUFADA7MQswCQYDVQQGEwJOTDER\r\n" \ + "MA8GA1UECgwIUG9sYXJTU0wxGTAXBgNVBAMMEFBvbGFyU1NMIFRlc3QgQ0EwHhcN\r\n" \ + "MTEwMjEyMTQ0NDA2WhcNMjEwMjEyMTQ0NDA2WjA0MQswCQYDVQQGEwJOTDERMA8G\r\n" \ + "A1UECgwIUG9sYXJTU0wxEjAQBgNVBAMMCWxvY2FsaG9zdDCCASIwDQYJKoZIhvcN\r\n" \ + "AQEBBQADggEPADCCAQoCggEBAMFNo93nzR3RBNdJcriZrA545Do8Ss86ExbQWuTN\r\n" \ + "owCIp+4ea5anUrSQ7y1yej4kmvy2NKwk9XfgJmSMnLAofaHa6ozmyRyWvP7BBFKz\r\n" \ + "NtSj+uGxdtiQwWG0ZlI2oiZTqqt0Xgd9GYLbKtgfoNkNHC1JZvdbJXNG6AuKT2kM\r\n" \ + "tQCQ4dqCEGZ9rlQri2V5kaHiYcPNQEkI7mgM8YuG0ka/0LiqEQMef1aoGh5EGA8P\r\n" \ + "hYvai0Re4hjGYi/HZo36Xdh98yeJKQHFkA4/J/EwyEoO79bex8cna8cFPXrEAjya\r\n" \ + "HT4P6DSYW8tzS1KW2BGiLICIaTla0w+w3lkvEcf36hIBMJcCAwEAAaNNMEswCQYD\r\n" \ + "VR0TBAIwADAdBgNVHQ4EFgQUpQXoZLjc32APUBJNYKhkr02LQ5MwHwYDVR0jBBgw\r\n" \ + "FoAUtFrkpbPe0lL2udWmlQ/rPrzH/f8wDQYJKoZIhvcNAQEFBQADggEBAAFzC0rF\r\n" \ + "y6De8WMcdgQrEw3AhBHFjzqnxZw1ene4IBSC7lTw8rBSy3jOWQdPUWn+0y/pCeeF\r\n" \ + "kti6sevFdl1hLemGtd4q+T9TKEKGg3ND4ARfB5AUZZ9uEHq8WBkiwus5clGS17Qd\r\n" \ + "dS/TOisB59tQruLx1E1bPLtBKyqk4koC5WAULJwfpswGSyWJTpYwIpxcWE3D2tBu\r\n" \ + "UB6MZfXZFzWmWEOyKbeoXjXe8GBCGgHLywvYDsGQ36HSGtEsAvR2QaTLSxWYcfk1\r\n" \ + "fbDn4jSWkb4yZy1r01UEigFQtONieGwRFaUqEcFJHJvEEGVgh9keaVlOj2vrwf5r\r\n" \ + "4mN4lW7gLdenN6g=\r\n" \ + "-----END CERTIFICATE-----\r\n" +/* END FILE */ + +/* This is taken from tests/data_files/server2.crt.der. */ +/* BEGIN FILE binary macro TEST_SRV_CRT_RSA_SHA1_DER tests/data_files/server2.crt.der */ +#define TEST_SRV_CRT_RSA_SHA1_DER { \ + 0x30, 0x82, 0x03, 0x37, 0x30, 0x82, 0x02, 0x1f, 0xa0, 0x03, 0x02, 0x01, \ + 0x02, 0x02, 0x01, 0x02, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, \ + 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x3b, 0x31, 0x0b, 0x30, \ + 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, \ + 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, \ + 0x61, 0x72, 0x53, 0x53, 0x4c, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, \ + 0x04, 0x03, 0x0c, 0x10, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, \ + 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, \ + 0x31, 0x31, 0x30, 0x32, 0x31, 0x32, 0x31, 0x34, 0x34, 0x34, 0x30, 0x36, \ + 0x5a, 0x17, 0x0d, 0x32, 0x31, 0x30, 0x32, 0x31, 0x32, 0x31, 0x34, 0x34, \ + 0x34, 0x30, 0x36, 0x5a, 0x30, 0x34, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, \ + 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, \ + 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, \ + 0x53, 0x4c, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, \ + 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x30, 0x82, \ + 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, \ + 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, \ + 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xc1, 0x4d, 0xa3, 0xdd, 0xe7, \ + 0xcd, 0x1d, 0xd1, 0x04, 0xd7, 0x49, 0x72, 0xb8, 0x99, 0xac, 0x0e, 0x78, \ + 0xe4, 0x3a, 0x3c, 0x4a, 0xcf, 0x3a, 0x13, 0x16, 0xd0, 0x5a, 0xe4, 0xcd, \ + 0xa3, 0x00, 0x88, 0xa7, 0xee, 0x1e, 0x6b, 0x96, 0xa7, 0x52, 0xb4, 0x90, \ + 0xef, 0x2d, 0x72, 0x7a, 0x3e, 0x24, 0x9a, 0xfc, 0xb6, 0x34, 0xac, 0x24, \ + 0xf5, 0x77, 0xe0, 0x26, 0x64, 0x8c, 0x9c, 0xb0, 0x28, 0x7d, 0xa1, 0xda, \ + 0xea, 0x8c, 0xe6, 0xc9, 0x1c, 0x96, 0xbc, 0xfe, 0xc1, 0x04, 0x52, 0xb3, \ + 0x36, 0xd4, 0xa3, 0xfa, 0xe1, 0xb1, 0x76, 0xd8, 0x90, 0xc1, 0x61, 0xb4, \ + 0x66, 0x52, 0x36, 0xa2, 0x26, 0x53, 0xaa, 0xab, 0x74, 0x5e, 0x07, 0x7d, \ + 0x19, 0x82, 0xdb, 0x2a, 0xd8, 0x1f, 0xa0, 0xd9, 0x0d, 0x1c, 0x2d, 0x49, \ + 0x66, 0xf7, 0x5b, 0x25, 0x73, 0x46, 0xe8, 0x0b, 0x8a, 0x4f, 0x69, 0x0c, \ + 0xb5, 0x00, 0x90, 0xe1, 0xda, 0x82, 0x10, 0x66, 0x7d, 0xae, 0x54, 0x2b, \ + 0x8b, 0x65, 0x79, 0x91, 0xa1, 0xe2, 0x61, 0xc3, 0xcd, 0x40, 0x49, 0x08, \ + 0xee, 0x68, 0x0c, 0xf1, 0x8b, 0x86, 0xd2, 0x46, 0xbf, 0xd0, 0xb8, 0xaa, \ + 0x11, 0x03, 0x1e, 0x7f, 0x56, 0xa8, 0x1a, 0x1e, 0x44, 0x18, 0x0f, 0x0f, \ + 0x85, 0x8b, 0xda, 0x8b, 0x44, 0x5e, 0xe2, 0x18, 0xc6, 0x62, 0x2f, 0xc7, \ + 0x66, 0x8d, 0xfa, 0x5d, 0xd8, 0x7d, 0xf3, 0x27, 0x89, 0x29, 0x01, 0xc5, \ + 0x90, 0x0e, 0x3f, 0x27, 0xf1, 0x30, 0xc8, 0x4a, 0x0e, 0xef, 0xd6, 0xde, \ + 0xc7, 0xc7, 0x27, 0x6b, 0xc7, 0x05, 0x3d, 0x7a, 0xc4, 0x02, 0x3c, 0x9a, \ + 0x1d, 0x3e, 0x0f, 0xe8, 0x34, 0x98, 0x5b, 0xcb, 0x73, 0x4b, 0x52, 0x96, \ + 0xd8, 0x11, 0xa2, 0x2c, 0x80, 0x88, 0x69, 0x39, 0x5a, 0xd3, 0x0f, 0xb0, \ + 0xde, 0x59, 0x2f, 0x11, 0xc7, 0xf7, 0xea, 0x12, 0x01, 0x30, 0x97, 0x02, \ + 0x03, 0x01, 0x00, 0x01, 0xa3, 0x4d, 0x30, 0x4b, 0x30, 0x09, 0x06, 0x03, \ + 0x55, 0x1d, 0x13, 0x04, 0x02, 0x30, 0x00, 0x30, 0x1d, 0x06, 0x03, 0x55, \ + 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xa5, 0x05, 0xe8, 0x64, 0xb8, 0xdc, \ + 0xdf, 0x60, 0x0f, 0x50, 0x12, 0x4d, 0x60, 0xa8, 0x64, 0xaf, 0x4d, 0x8b, \ + 0x43, 0x93, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, \ + 0x16, 0x80, 0x14, 0xb4, 0x5a, 0xe4, 0xa5, 0xb3, 0xde, 0xd2, 0x52, 0xf6, \ + 0xb9, 0xd5, 0xa6, 0x95, 0x0f, 0xeb, 0x3e, 0xbc, 0xc7, 0xfd, 0xff, 0x30, \ + 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, \ + 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00, 0x01, 0x73, 0x0b, 0x4a, 0xc5, \ + 0xcb, 0xa0, 0xde, 0xf1, 0x63, 0x1c, 0x76, 0x04, 0x2b, 0x13, 0x0d, 0xc0, \ + 0x84, 0x11, 0xc5, 0x8f, 0x3a, 0xa7, 0xc5, 0x9c, 0x35, 0x7a, 0x77, 0xb8, \ + 0x20, 0x14, 0x82, 0xee, 0x54, 0xf0, 0xf2, 0xb0, 0x52, 0xcb, 0x78, 0xce, \ + 0x59, 0x07, 0x4f, 0x51, 0x69, 0xfe, 0xd3, 0x2f, 0xe9, 0x09, 0xe7, 0x85, \ + 0x92, 0xd8, 0xba, 0xb1, 0xeb, 0xc5, 0x76, 0x5d, 0x61, 0x2d, 0xe9, 0x86, \ + 0xb5, 0xde, 0x2a, 0xf9, 0x3f, 0x53, 0x28, 0x42, 0x86, 0x83, 0x73, 0x43, \ + 0xe0, 0x04, 0x5f, 0x07, 0x90, 0x14, 0x65, 0x9f, 0x6e, 0x10, 0x7a, 0xbc, \ + 0x58, 0x19, 0x22, 0xc2, 0xeb, 0x39, 0x72, 0x51, 0x92, 0xd7, 0xb4, 0x1d, \ + 0x75, 0x2f, 0xd3, 0x3a, 0x2b, 0x01, 0xe7, 0xdb, 0x50, 0xae, 0xe2, 0xf1, \ + 0xd4, 0x4d, 0x5b, 0x3c, 0xbb, 0x41, 0x2b, 0x2a, 0xa4, 0xe2, 0x4a, 0x02, \ + 0xe5, 0x60, 0x14, 0x2c, 0x9c, 0x1f, 0xa6, 0xcc, 0x06, 0x4b, 0x25, 0x89, \ + 0x4e, 0x96, 0x30, 0x22, 0x9c, 0x5c, 0x58, 0x4d, 0xc3, 0xda, 0xd0, 0x6e, \ + 0x50, 0x1e, 0x8c, 0x65, 0xf5, 0xd9, 0x17, 0x35, 0xa6, 0x58, 0x43, 0xb2, \ + 0x29, 0xb7, 0xa8, 0x5e, 0x35, 0xde, 0xf0, 0x60, 0x42, 0x1a, 0x01, 0xcb, \ + 0xcb, 0x0b, 0xd8, 0x0e, 0xc1, 0x90, 0xdf, 0xa1, 0xd2, 0x1a, 0xd1, 0x2c, \ + 0x02, 0xf4, 0x76, 0x41, 0xa4, 0xcb, 0x4b, 0x15, 0x98, 0x71, 0xf9, 0x35, \ + 0x7d, 0xb0, 0xe7, 0xe2, 0x34, 0x96, 0x91, 0xbe, 0x32, 0x67, 0x2d, 0x6b, \ + 0xd3, 0x55, 0x04, 0x8a, 0x01, 0x50, 0xb4, 0xe3, 0x62, 0x78, 0x6c, 0x11, \ + 0x15, 0xa5, 0x2a, 0x11, 0xc1, 0x49, 0x1c, 0x9b, 0xc4, 0x10, 0x65, 0x60, \ + 0x87, 0xd9, 0x1e, 0x69, 0x59, 0x4e, 0x8f, 0x6b, 0xeb, 0xc1, 0xfe, 0x6b, \ + 0xe2, 0x63, 0x78, 0x95, 0x6e, 0xe0, 0x2d, 0xd7, 0xa7, 0x37, 0xa8 \ +} +/* END FILE */ + +/* This is taken from tests/data_files/server2.key. */ +/* BEGIN FILE string macro TEST_SRV_KEY_RSA_PEM tests/data_files/server2.key */ +#define TEST_SRV_KEY_RSA_PEM \ + "-----BEGIN RSA PRIVATE KEY-----\r\n" \ + "MIIEpAIBAAKCAQEAwU2j3efNHdEE10lyuJmsDnjkOjxKzzoTFtBa5M2jAIin7h5r\r\n" \ + "lqdStJDvLXJ6PiSa/LY0rCT1d+AmZIycsCh9odrqjObJHJa8/sEEUrM21KP64bF2\r\n" \ + "2JDBYbRmUjaiJlOqq3ReB30Zgtsq2B+g2Q0cLUlm91slc0boC4pPaQy1AJDh2oIQ\r\n" \ + "Zn2uVCuLZXmRoeJhw81ASQjuaAzxi4bSRr/QuKoRAx5/VqgaHkQYDw+Fi9qLRF7i\r\n" \ + "GMZiL8dmjfpd2H3zJ4kpAcWQDj8n8TDISg7v1t7HxydrxwU9esQCPJodPg/oNJhb\r\n" \ + "y3NLUpbYEaIsgIhpOVrTD7DeWS8Rx/fqEgEwlwIDAQABAoIBAQCXR0S8EIHFGORZ\r\n" \ + "++AtOg6eENxD+xVs0f1IeGz57Tjo3QnXX7VBZNdj+p1ECvhCE/G7XnkgU5hLZX+G\r\n" \ + "Z0jkz/tqJOI0vRSdLBbipHnWouyBQ4e/A1yIJdlBtqXxJ1KE/ituHRbNc4j4kL8Z\r\n" \ + "/r6pvwnTI0PSx2Eqs048YdS92LT6qAv4flbNDxMn2uY7s4ycS4Q8w1JXnCeaAnYm\r\n" \ + "WYI5wxO+bvRELR2Mcz5DmVnL8jRyml6l6582bSv5oufReFIbyPZbQWlXgYnpu6He\r\n" \ + "GTc7E1zKYQGG/9+DQUl/1vQuCPqQwny0tQoX2w5tdYpdMdVm+zkLtbajzdTviJJa\r\n" \ + "TWzL6lt5AoGBAN86+SVeJDcmQJcv4Eq6UhtRr4QGMiQMz0Sod6ettYxYzMgxtw28\r\n" \ + "CIrgpozCc+UaZJLo7UxvC6an85r1b2nKPCLQFaggJ0H4Q0J/sZOhBIXaoBzWxveK\r\n" \ + "nupceKdVxGsFi8CDy86DBfiyFivfBj+47BbaQzPBj7C4rK7UlLjab2rDAoGBAN2u\r\n" \ + "AM2gchoFiu4v1HFL8D7lweEpi6ZnMJjnEu/dEgGQJFjwdpLnPbsj4c75odQ4Gz8g\r\n" \ + "sw9lao9VVzbusoRE/JGI4aTdO0pATXyG7eG1Qu+5Yc1YGXcCrliA2xM9xx+d7f+s\r\n" \ + "mPzN+WIEg5GJDYZDjAzHG5BNvi/FfM1C9dOtjv2dAoGAF0t5KmwbjWHBhcVqO4Ic\r\n" \ + "BVvN3BIlc1ue2YRXEDlxY5b0r8N4XceMgKmW18OHApZxfl8uPDauWZLXOgl4uepv\r\n" \ + "whZC3EuWrSyyICNhLY21Ah7hbIEBPF3L3ZsOwC+UErL+dXWLdB56Jgy3gZaBeW7b\r\n" \ + "vDrEnocJbqCm7IukhXHOBK8CgYEAwqdHB0hqyNSzIOGY7v9abzB6pUdA3BZiQvEs\r\n" \ + "3LjHVd4HPJ2x0N8CgrBIWOE0q8+0hSMmeE96WW/7jD3fPWwCR5zlXknxBQsfv0gP\r\n" \ + "3BC5PR0Qdypz+d+9zfMf625kyit4T/hzwhDveZUzHnk1Cf+IG7Q+TOEnLnWAWBED\r\n" \ + "ISOWmrUCgYAFEmRxgwAc/u+D6t0syCwAYh6POtscq9Y0i9GyWk89NzgC4NdwwbBH\r\n" \ + "4AgahOxIxXx2gxJnq3yfkJfIjwf0s2DyP0kY2y6Ua1OeomPeY9mrIS4tCuDQ6LrE\r\n" \ + "TB6l9VGoxJL4fyHnZb8L5gGvnB1bbD8cL6YPaDiOhcRseC9vBiEuVg==\r\n" \ + "-----END RSA PRIVATE KEY-----\r\n" +/* END FILE */ + +/* This was generated from tests/data_files/server2.key.der using `xxd -i`. */ +/* BEGIN FILE binary macro TEST_SRV_KEY_RSA_DER tests/data_files/server2.key.der */ +#define TEST_SRV_KEY_RSA_DER { \ + 0x30, 0x82, 0x04, 0xa4, 0x02, 0x01, 0x00, 0x02, 0x82, 0x01, 0x01, 0x00, \ + 0xc1, 0x4d, 0xa3, 0xdd, 0xe7, 0xcd, 0x1d, 0xd1, 0x04, 0xd7, 0x49, 0x72, \ + 0xb8, 0x99, 0xac, 0x0e, 0x78, 0xe4, 0x3a, 0x3c, 0x4a, 0xcf, 0x3a, 0x13, \ + 0x16, 0xd0, 0x5a, 0xe4, 0xcd, 0xa3, 0x00, 0x88, 0xa7, 0xee, 0x1e, 0x6b, \ + 0x96, 0xa7, 0x52, 0xb4, 0x90, 0xef, 0x2d, 0x72, 0x7a, 0x3e, 0x24, 0x9a, \ + 0xfc, 0xb6, 0x34, 0xac, 0x24, 0xf5, 0x77, 0xe0, 0x26, 0x64, 0x8c, 0x9c, \ + 0xb0, 0x28, 0x7d, 0xa1, 0xda, 0xea, 0x8c, 0xe6, 0xc9, 0x1c, 0x96, 0xbc, \ + 0xfe, 0xc1, 0x04, 0x52, 0xb3, 0x36, 0xd4, 0xa3, 0xfa, 0xe1, 0xb1, 0x76, \ + 0xd8, 0x90, 0xc1, 0x61, 0xb4, 0x66, 0x52, 0x36, 0xa2, 0x26, 0x53, 0xaa, \ + 0xab, 0x74, 0x5e, 0x07, 0x7d, 0x19, 0x82, 0xdb, 0x2a, 0xd8, 0x1f, 0xa0, \ + 0xd9, 0x0d, 0x1c, 0x2d, 0x49, 0x66, 0xf7, 0x5b, 0x25, 0x73, 0x46, 0xe8, \ + 0x0b, 0x8a, 0x4f, 0x69, 0x0c, 0xb5, 0x00, 0x90, 0xe1, 0xda, 0x82, 0x10, \ + 0x66, 0x7d, 0xae, 0x54, 0x2b, 0x8b, 0x65, 0x79, 0x91, 0xa1, 0xe2, 0x61, \ + 0xc3, 0xcd, 0x40, 0x49, 0x08, 0xee, 0x68, 0x0c, 0xf1, 0x8b, 0x86, 0xd2, \ + 0x46, 0xbf, 0xd0, 0xb8, 0xaa, 0x11, 0x03, 0x1e, 0x7f, 0x56, 0xa8, 0x1a, \ + 0x1e, 0x44, 0x18, 0x0f, 0x0f, 0x85, 0x8b, 0xda, 0x8b, 0x44, 0x5e, 0xe2, \ + 0x18, 0xc6, 0x62, 0x2f, 0xc7, 0x66, 0x8d, 0xfa, 0x5d, 0xd8, 0x7d, 0xf3, \ + 0x27, 0x89, 0x29, 0x01, 0xc5, 0x90, 0x0e, 0x3f, 0x27, 0xf1, 0x30, 0xc8, \ + 0x4a, 0x0e, 0xef, 0xd6, 0xde, 0xc7, 0xc7, 0x27, 0x6b, 0xc7, 0x05, 0x3d, \ + 0x7a, 0xc4, 0x02, 0x3c, 0x9a, 0x1d, 0x3e, 0x0f, 0xe8, 0x34, 0x98, 0x5b, \ + 0xcb, 0x73, 0x4b, 0x52, 0x96, 0xd8, 0x11, 0xa2, 0x2c, 0x80, 0x88, 0x69, \ + 0x39, 0x5a, 0xd3, 0x0f, 0xb0, 0xde, 0x59, 0x2f, 0x11, 0xc7, 0xf7, 0xea, \ + 0x12, 0x01, 0x30, 0x97, 0x02, 0x03, 0x01, 0x00, 0x01, 0x02, 0x82, 0x01, \ + 0x01, 0x00, 0x97, 0x47, 0x44, 0xbc, 0x10, 0x81, 0xc5, 0x18, 0xe4, 0x59, \ + 0xfb, 0xe0, 0x2d, 0x3a, 0x0e, 0x9e, 0x10, 0xdc, 0x43, 0xfb, 0x15, 0x6c, \ + 0xd1, 0xfd, 0x48, 0x78, 0x6c, 0xf9, 0xed, 0x38, 0xe8, 0xdd, 0x09, 0xd7, \ + 0x5f, 0xb5, 0x41, 0x64, 0xd7, 0x63, 0xfa, 0x9d, 0x44, 0x0a, 0xf8, 0x42, \ + 0x13, 0xf1, 0xbb, 0x5e, 0x79, 0x20, 0x53, 0x98, 0x4b, 0x65, 0x7f, 0x86, \ + 0x67, 0x48, 0xe4, 0xcf, 0xfb, 0x6a, 0x24, 0xe2, 0x34, 0xbd, 0x14, 0x9d, \ + 0x2c, 0x16, 0xe2, 0xa4, 0x79, 0xd6, 0xa2, 0xec, 0x81, 0x43, 0x87, 0xbf, \ + 0x03, 0x5c, 0x88, 0x25, 0xd9, 0x41, 0xb6, 0xa5, 0xf1, 0x27, 0x52, 0x84, \ + 0xfe, 0x2b, 0x6e, 0x1d, 0x16, 0xcd, 0x73, 0x88, 0xf8, 0x90, 0xbf, 0x19, \ + 0xfe, 0xbe, 0xa9, 0xbf, 0x09, 0xd3, 0x23, 0x43, 0xd2, 0xc7, 0x61, 0x2a, \ + 0xb3, 0x4e, 0x3c, 0x61, 0xd4, 0xbd, 0xd8, 0xb4, 0xfa, 0xa8, 0x0b, 0xf8, \ + 0x7e, 0x56, 0xcd, 0x0f, 0x13, 0x27, 0xda, 0xe6, 0x3b, 0xb3, 0x8c, 0x9c, \ + 0x4b, 0x84, 0x3c, 0xc3, 0x52, 0x57, 0x9c, 0x27, 0x9a, 0x02, 0x76, 0x26, \ + 0x59, 0x82, 0x39, 0xc3, 0x13, 0xbe, 0x6e, 0xf4, 0x44, 0x2d, 0x1d, 0x8c, \ + 0x73, 0x3e, 0x43, 0x99, 0x59, 0xcb, 0xf2, 0x34, 0x72, 0x9a, 0x5e, 0xa5, \ + 0xeb, 0x9f, 0x36, 0x6d, 0x2b, 0xf9, 0xa2, 0xe7, 0xd1, 0x78, 0x52, 0x1b, \ + 0xc8, 0xf6, 0x5b, 0x41, 0x69, 0x57, 0x81, 0x89, 0xe9, 0xbb, 0xa1, 0xde, \ + 0x19, 0x37, 0x3b, 0x13, 0x5c, 0xca, 0x61, 0x01, 0x86, 0xff, 0xdf, 0x83, \ + 0x41, 0x49, 0x7f, 0xd6, 0xf4, 0x2e, 0x08, 0xfa, 0x90, 0xc2, 0x7c, 0xb4, \ + 0xb5, 0x0a, 0x17, 0xdb, 0x0e, 0x6d, 0x75, 0x8a, 0x5d, 0x31, 0xd5, 0x66, \ + 0xfb, 0x39, 0x0b, 0xb5, 0xb6, 0xa3, 0xcd, 0xd4, 0xef, 0x88, 0x92, 0x5a, \ + 0x4d, 0x6c, 0xcb, 0xea, 0x5b, 0x79, 0x02, 0x81, 0x81, 0x00, 0xdf, 0x3a, \ + 0xf9, 0x25, 0x5e, 0x24, 0x37, 0x26, 0x40, 0x97, 0x2f, 0xe0, 0x4a, 0xba, \ + 0x52, 0x1b, 0x51, 0xaf, 0x84, 0x06, 0x32, 0x24, 0x0c, 0xcf, 0x44, 0xa8, \ + 0x77, 0xa7, 0xad, 0xb5, 0x8c, 0x58, 0xcc, 0xc8, 0x31, 0xb7, 0x0d, 0xbc, \ + 0x08, 0x8a, 0xe0, 0xa6, 0x8c, 0xc2, 0x73, 0xe5, 0x1a, 0x64, 0x92, 0xe8, \ + 0xed, 0x4c, 0x6f, 0x0b, 0xa6, 0xa7, 0xf3, 0x9a, 0xf5, 0x6f, 0x69, 0xca, \ + 0x3c, 0x22, 0xd0, 0x15, 0xa8, 0x20, 0x27, 0x41, 0xf8, 0x43, 0x42, 0x7f, \ + 0xb1, 0x93, 0xa1, 0x04, 0x85, 0xda, 0xa0, 0x1c, 0xd6, 0xc6, 0xf7, 0x8a, \ + 0x9e, 0xea, 0x5c, 0x78, 0xa7, 0x55, 0xc4, 0x6b, 0x05, 0x8b, 0xc0, 0x83, \ + 0xcb, 0xce, 0x83, 0x05, 0xf8, 0xb2, 0x16, 0x2b, 0xdf, 0x06, 0x3f, 0xb8, \ + 0xec, 0x16, 0xda, 0x43, 0x33, 0xc1, 0x8f, 0xb0, 0xb8, 0xac, 0xae, 0xd4, \ + 0x94, 0xb8, 0xda, 0x6f, 0x6a, 0xc3, 0x02, 0x81, 0x81, 0x00, 0xdd, 0xae, \ + 0x00, 0xcd, 0xa0, 0x72, 0x1a, 0x05, 0x8a, 0xee, 0x2f, 0xd4, 0x71, 0x4b, \ + 0xf0, 0x3e, 0xe5, 0xc1, 0xe1, 0x29, 0x8b, 0xa6, 0x67, 0x30, 0x98, 0xe7, \ + 0x12, 0xef, 0xdd, 0x12, 0x01, 0x90, 0x24, 0x58, 0xf0, 0x76, 0x92, 0xe7, \ + 0x3d, 0xbb, 0x23, 0xe1, 0xce, 0xf9, 0xa1, 0xd4, 0x38, 0x1b, 0x3f, 0x20, \ + 0xb3, 0x0f, 0x65, 0x6a, 0x8f, 0x55, 0x57, 0x36, 0xee, 0xb2, 0x84, 0x44, \ + 0xfc, 0x91, 0x88, 0xe1, 0xa4, 0xdd, 0x3b, 0x4a, 0x40, 0x4d, 0x7c, 0x86, \ + 0xed, 0xe1, 0xb5, 0x42, 0xef, 0xb9, 0x61, 0xcd, 0x58, 0x19, 0x77, 0x02, \ + 0xae, 0x58, 0x80, 0xdb, 0x13, 0x3d, 0xc7, 0x1f, 0x9d, 0xed, 0xff, 0xac, \ + 0x98, 0xfc, 0xcd, 0xf9, 0x62, 0x04, 0x83, 0x91, 0x89, 0x0d, 0x86, 0x43, \ + 0x8c, 0x0c, 0xc7, 0x1b, 0x90, 0x4d, 0xbe, 0x2f, 0xc5, 0x7c, 0xcd, 0x42, \ + 0xf5, 0xd3, 0xad, 0x8e, 0xfd, 0x9d, 0x02, 0x81, 0x80, 0x17, 0x4b, 0x79, \ + 0x2a, 0x6c, 0x1b, 0x8d, 0x61, 0xc1, 0x85, 0xc5, 0x6a, 0x3b, 0x82, 0x1c, \ + 0x05, 0x5b, 0xcd, 0xdc, 0x12, 0x25, 0x73, 0x5b, 0x9e, 0xd9, 0x84, 0x57, \ + 0x10, 0x39, 0x71, 0x63, 0x96, 0xf4, 0xaf, 0xc3, 0x78, 0x5d, 0xc7, 0x8c, \ + 0x80, 0xa9, 0x96, 0xd7, 0xc3, 0x87, 0x02, 0x96, 0x71, 0x7e, 0x5f, 0x2e, \ + 0x3c, 0x36, 0xae, 0x59, 0x92, 0xd7, 0x3a, 0x09, 0x78, 0xb9, 0xea, 0x6f, \ + 0xc2, 0x16, 0x42, 0xdc, 0x4b, 0x96, 0xad, 0x2c, 0xb2, 0x20, 0x23, 0x61, \ + 0x2d, 0x8d, 0xb5, 0x02, 0x1e, 0xe1, 0x6c, 0x81, 0x01, 0x3c, 0x5d, 0xcb, \ + 0xdd, 0x9b, 0x0e, 0xc0, 0x2f, 0x94, 0x12, 0xb2, 0xfe, 0x75, 0x75, 0x8b, \ + 0x74, 0x1e, 0x7a, 0x26, 0x0c, 0xb7, 0x81, 0x96, 0x81, 0x79, 0x6e, 0xdb, \ + 0xbc, 0x3a, 0xc4, 0x9e, 0x87, 0x09, 0x6e, 0xa0, 0xa6, 0xec, 0x8b, 0xa4, \ + 0x85, 0x71, 0xce, 0x04, 0xaf, 0x02, 0x81, 0x81, 0x00, 0xc2, 0xa7, 0x47, \ + 0x07, 0x48, 0x6a, 0xc8, 0xd4, 0xb3, 0x20, 0xe1, 0x98, 0xee, 0xff, 0x5a, \ + 0x6f, 0x30, 0x7a, 0xa5, 0x47, 0x40, 0xdc, 0x16, 0x62, 0x42, 0xf1, 0x2c, \ + 0xdc, 0xb8, 0xc7, 0x55, 0xde, 0x07, 0x3c, 0x9d, 0xb1, 0xd0, 0xdf, 0x02, \ + 0x82, 0xb0, 0x48, 0x58, 0xe1, 0x34, 0xab, 0xcf, 0xb4, 0x85, 0x23, 0x26, \ + 0x78, 0x4f, 0x7a, 0x59, 0x6f, 0xfb, 0x8c, 0x3d, 0xdf, 0x3d, 0x6c, 0x02, \ + 0x47, 0x9c, 0xe5, 0x5e, 0x49, 0xf1, 0x05, 0x0b, 0x1f, 0xbf, 0x48, 0x0f, \ + 0xdc, 0x10, 0xb9, 0x3d, 0x1d, 0x10, 0x77, 0x2a, 0x73, 0xf9, 0xdf, 0xbd, \ + 0xcd, 0xf3, 0x1f, 0xeb, 0x6e, 0x64, 0xca, 0x2b, 0x78, 0x4f, 0xf8, 0x73, \ + 0xc2, 0x10, 0xef, 0x79, 0x95, 0x33, 0x1e, 0x79, 0x35, 0x09, 0xff, 0x88, \ + 0x1b, 0xb4, 0x3e, 0x4c, 0xe1, 0x27, 0x2e, 0x75, 0x80, 0x58, 0x11, 0x03, \ + 0x21, 0x23, 0x96, 0x9a, 0xb5, 0x02, 0x81, 0x80, 0x05, 0x12, 0x64, 0x71, \ + 0x83, 0x00, 0x1c, 0xfe, 0xef, 0x83, 0xea, 0xdd, 0x2c, 0xc8, 0x2c, 0x00, \ + 0x62, 0x1e, 0x8f, 0x3a, 0xdb, 0x1c, 0xab, 0xd6, 0x34, 0x8b, 0xd1, 0xb2, \ + 0x5a, 0x4f, 0x3d, 0x37, 0x38, 0x02, 0xe0, 0xd7, 0x70, 0xc1, 0xb0, 0x47, \ + 0xe0, 0x08, 0x1a, 0x84, 0xec, 0x48, 0xc5, 0x7c, 0x76, 0x83, 0x12, 0x67, \ + 0xab, 0x7c, 0x9f, 0x90, 0x97, 0xc8, 0x8f, 0x07, 0xf4, 0xb3, 0x60, 0xf2, \ + 0x3f, 0x49, 0x18, 0xdb, 0x2e, 0x94, 0x6b, 0x53, 0x9e, 0xa2, 0x63, 0xde, \ + 0x63, 0xd9, 0xab, 0x21, 0x2e, 0x2d, 0x0a, 0xe0, 0xd0, 0xe8, 0xba, 0xc4, \ + 0x4c, 0x1e, 0xa5, 0xf5, 0x51, 0xa8, 0xc4, 0x92, 0xf8, 0x7f, 0x21, 0xe7, \ + 0x65, 0xbf, 0x0b, 0xe6, 0x01, 0xaf, 0x9c, 0x1d, 0x5b, 0x6c, 0x3f, 0x1c, \ + 0x2f, 0xa6, 0x0f, 0x68, 0x38, 0x8e, 0x85, 0xc4, 0x6c, 0x78, 0x2f, 0x6f, \ + 0x06, 0x21, 0x2e, 0x56 \ +} +/* END FILE */ + +/* + * Test client Certificates + * + * Test client certificates are defined for each choice + * of the following parameters: + * - PEM or DER encoding + * - RSA or EC key + * + * Things to add: + * - hash type + * - multiple EC curve types + */ + +/* This is taken from tests/data_files/cli2.crt. */ +/* BEGIN FILE string macro TEST_CLI_CRT_EC_PEM tests/data_files/cli2.crt */ +#define TEST_CLI_CRT_EC_PEM \ + "-----BEGIN CERTIFICATE-----\r\n" \ + "MIICLDCCAbKgAwIBAgIBDTAKBggqhkjOPQQDAjA+MQswCQYDVQQGEwJOTDERMA8G\r\n" \ + "A1UEChMIUG9sYXJTU0wxHDAaBgNVBAMTE1BvbGFyc3NsIFRlc3QgRUMgQ0EwHhcN\r\n" \ + "MTMwOTI0MTU1MjA0WhcNMjMwOTIyMTU1MjA0WjBBMQswCQYDVQQGEwJOTDERMA8G\r\n" \ + "A1UEChMIUG9sYXJTU0wxHzAdBgNVBAMTFlBvbGFyU1NMIFRlc3QgQ2xpZW50IDIw\r\n" \ + "WTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAARX5a6xc9/TrLuTuIH/Eq7u5lOszlVT\r\n" \ + "9jQOzC7jYyUL35ji81xgNpbA1RgUcOV/n9VLRRjlsGzVXPiWj4dwo+THo4GdMIGa\r\n" \ + "MAkGA1UdEwQCMAAwHQYDVR0OBBYEFHoAX4Zk/OBd5REQO7LmO8QmP8/iMG4GA1Ud\r\n" \ + "IwRnMGWAFJ1tICRJAT8ry3i1Gbx+JMnb+zZ8oUKkQDA+MQswCQYDVQQGEwJOTDER\r\n" \ + "MA8GA1UEChMIUG9sYXJTU0wxHDAaBgNVBAMTE1BvbGFyc3NsIFRlc3QgRUMgQ0GC\r\n" \ + "CQDBQ+J+YkPM6DAKBggqhkjOPQQDAgNoADBlAjBKZQ17IIOimbmoD/yN7o89u3BM\r\n" \ + "lgOsjnhw3fIOoLIWy2WOGsk/LGF++DzvrRzuNiACMQCd8iem1XS4JK7haj8xocpU\r\n" \ + "LwjQje5PDGHfd3h9tP38Qknu5bJqws0md2KOKHyeV0U=\r\n" \ + "-----END CERTIFICATE-----\r\n" +/* END FILE */ + +/* This is generated from tests/data_files/cli2.crt.der using `xxd -i`. */ +/* BEGIN FILE binary macro TEST_CLI_CRT_EC_DER tests/data_files/cli2.crt.der */ +#define TEST_CLI_CRT_EC_DER { \ + 0x30, 0x82, 0x02, 0x2c, 0x30, 0x82, 0x01, 0xb2, 0xa0, 0x03, 0x02, 0x01, \ + 0x02, 0x02, 0x01, 0x0d, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, \ + 0x3d, 0x04, 0x03, 0x02, 0x30, 0x3e, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, \ + 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, \ + 0x03, 0x55, 0x04, 0x0a, 0x13, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, \ + 0x53, 0x4c, 0x31, 0x1c, 0x30, 0x1a, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, \ + 0x13, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x73, 0x73, 0x6c, 0x20, 0x54, 0x65, \ + 0x73, 0x74, 0x20, 0x45, 0x43, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, \ + 0x31, 0x33, 0x30, 0x39, 0x32, 0x34, 0x31, 0x35, 0x35, 0x32, 0x30, 0x34, \ + 0x5a, 0x17, 0x0d, 0x32, 0x33, 0x30, 0x39, 0x32, 0x32, 0x31, 0x35, 0x35, \ + 0x32, 0x30, 0x34, 0x5a, 0x30, 0x41, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, \ + 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, \ + 0x03, 0x55, 0x04, 0x0a, 0x13, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, \ + 0x53, 0x4c, 0x31, 0x1f, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, \ + 0x16, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, 0x20, 0x54, 0x65, \ + 0x73, 0x74, 0x20, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x20, 0x32, 0x30, \ + 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, \ + 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, \ + 0x00, 0x04, 0x57, 0xe5, 0xae, 0xb1, 0x73, 0xdf, 0xd3, 0xac, 0xbb, 0x93, \ + 0xb8, 0x81, 0xff, 0x12, 0xae, 0xee, 0xe6, 0x53, 0xac, 0xce, 0x55, 0x53, \ + 0xf6, 0x34, 0x0e, 0xcc, 0x2e, 0xe3, 0x63, 0x25, 0x0b, 0xdf, 0x98, 0xe2, \ + 0xf3, 0x5c, 0x60, 0x36, 0x96, 0xc0, 0xd5, 0x18, 0x14, 0x70, 0xe5, 0x7f, \ + 0x9f, 0xd5, 0x4b, 0x45, 0x18, 0xe5, 0xb0, 0x6c, 0xd5, 0x5c, 0xf8, 0x96, \ + 0x8f, 0x87, 0x70, 0xa3, 0xe4, 0xc7, 0xa3, 0x81, 0x9d, 0x30, 0x81, 0x9a, \ + 0x30, 0x09, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04, 0x02, 0x30, 0x00, 0x30, \ + 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x7a, 0x00, \ + 0x5f, 0x86, 0x64, 0xfc, 0xe0, 0x5d, 0xe5, 0x11, 0x10, 0x3b, 0xb2, 0xe6, \ + 0x3b, 0xc4, 0x26, 0x3f, 0xcf, 0xe2, 0x30, 0x6e, 0x06, 0x03, 0x55, 0x1d, \ + 0x23, 0x04, 0x67, 0x30, 0x65, 0x80, 0x14, 0x9d, 0x6d, 0x20, 0x24, 0x49, \ + 0x01, 0x3f, 0x2b, 0xcb, 0x78, 0xb5, 0x19, 0xbc, 0x7e, 0x24, 0xc9, 0xdb, \ + 0xfb, 0x36, 0x7c, 0xa1, 0x42, 0xa4, 0x40, 0x30, 0x3e, 0x31, 0x0b, 0x30, \ + 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, \ + 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x08, 0x50, 0x6f, 0x6c, \ + 0x61, 0x72, 0x53, 0x53, 0x4c, 0x31, 0x1c, 0x30, 0x1a, 0x06, 0x03, 0x55, \ + 0x04, 0x03, 0x13, 0x13, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x73, 0x73, 0x6c, \ + 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x45, 0x43, 0x20, 0x43, 0x41, 0x82, \ + 0x09, 0x00, 0xc1, 0x43, 0xe2, 0x7e, 0x62, 0x43, 0xcc, 0xe8, 0x30, 0x0a, \ + 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x68, \ + 0x00, 0x30, 0x65, 0x02, 0x30, 0x4a, 0x65, 0x0d, 0x7b, 0x20, 0x83, 0xa2, \ + 0x99, 0xb9, 0xa8, 0x0f, 0xfc, 0x8d, 0xee, 0x8f, 0x3d, 0xbb, 0x70, 0x4c, \ + 0x96, 0x03, 0xac, 0x8e, 0x78, 0x70, 0xdd, 0xf2, 0x0e, 0xa0, 0xb2, 0x16, \ + 0xcb, 0x65, 0x8e, 0x1a, 0xc9, 0x3f, 0x2c, 0x61, 0x7e, 0xf8, 0x3c, 0xef, \ + 0xad, 0x1c, 0xee, 0x36, 0x20, 0x02, 0x31, 0x00, 0x9d, 0xf2, 0x27, 0xa6, \ + 0xd5, 0x74, 0xb8, 0x24, 0xae, 0xe1, 0x6a, 0x3f, 0x31, 0xa1, 0xca, 0x54, \ + 0x2f, 0x08, 0xd0, 0x8d, 0xee, 0x4f, 0x0c, 0x61, 0xdf, 0x77, 0x78, 0x7d, \ + 0xb4, 0xfd, 0xfc, 0x42, 0x49, 0xee, 0xe5, 0xb2, 0x6a, 0xc2, 0xcd, 0x26, \ + 0x77, 0x62, 0x8e, 0x28, 0x7c, 0x9e, 0x57, 0x45 \ +} +/* END FILE */ + +/* This is taken from tests/data_files/cli2.key. */ +/* BEGIN FILE string macro TEST_CLI_KEY_EC_PEM tests/data_files/cli2.key */ +#define TEST_CLI_KEY_EC_PEM \ + "-----BEGIN EC PRIVATE KEY-----\r\n" \ + "MHcCAQEEIPb3hmTxZ3/mZI3vyk7p3U3wBf+WIop6hDhkFzJhmLcqoAoGCCqGSM49\r\n" \ + "AwEHoUQDQgAEV+WusXPf06y7k7iB/xKu7uZTrM5VU/Y0Dswu42MlC9+Y4vNcYDaW\r\n" \ + "wNUYFHDlf5/VS0UY5bBs1Vz4lo+HcKPkxw==\r\n" \ + "-----END EC PRIVATE KEY-----\r\n" +/* END FILE */ + +/* This is generated from tests/data_files/cli2.key.der using `xxd -i`. */ +/* BEGIN FILE binary macro TEST_CLI_KEY_EC_DER tests/data_files/cli2.key.der */ +#define TEST_CLI_KEY_EC_DER { \ + 0x30, 0x77, 0x02, 0x01, 0x01, 0x04, 0x20, 0xf6, 0xf7, 0x86, 0x64, 0xf1, \ + 0x67, 0x7f, 0xe6, 0x64, 0x8d, 0xef, 0xca, 0x4e, 0xe9, 0xdd, 0x4d, 0xf0, \ + 0x05, 0xff, 0x96, 0x22, 0x8a, 0x7a, 0x84, 0x38, 0x64, 0x17, 0x32, 0x61, \ + 0x98, 0xb7, 0x2a, 0xa0, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, \ + 0x03, 0x01, 0x07, 0xa1, 0x44, 0x03, 0x42, 0x00, 0x04, 0x57, 0xe5, 0xae, \ + 0xb1, 0x73, 0xdf, 0xd3, 0xac, 0xbb, 0x93, 0xb8, 0x81, 0xff, 0x12, 0xae, \ + 0xee, 0xe6, 0x53, 0xac, 0xce, 0x55, 0x53, 0xf6, 0x34, 0x0e, 0xcc, 0x2e, \ + 0xe3, 0x63, 0x25, 0x0b, 0xdf, 0x98, 0xe2, 0xf3, 0x5c, 0x60, 0x36, 0x96, \ + 0xc0, 0xd5, 0x18, 0x14, 0x70, 0xe5, 0x7f, 0x9f, 0xd5, 0x4b, 0x45, 0x18, \ + 0xe5, 0xb0, 0x6c, 0xd5, 0x5c, 0xf8, 0x96, 0x8f, 0x87, 0x70, 0xa3, 0xe4, \ + 0xc7 \ +} +/* END FILE */ + +/* This is taken from tests/data_files/cli-rsa-sha256.crt. */ +/* BEGIN FILE string macro TEST_CLI_CRT_RSA_PEM tests/data_files/cli-rsa-sha256.crt */ +#define TEST_CLI_CRT_RSA_PEM \ + "-----BEGIN CERTIFICATE-----\r\n" \ + "MIIDPzCCAiegAwIBAgIBBDANBgkqhkiG9w0BAQsFADA7MQswCQYDVQQGEwJOTDER\r\n" \ + "MA8GA1UECgwIUG9sYXJTU0wxGTAXBgNVBAMMEFBvbGFyU1NMIFRlc3QgQ0EwHhcN\r\n" \ + "MTEwMjEyMTQ0NDA2WhcNMjEwMjEyMTQ0NDA2WjA8MQswCQYDVQQGEwJOTDERMA8G\r\n" \ + "A1UECgwIUG9sYXJTU0wxGjAYBgNVBAMMEVBvbGFyU1NMIENsaWVudCAyMIIBIjAN\r\n" \ + "BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyHTEzLn5tXnpRdkUYLB9u5Pyax6f\r\n" \ + "M60Nj4o8VmXl3ETZzGaFB9X4J7BKNdBjngpuG7fa8H6r7gwQk4ZJGDTzqCrSV/Uu\r\n" \ + "1C93KYRhTYJQj6eVSHD1bk2y1RPD0hrt5kPqQhTrdOrA7R/UV06p86jt0uDBMHEw\r\n" \ + "MjDV0/YI0FZPRo7yX/k9Z5GIMC5Cst99++UMd//sMcB4j7/Cf8qtbCHWjdmLao5v\r\n" \ + "4Jv4EFbMs44TFeY0BGbH7vk2DmqV9gmaBmf0ZXH4yqSxJeD+PIs1BGe64E92hfx/\r\n" \ + "/DZrtenNLQNiTrM9AM+vdqBpVoNq0qjU51Bx5rU2BXcFbXvI5MT9TNUhXwIDAQAB\r\n" \ + "o00wSzAJBgNVHRMEAjAAMB0GA1UdDgQWBBRxoQBzckAvVHZeM/xSj7zx3WtGITAf\r\n" \ + "BgNVHSMEGDAWgBS0WuSls97SUva51aaVD+s+vMf9/zANBgkqhkiG9w0BAQsFAAOC\r\n" \ + "AQEAlHabem2Tu69VUN7EipwnQn1dIHdgvT5i+iQHpSxY1crPnBbAeSdAXwsVEqLQ\r\n" \ + "gOOIAQD5VIITNuoGgo4i+4OpNh9u7ZkpRHla+/swsfrFWRRbBNP5Bcu74AGLstwU\r\n" \ + "zM8gIkBiyfM1Q1qDQISV9trlCG6O8vh8dp/rbI3rfzo99BOHXgFCrzXjCuW4vDsF\r\n" \ + "r+Dao26bX3sJ6UnEWg1H3o2x6PpUcvQ36h71/bz4TEbbUUEpe02V4QWuL+wrhHJL\r\n" \ + "U7o3SVE3Og7jPF8sat0a50YUWhwEFI256m02KAXLg89ueUyYKEr6rNwhcvXJpvU9\r\n" \ + "giIVvd0Sbjjnn7NC4VDbcXV8vw==\r\n" \ + "-----END CERTIFICATE-----\r\n" +/* END FILE */ + +/* This was generated from tests/data_files/cli-rsa-sha256.crt.der + using `xxd -i.` */ +/* BEGIN FILE binary macro TEST_CLI_CRT_RSA_DER tests/data_files/cli-rsa-sha256.crt.der */ +#define TEST_CLI_CRT_RSA_DER { \ + 0x30, 0x82, 0x03, 0x3f, 0x30, 0x82, 0x02, 0x27, 0xa0, 0x03, 0x02, 0x01, \ + 0x02, 0x02, 0x01, 0x04, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, \ + 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30, 0x3b, 0x31, 0x0b, 0x30, \ + 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, \ + 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, \ + 0x61, 0x72, 0x53, 0x53, 0x4c, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, \ + 0x04, 0x03, 0x0c, 0x10, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, \ + 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, \ + 0x31, 0x31, 0x30, 0x32, 0x31, 0x32, 0x31, 0x34, 0x34, 0x34, 0x30, 0x36, \ + 0x5a, 0x17, 0x0d, 0x32, 0x31, 0x30, 0x32, 0x31, 0x32, 0x31, 0x34, 0x34, \ + 0x34, 0x30, 0x36, 0x5a, 0x30, 0x3c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, \ + 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, \ + 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, \ + 0x53, 0x4c, 0x31, 0x1a, 0x30, 0x18, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, \ + 0x11, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, 0x20, 0x43, 0x6c, \ + 0x69, 0x65, 0x6e, 0x74, 0x20, 0x32, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, \ + 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, \ + 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, \ + 0x01, 0x01, 0x00, 0xc8, 0x74, 0xc4, 0xcc, 0xb9, 0xf9, 0xb5, 0x79, 0xe9, \ + 0x45, 0xd9, 0x14, 0x60, 0xb0, 0x7d, 0xbb, 0x93, 0xf2, 0x6b, 0x1e, 0x9f, \ + 0x33, 0xad, 0x0d, 0x8f, 0x8a, 0x3c, 0x56, 0x65, 0xe5, 0xdc, 0x44, 0xd9, \ + 0xcc, 0x66, 0x85, 0x07, 0xd5, 0xf8, 0x27, 0xb0, 0x4a, 0x35, 0xd0, 0x63, \ + 0x9e, 0x0a, 0x6e, 0x1b, 0xb7, 0xda, 0xf0, 0x7e, 0xab, 0xee, 0x0c, 0x10, \ + 0x93, 0x86, 0x49, 0x18, 0x34, 0xf3, 0xa8, 0x2a, 0xd2, 0x57, 0xf5, 0x2e, \ + 0xd4, 0x2f, 0x77, 0x29, 0x84, 0x61, 0x4d, 0x82, 0x50, 0x8f, 0xa7, 0x95, \ + 0x48, 0x70, 0xf5, 0x6e, 0x4d, 0xb2, 0xd5, 0x13, 0xc3, 0xd2, 0x1a, 0xed, \ + 0xe6, 0x43, 0xea, 0x42, 0x14, 0xeb, 0x74, 0xea, 0xc0, 0xed, 0x1f, 0xd4, \ + 0x57, 0x4e, 0xa9, 0xf3, 0xa8, 0xed, 0xd2, 0xe0, 0xc1, 0x30, 0x71, 0x30, \ + 0x32, 0x30, 0xd5, 0xd3, 0xf6, 0x08, 0xd0, 0x56, 0x4f, 0x46, 0x8e, 0xf2, \ + 0x5f, 0xf9, 0x3d, 0x67, 0x91, 0x88, 0x30, 0x2e, 0x42, 0xb2, 0xdf, 0x7d, \ + 0xfb, 0xe5, 0x0c, 0x77, 0xff, 0xec, 0x31, 0xc0, 0x78, 0x8f, 0xbf, 0xc2, \ + 0x7f, 0xca, 0xad, 0x6c, 0x21, 0xd6, 0x8d, 0xd9, 0x8b, 0x6a, 0x8e, 0x6f, \ + 0xe0, 0x9b, 0xf8, 0x10, 0x56, 0xcc, 0xb3, 0x8e, 0x13, 0x15, 0xe6, 0x34, \ + 0x04, 0x66, 0xc7, 0xee, 0xf9, 0x36, 0x0e, 0x6a, 0x95, 0xf6, 0x09, 0x9a, \ + 0x06, 0x67, 0xf4, 0x65, 0x71, 0xf8, 0xca, 0xa4, 0xb1, 0x25, 0xe0, 0xfe, \ + 0x3c, 0x8b, 0x35, 0x04, 0x67, 0xba, 0xe0, 0x4f, 0x76, 0x85, 0xfc, 0x7f, \ + 0xfc, 0x36, 0x6b, 0xb5, 0xe9, 0xcd, 0x2d, 0x03, 0x62, 0x4e, 0xb3, 0x3d, \ + 0x00, 0xcf, 0xaf, 0x76, 0xa0, 0x69, 0x56, 0x83, 0x6a, 0xd2, 0xa8, 0xd4, \ + 0xe7, 0x50, 0x71, 0xe6, 0xb5, 0x36, 0x05, 0x77, 0x05, 0x6d, 0x7b, 0xc8, \ + 0xe4, 0xc4, 0xfd, 0x4c, 0xd5, 0x21, 0x5f, 0x02, 0x03, 0x01, 0x00, 0x01, \ + 0xa3, 0x4d, 0x30, 0x4b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04, \ + 0x02, 0x30, 0x00, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, \ + 0x04, 0x14, 0x71, 0xa1, 0x00, 0x73, 0x72, 0x40, 0x2f, 0x54, 0x76, 0x5e, \ + 0x33, 0xfc, 0x52, 0x8f, 0xbc, 0xf1, 0xdd, 0x6b, 0x46, 0x21, 0x30, 0x1f, \ + 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0xb4, \ + 0x5a, 0xe4, 0xa5, 0xb3, 0xde, 0xd2, 0x52, 0xf6, 0xb9, 0xd5, 0xa6, 0x95, \ + 0x0f, 0xeb, 0x3e, 0xbc, 0xc7, 0xfd, 0xff, 0x30, 0x0d, 0x06, 0x09, 0x2a, \ + 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x03, 0x82, \ + 0x01, 0x01, 0x00, 0x94, 0x76, 0x9b, 0x7a, 0x6d, 0x93, 0xbb, 0xaf, 0x55, \ + 0x50, 0xde, 0xc4, 0x8a, 0x9c, 0x27, 0x42, 0x7d, 0x5d, 0x20, 0x77, 0x60, \ + 0xbd, 0x3e, 0x62, 0xfa, 0x24, 0x07, 0xa5, 0x2c, 0x58, 0xd5, 0xca, 0xcf, \ + 0x9c, 0x16, 0xc0, 0x79, 0x27, 0x40, 0x5f, 0x0b, 0x15, 0x12, 0xa2, 0xd0, \ + 0x80, 0xe3, 0x88, 0x01, 0x00, 0xf9, 0x54, 0x82, 0x13, 0x36, 0xea, 0x06, \ + 0x82, 0x8e, 0x22, 0xfb, 0x83, 0xa9, 0x36, 0x1f, 0x6e, 0xed, 0x99, 0x29, \ + 0x44, 0x79, 0x5a, 0xfb, 0xfb, 0x30, 0xb1, 0xfa, 0xc5, 0x59, 0x14, 0x5b, \ + 0x04, 0xd3, 0xf9, 0x05, 0xcb, 0xbb, 0xe0, 0x01, 0x8b, 0xb2, 0xdc, 0x14, \ + 0xcc, 0xcf, 0x20, 0x22, 0x40, 0x62, 0xc9, 0xf3, 0x35, 0x43, 0x5a, 0x83, \ + 0x40, 0x84, 0x95, 0xf6, 0xda, 0xe5, 0x08, 0x6e, 0x8e, 0xf2, 0xf8, 0x7c, \ + 0x76, 0x9f, 0xeb, 0x6c, 0x8d, 0xeb, 0x7f, 0x3a, 0x3d, 0xf4, 0x13, 0x87, \ + 0x5e, 0x01, 0x42, 0xaf, 0x35, 0xe3, 0x0a, 0xe5, 0xb8, 0xbc, 0x3b, 0x05, \ + 0xaf, 0xe0, 0xda, 0xa3, 0x6e, 0x9b, 0x5f, 0x7b, 0x09, 0xe9, 0x49, 0xc4, \ + 0x5a, 0x0d, 0x47, 0xde, 0x8d, 0xb1, 0xe8, 0xfa, 0x54, 0x72, 0xf4, 0x37, \ + 0xea, 0x1e, 0xf5, 0xfd, 0xbc, 0xf8, 0x4c, 0x46, 0xdb, 0x51, 0x41, 0x29, \ + 0x7b, 0x4d, 0x95, 0xe1, 0x05, 0xae, 0x2f, 0xec, 0x2b, 0x84, 0x72, 0x4b, \ + 0x53, 0xba, 0x37, 0x49, 0x51, 0x37, 0x3a, 0x0e, 0xe3, 0x3c, 0x5f, 0x2c, \ + 0x6a, 0xdd, 0x1a, 0xe7, 0x46, 0x14, 0x5a, 0x1c, 0x04, 0x14, 0x8d, 0xb9, \ + 0xea, 0x6d, 0x36, 0x28, 0x05, 0xcb, 0x83, 0xcf, 0x6e, 0x79, 0x4c, 0x98, \ + 0x28, 0x4a, 0xfa, 0xac, 0xdc, 0x21, 0x72, 0xf5, 0xc9, 0xa6, 0xf5, 0x3d, \ + 0x82, 0x22, 0x15, 0xbd, 0xdd, 0x12, 0x6e, 0x38, 0xe7, 0x9f, 0xb3, 0x42, \ + 0xe1, 0x50, 0xdb, 0x71, 0x75, 0x7c, 0xbf \ +} +/* END FILE */ + +/* This is taken from tests/data_files/cli-rsa.key. */ +/* BEGIN FILE string macro TEST_CLI_KEY_RSA_PEM tests/data_files/cli-rsa.key */ +#define TEST_CLI_KEY_RSA_PEM \ + "-----BEGIN RSA PRIVATE KEY-----\r\n" \ + "MIIEpAIBAAKCAQEAyHTEzLn5tXnpRdkUYLB9u5Pyax6fM60Nj4o8VmXl3ETZzGaF\r\n" \ + "B9X4J7BKNdBjngpuG7fa8H6r7gwQk4ZJGDTzqCrSV/Uu1C93KYRhTYJQj6eVSHD1\r\n" \ + "bk2y1RPD0hrt5kPqQhTrdOrA7R/UV06p86jt0uDBMHEwMjDV0/YI0FZPRo7yX/k9\r\n" \ + "Z5GIMC5Cst99++UMd//sMcB4j7/Cf8qtbCHWjdmLao5v4Jv4EFbMs44TFeY0BGbH\r\n" \ + "7vk2DmqV9gmaBmf0ZXH4yqSxJeD+PIs1BGe64E92hfx//DZrtenNLQNiTrM9AM+v\r\n" \ + "dqBpVoNq0qjU51Bx5rU2BXcFbXvI5MT9TNUhXwIDAQABAoIBAGdNtfYDiap6bzst\r\n" \ + "yhCiI8m9TtrhZw4MisaEaN/ll3XSjaOG2dvV6xMZCMV+5TeXDHOAZnY18Yi18vzz\r\n" \ + "4Ut2TnNFzizCECYNaA2fST3WgInnxUkV3YXAyP6CNxJaCmv2aA0yFr2kFVSeaKGt\r\n" \ + "ymvljNp2NVkvm7Th8fBQBO7I7AXhz43k0mR7XmPgewe8ApZOG3hstkOaMvbWAvWA\r\n" \ + "zCZupdDjZYjOJqlA4eEA4H8/w7F83r5CugeBE8LgEREjLPiyejrU5H1fubEY+h0d\r\n" \ + "l5HZBJ68ybTXfQ5U9o/QKA3dd0toBEhhdRUDGzWtjvwkEQfqF1reGWj/tod/gCpf\r\n" \ + "DFi6X0ECgYEA4wOv/pjSC3ty6TuOvKX2rOUiBrLXXv2JSxZnMoMiWI5ipLQt+RYT\r\n" \ + "VPafL/m7Dn6MbwjayOkcZhBwk5CNz5A6Q4lJ64Mq/lqHznRCQQ2Mc1G8eyDF/fYL\r\n" \ + "Ze2pLvwP9VD5jTc2miDfw+MnvJhywRRLcemDFP8k4hQVtm8PMp3ZmNECgYEA4gz7\r\n" \ + "wzObR4gn8ibe617uQPZjWzUj9dUHYd+in1gwBCIrtNnaRn9I9U/Q6tegRYpii4ys\r\n" \ + "c176NmU+umy6XmuSKV5qD9bSpZWG2nLFnslrN15Lm3fhZxoeMNhBaEDTnLT26yoi\r\n" \ + "33gp0mSSWy94ZEqipms+ULF6sY1ZtFW6tpGFoy8CgYAQHhnnvJflIs2ky4q10B60\r\n" \ + "ZcxFp3rtDpkp0JxhFLhiizFrujMtZSjYNm5U7KkgPVHhLELEUvCmOnKTt4ap/vZ0\r\n" \ + "BxJNe1GZH3pW6SAvGDQpl9sG7uu/vTFP+lCxukmzxB0DrrDcvorEkKMom7ZCCRvW\r\n" \ + "KZsZ6YeH2Z81BauRj218kQKBgQCUV/DgKP2985xDTT79N08jUo3hTP5MVYCCuj/+\r\n" \ + "UeEw1TvZcx3LJby7P6Xad6a1/BqveaGyFKIfEFIaBUBItk801sDDpDaYc4gL00Xc\r\n" \ + "7lFuBHOZkxJYlss5QrGpuOEl9ZwUt5IrFLBdYaKqNHzNVC1pCPfb/JyH6Dr2HUxq\r\n" \ + "gxUwAQKBgQCcU6G2L8AG9d9c0UpOyL1tMvFe5Ttw0KjlQVdsh1MP6yigYo9DYuwu\r\n" \ + "bHFVW2r0dBTqegP2/KTOxKzaHfC1qf0RGDsUoJCNJrd1cwoCLG8P2EF4w3OBrKqv\r\n" \ + "8u4ytY0F+Vlanj5lm3TaoHSVF1+NWPyOTiwevIECGKwSxvlki4fDAA==\r\n" \ + "-----END RSA PRIVATE KEY-----\r\n"/* END FILE */ + +/* This was generated from tests/data_files/cli-rsa.key.der using `xxd -i`. */ +/* BEGIN FILE binary macro TEST_CLI_KEY_RSA_DER tests/data_files/cli-rsa.key.der */ +#define TEST_CLI_KEY_RSA_DER { \ + 0x30, 0x82, 0x04, 0xa4, 0x02, 0x01, 0x00, 0x02, 0x82, 0x01, 0x01, 0x00, \ + 0xc8, 0x74, 0xc4, 0xcc, 0xb9, 0xf9, 0xb5, 0x79, 0xe9, 0x45, 0xd9, 0x14, \ + 0x60, 0xb0, 0x7d, 0xbb, 0x93, 0xf2, 0x6b, 0x1e, 0x9f, 0x33, 0xad, 0x0d, \ + 0x8f, 0x8a, 0x3c, 0x56, 0x65, 0xe5, 0xdc, 0x44, 0xd9, 0xcc, 0x66, 0x85, \ + 0x07, 0xd5, 0xf8, 0x27, 0xb0, 0x4a, 0x35, 0xd0, 0x63, 0x9e, 0x0a, 0x6e, \ + 0x1b, 0xb7, 0xda, 0xf0, 0x7e, 0xab, 0xee, 0x0c, 0x10, 0x93, 0x86, 0x49, \ + 0x18, 0x34, 0xf3, 0xa8, 0x2a, 0xd2, 0x57, 0xf5, 0x2e, 0xd4, 0x2f, 0x77, \ + 0x29, 0x84, 0x61, 0x4d, 0x82, 0x50, 0x8f, 0xa7, 0x95, 0x48, 0x70, 0xf5, \ + 0x6e, 0x4d, 0xb2, 0xd5, 0x13, 0xc3, 0xd2, 0x1a, 0xed, 0xe6, 0x43, 0xea, \ + 0x42, 0x14, 0xeb, 0x74, 0xea, 0xc0, 0xed, 0x1f, 0xd4, 0x57, 0x4e, 0xa9, \ + 0xf3, 0xa8, 0xed, 0xd2, 0xe0, 0xc1, 0x30, 0x71, 0x30, 0x32, 0x30, 0xd5, \ + 0xd3, 0xf6, 0x08, 0xd0, 0x56, 0x4f, 0x46, 0x8e, 0xf2, 0x5f, 0xf9, 0x3d, \ + 0x67, 0x91, 0x88, 0x30, 0x2e, 0x42, 0xb2, 0xdf, 0x7d, 0xfb, 0xe5, 0x0c, \ + 0x77, 0xff, 0xec, 0x31, 0xc0, 0x78, 0x8f, 0xbf, 0xc2, 0x7f, 0xca, 0xad, \ + 0x6c, 0x21, 0xd6, 0x8d, 0xd9, 0x8b, 0x6a, 0x8e, 0x6f, 0xe0, 0x9b, 0xf8, \ + 0x10, 0x56, 0xcc, 0xb3, 0x8e, 0x13, 0x15, 0xe6, 0x34, 0x04, 0x66, 0xc7, \ + 0xee, 0xf9, 0x36, 0x0e, 0x6a, 0x95, 0xf6, 0x09, 0x9a, 0x06, 0x67, 0xf4, \ + 0x65, 0x71, 0xf8, 0xca, 0xa4, 0xb1, 0x25, 0xe0, 0xfe, 0x3c, 0x8b, 0x35, \ + 0x04, 0x67, 0xba, 0xe0, 0x4f, 0x76, 0x85, 0xfc, 0x7f, 0xfc, 0x36, 0x6b, \ + 0xb5, 0xe9, 0xcd, 0x2d, 0x03, 0x62, 0x4e, 0xb3, 0x3d, 0x00, 0xcf, 0xaf, \ + 0x76, 0xa0, 0x69, 0x56, 0x83, 0x6a, 0xd2, 0xa8, 0xd4, 0xe7, 0x50, 0x71, \ + 0xe6, 0xb5, 0x36, 0x05, 0x77, 0x05, 0x6d, 0x7b, 0xc8, 0xe4, 0xc4, 0xfd, \ + 0x4c, 0xd5, 0x21, 0x5f, 0x02, 0x03, 0x01, 0x00, 0x01, 0x02, 0x82, 0x01, \ + 0x00, 0x67, 0x4d, 0xb5, 0xf6, 0x03, 0x89, 0xaa, 0x7a, 0x6f, 0x3b, 0x2d, \ + 0xca, 0x10, 0xa2, 0x23, 0xc9, 0xbd, 0x4e, 0xda, 0xe1, 0x67, 0x0e, 0x0c, \ + 0x8a, 0xc6, 0x84, 0x68, 0xdf, 0xe5, 0x97, 0x75, 0xd2, 0x8d, 0xa3, 0x86, \ + 0xd9, 0xdb, 0xd5, 0xeb, 0x13, 0x19, 0x08, 0xc5, 0x7e, 0xe5, 0x37, 0x97, \ + 0x0c, 0x73, 0x80, 0x66, 0x76, 0x35, 0xf1, 0x88, 0xb5, 0xf2, 0xfc, 0xf3, \ + 0xe1, 0x4b, 0x76, 0x4e, 0x73, 0x45, 0xce, 0x2c, 0xc2, 0x10, 0x26, 0x0d, \ + 0x68, 0x0d, 0x9f, 0x49, 0x3d, 0xd6, 0x80, 0x89, 0xe7, 0xc5, 0x49, 0x15, \ + 0xdd, 0x85, 0xc0, 0xc8, 0xfe, 0x82, 0x37, 0x12, 0x5a, 0x0a, 0x6b, 0xf6, \ + 0x68, 0x0d, 0x32, 0x16, 0xbd, 0xa4, 0x15, 0x54, 0x9e, 0x68, 0xa1, 0xad, \ + 0xca, 0x6b, 0xe5, 0x8c, 0xda, 0x76, 0x35, 0x59, 0x2f, 0x9b, 0xb4, 0xe1, \ + 0xf1, 0xf0, 0x50, 0x04, 0xee, 0xc8, 0xec, 0x05, 0xe1, 0xcf, 0x8d, 0xe4, \ + 0xd2, 0x64, 0x7b, 0x5e, 0x63, 0xe0, 0x7b, 0x07, 0xbc, 0x02, 0x96, 0x4e, \ + 0x1b, 0x78, 0x6c, 0xb6, 0x43, 0x9a, 0x32, 0xf6, 0xd6, 0x02, 0xf5, 0x80, \ + 0xcc, 0x26, 0x6e, 0xa5, 0xd0, 0xe3, 0x65, 0x88, 0xce, 0x26, 0xa9, 0x40, \ + 0xe1, 0xe1, 0x00, 0xe0, 0x7f, 0x3f, 0xc3, 0xb1, 0x7c, 0xde, 0xbe, 0x42, \ + 0xba, 0x07, 0x81, 0x13, 0xc2, 0xe0, 0x11, 0x11, 0x23, 0x2c, 0xf8, 0xb2, \ + 0x7a, 0x3a, 0xd4, 0xe4, 0x7d, 0x5f, 0xb9, 0xb1, 0x18, 0xfa, 0x1d, 0x1d, \ + 0x97, 0x91, 0xd9, 0x04, 0x9e, 0xbc, 0xc9, 0xb4, 0xd7, 0x7d, 0x0e, 0x54, \ + 0xf6, 0x8f, 0xd0, 0x28, 0x0d, 0xdd, 0x77, 0x4b, 0x68, 0x04, 0x48, 0x61, \ + 0x75, 0x15, 0x03, 0x1b, 0x35, 0xad, 0x8e, 0xfc, 0x24, 0x11, 0x07, 0xea, \ + 0x17, 0x5a, 0xde, 0x19, 0x68, 0xff, 0xb6, 0x87, 0x7f, 0x80, 0x2a, 0x5f, \ + 0x0c, 0x58, 0xba, 0x5f, 0x41, 0x02, 0x81, 0x81, 0x00, 0xe3, 0x03, 0xaf, \ + 0xfe, 0x98, 0xd2, 0x0b, 0x7b, 0x72, 0xe9, 0x3b, 0x8e, 0xbc, 0xa5, 0xf6, \ + 0xac, 0xe5, 0x22, 0x06, 0xb2, 0xd7, 0x5e, 0xfd, 0x89, 0x4b, 0x16, 0x67, \ + 0x32, 0x83, 0x22, 0x58, 0x8e, 0x62, 0xa4, 0xb4, 0x2d, 0xf9, 0x16, 0x13, \ + 0x54, 0xf6, 0x9f, 0x2f, 0xf9, 0xbb, 0x0e, 0x7e, 0x8c, 0x6f, 0x08, 0xda, \ + 0xc8, 0xe9, 0x1c, 0x66, 0x10, 0x70, 0x93, 0x90, 0x8d, 0xcf, 0x90, 0x3a, \ + 0x43, 0x89, 0x49, 0xeb, 0x83, 0x2a, 0xfe, 0x5a, 0x87, 0xce, 0x74, 0x42, \ + 0x41, 0x0d, 0x8c, 0x73, 0x51, 0xbc, 0x7b, 0x20, 0xc5, 0xfd, 0xf6, 0x0b, \ + 0x65, 0xed, 0xa9, 0x2e, 0xfc, 0x0f, 0xf5, 0x50, 0xf9, 0x8d, 0x37, 0x36, \ + 0x9a, 0x20, 0xdf, 0xc3, 0xe3, 0x27, 0xbc, 0x98, 0x72, 0xc1, 0x14, 0x4b, \ + 0x71, 0xe9, 0x83, 0x14, 0xff, 0x24, 0xe2, 0x14, 0x15, 0xb6, 0x6f, 0x0f, \ + 0x32, 0x9d, 0xd9, 0x98, 0xd1, 0x02, 0x81, 0x81, 0x00, 0xe2, 0x0c, 0xfb, \ + 0xc3, 0x33, 0x9b, 0x47, 0x88, 0x27, 0xf2, 0x26, 0xde, 0xeb, 0x5e, 0xee, \ + 0x40, 0xf6, 0x63, 0x5b, 0x35, 0x23, 0xf5, 0xd5, 0x07, 0x61, 0xdf, 0xa2, \ + 0x9f, 0x58, 0x30, 0x04, 0x22, 0x2b, 0xb4, 0xd9, 0xda, 0x46, 0x7f, 0x48, \ + 0xf5, 0x4f, 0xd0, 0xea, 0xd7, 0xa0, 0x45, 0x8a, 0x62, 0x8b, 0x8c, 0xac, \ + 0x73, 0x5e, 0xfa, 0x36, 0x65, 0x3e, 0xba, 0x6c, 0xba, 0x5e, 0x6b, 0x92, \ + 0x29, 0x5e, 0x6a, 0x0f, 0xd6, 0xd2, 0xa5, 0x95, 0x86, 0xda, 0x72, 0xc5, \ + 0x9e, 0xc9, 0x6b, 0x37, 0x5e, 0x4b, 0x9b, 0x77, 0xe1, 0x67, 0x1a, 0x1e, \ + 0x30, 0xd8, 0x41, 0x68, 0x40, 0xd3, 0x9c, 0xb4, 0xf6, 0xeb, 0x2a, 0x22, \ + 0xdf, 0x78, 0x29, 0xd2, 0x64, 0x92, 0x5b, 0x2f, 0x78, 0x64, 0x4a, 0xa2, \ + 0xa6, 0x6b, 0x3e, 0x50, 0xb1, 0x7a, 0xb1, 0x8d, 0x59, 0xb4, 0x55, 0xba, \ + 0xb6, 0x91, 0x85, 0xa3, 0x2f, 0x02, 0x81, 0x80, 0x10, 0x1e, 0x19, 0xe7, \ + 0xbc, 0x97, 0xe5, 0x22, 0xcd, 0xa4, 0xcb, 0x8a, 0xb5, 0xd0, 0x1e, 0xb4, \ + 0x65, 0xcc, 0x45, 0xa7, 0x7a, 0xed, 0x0e, 0x99, 0x29, 0xd0, 0x9c, 0x61, \ + 0x14, 0xb8, 0x62, 0x8b, 0x31, 0x6b, 0xba, 0x33, 0x2d, 0x65, 0x28, 0xd8, \ + 0x36, 0x6e, 0x54, 0xec, 0xa9, 0x20, 0x3d, 0x51, 0xe1, 0x2c, 0x42, 0xc4, \ + 0x52, 0xf0, 0xa6, 0x3a, 0x72, 0x93, 0xb7, 0x86, 0xa9, 0xfe, 0xf6, 0x74, \ + 0x07, 0x12, 0x4d, 0x7b, 0x51, 0x99, 0x1f, 0x7a, 0x56, 0xe9, 0x20, 0x2f, \ + 0x18, 0x34, 0x29, 0x97, 0xdb, 0x06, 0xee, 0xeb, 0xbf, 0xbd, 0x31, 0x4f, \ + 0xfa, 0x50, 0xb1, 0xba, 0x49, 0xb3, 0xc4, 0x1d, 0x03, 0xae, 0xb0, 0xdc, \ + 0xbe, 0x8a, 0xc4, 0x90, 0xa3, 0x28, 0x9b, 0xb6, 0x42, 0x09, 0x1b, 0xd6, \ + 0x29, 0x9b, 0x19, 0xe9, 0x87, 0x87, 0xd9, 0x9f, 0x35, 0x05, 0xab, 0x91, \ + 0x8f, 0x6d, 0x7c, 0x91, 0x02, 0x81, 0x81, 0x00, 0x94, 0x57, 0xf0, 0xe0, \ + 0x28, 0xfd, 0xbd, 0xf3, 0x9c, 0x43, 0x4d, 0x3e, 0xfd, 0x37, 0x4f, 0x23, \ + 0x52, 0x8d, 0xe1, 0x4c, 0xfe, 0x4c, 0x55, 0x80, 0x82, 0xba, 0x3f, 0xfe, \ + 0x51, 0xe1, 0x30, 0xd5, 0x3b, 0xd9, 0x73, 0x1d, 0xcb, 0x25, 0xbc, 0xbb, \ + 0x3f, 0xa5, 0xda, 0x77, 0xa6, 0xb5, 0xfc, 0x1a, 0xaf, 0x79, 0xa1, 0xb2, \ + 0x14, 0xa2, 0x1f, 0x10, 0x52, 0x1a, 0x05, 0x40, 0x48, 0xb6, 0x4f, 0x34, \ + 0xd6, 0xc0, 0xc3, 0xa4, 0x36, 0x98, 0x73, 0x88, 0x0b, 0xd3, 0x45, 0xdc, \ + 0xee, 0x51, 0x6e, 0x04, 0x73, 0x99, 0x93, 0x12, 0x58, 0x96, 0xcb, 0x39, \ + 0x42, 0xb1, 0xa9, 0xb8, 0xe1, 0x25, 0xf5, 0x9c, 0x14, 0xb7, 0x92, 0x2b, \ + 0x14, 0xb0, 0x5d, 0x61, 0xa2, 0xaa, 0x34, 0x7c, 0xcd, 0x54, 0x2d, 0x69, \ + 0x08, 0xf7, 0xdb, 0xfc, 0x9c, 0x87, 0xe8, 0x3a, 0xf6, 0x1d, 0x4c, 0x6a, \ + 0x83, 0x15, 0x30, 0x01, 0x02, 0x81, 0x81, 0x00, 0x9c, 0x53, 0xa1, 0xb6, \ + 0x2f, 0xc0, 0x06, 0xf5, 0xdf, 0x5c, 0xd1, 0x4a, 0x4e, 0xc8, 0xbd, 0x6d, \ + 0x32, 0xf1, 0x5e, 0xe5, 0x3b, 0x70, 0xd0, 0xa8, 0xe5, 0x41, 0x57, 0x6c, \ + 0x87, 0x53, 0x0f, 0xeb, 0x28, 0xa0, 0x62, 0x8f, 0x43, 0x62, 0xec, 0x2e, \ + 0x6c, 0x71, 0x55, 0x5b, 0x6a, 0xf4, 0x74, 0x14, 0xea, 0x7a, 0x03, 0xf6, \ + 0xfc, 0xa4, 0xce, 0xc4, 0xac, 0xda, 0x1d, 0xf0, 0xb5, 0xa9, 0xfd, 0x11, \ + 0x18, 0x3b, 0x14, 0xa0, 0x90, 0x8d, 0x26, 0xb7, 0x75, 0x73, 0x0a, 0x02, \ + 0x2c, 0x6f, 0x0f, 0xd8, 0x41, 0x78, 0xc3, 0x73, 0x81, 0xac, 0xaa, 0xaf, \ + 0xf2, 0xee, 0x32, 0xb5, 0x8d, 0x05, 0xf9, 0x59, 0x5a, 0x9e, 0x3e, 0x65, \ + 0x9b, 0x74, 0xda, 0xa0, 0x74, 0x95, 0x17, 0x5f, 0x8d, 0x58, 0xfc, 0x8e, \ + 0x4e, 0x2c, 0x1e, 0xbc, 0x81, 0x02, 0x18, 0xac, 0x12, 0xc6, 0xf9, 0x64, \ + 0x8b, 0x87, 0xc3, 0x00 \ +} +/* END FILE */ + +/* + * + * Test certificates and keys as C variables + * + */ + +/* + * CA + */ + +const char mbedtls_test_ca_crt_ec_pem[] = TEST_CA_CRT_EC_PEM; +const char mbedtls_test_ca_key_ec_pem[] = TEST_CA_KEY_EC_PEM; +const char mbedtls_test_ca_pwd_ec_pem[] = TEST_CA_PWD_EC_PEM; +const char mbedtls_test_ca_key_rsa_pem[] = TEST_CA_KEY_RSA_PEM; +const char mbedtls_test_ca_pwd_rsa_pem[] = TEST_CA_PWD_RSA_PEM; +const char mbedtls_test_ca_crt_rsa_sha1_pem[] = TEST_CA_CRT_RSA_SHA1_PEM; +const char mbedtls_test_ca_crt_rsa_sha256_pem[] = TEST_CA_CRT_RSA_SHA256_PEM; + +const unsigned char mbedtls_test_ca_crt_ec_der[] = TEST_CA_CRT_EC_DER; +const unsigned char mbedtls_test_ca_key_ec_der[] = TEST_CA_KEY_EC_DER; +const unsigned char mbedtls_test_ca_key_rsa_der[] = TEST_CA_KEY_RSA_DER; +const unsigned char mbedtls_test_ca_crt_rsa_sha1_der[] = + TEST_CA_CRT_RSA_SHA1_DER; +const unsigned char mbedtls_test_ca_crt_rsa_sha256_der[] = + TEST_CA_CRT_RSA_SHA256_DER; + +const size_t mbedtls_test_ca_crt_ec_pem_len = + sizeof( mbedtls_test_ca_crt_ec_pem ); +const size_t mbedtls_test_ca_key_ec_pem_len = + sizeof( mbedtls_test_ca_key_ec_pem ); +const size_t mbedtls_test_ca_pwd_ec_pem_len = + sizeof( mbedtls_test_ca_pwd_ec_pem ) - 1; +const size_t mbedtls_test_ca_key_rsa_pem_len = + sizeof( mbedtls_test_ca_key_rsa_pem ); +const size_t mbedtls_test_ca_pwd_rsa_pem_len = + sizeof( mbedtls_test_ca_pwd_rsa_pem ) - 1; +const size_t mbedtls_test_ca_crt_rsa_sha1_pem_len = + sizeof( mbedtls_test_ca_crt_rsa_sha1_pem ); +const size_t mbedtls_test_ca_crt_rsa_sha256_pem_len = + sizeof( mbedtls_test_ca_crt_rsa_sha256_pem ); + +const size_t mbedtls_test_ca_crt_ec_der_len = + sizeof( mbedtls_test_ca_crt_ec_der ); +const size_t mbedtls_test_ca_key_ec_der_len = + sizeof( mbedtls_test_ca_key_ec_der ); +const size_t mbedtls_test_ca_pwd_ec_der_len = 0; +const size_t mbedtls_test_ca_key_rsa_der_len = + sizeof( mbedtls_test_ca_key_rsa_der ); +const size_t mbedtls_test_ca_pwd_rsa_der_len = 0; +const size_t mbedtls_test_ca_crt_rsa_sha1_der_len = + sizeof( mbedtls_test_ca_crt_rsa_sha1_der ); +const size_t mbedtls_test_ca_crt_rsa_sha256_der_len = + sizeof( mbedtls_test_ca_crt_rsa_sha256_der ); + +/* + * Server + */ + +const char mbedtls_test_srv_crt_ec_pem[] = TEST_SRV_CRT_EC_PEM; +const char mbedtls_test_srv_key_ec_pem[] = TEST_SRV_KEY_EC_PEM; +const char mbedtls_test_srv_pwd_ec_pem[] = ""; +const char mbedtls_test_srv_key_rsa_pem[] = TEST_SRV_KEY_RSA_PEM; +const char mbedtls_test_srv_pwd_rsa_pem[] = ""; +const char mbedtls_test_srv_crt_rsa_sha1_pem[] = TEST_SRV_CRT_RSA_SHA1_PEM; +const char mbedtls_test_srv_crt_rsa_sha256_pem[] = TEST_SRV_CRT_RSA_SHA256_PEM; + +const unsigned char mbedtls_test_srv_crt_ec_der[] = TEST_SRV_CRT_EC_DER; +const unsigned char mbedtls_test_srv_key_ec_der[] = TEST_SRV_KEY_EC_DER; +const unsigned char mbedtls_test_srv_key_rsa_der[] = TEST_SRV_KEY_RSA_DER; +const unsigned char mbedtls_test_srv_crt_rsa_sha1_der[] = + TEST_SRV_CRT_RSA_SHA1_DER; +const unsigned char mbedtls_test_srv_crt_rsa_sha256_der[] = + TEST_SRV_CRT_RSA_SHA256_DER; + +const size_t mbedtls_test_srv_crt_ec_pem_len = + sizeof( mbedtls_test_srv_crt_ec_pem ); +const size_t mbedtls_test_srv_key_ec_pem_len = + sizeof( mbedtls_test_srv_key_ec_pem ); +const size_t mbedtls_test_srv_pwd_ec_pem_len = + sizeof( mbedtls_test_srv_pwd_ec_pem ) - 1; +const size_t mbedtls_test_srv_key_rsa_pem_len = + sizeof( mbedtls_test_srv_key_rsa_pem ); +const size_t mbedtls_test_srv_pwd_rsa_pem_len = + sizeof( mbedtls_test_srv_pwd_rsa_pem ) - 1; +const size_t mbedtls_test_srv_crt_rsa_sha1_pem_len = + sizeof( mbedtls_test_srv_crt_rsa_sha1_pem ); +const size_t mbedtls_test_srv_crt_rsa_sha256_pem_len = + sizeof( mbedtls_test_srv_crt_rsa_sha256_pem ); + +const size_t mbedtls_test_srv_crt_ec_der_len = + sizeof( mbedtls_test_srv_crt_ec_der ); +const size_t mbedtls_test_srv_key_ec_der_len = + sizeof( mbedtls_test_srv_key_ec_der ); +const size_t mbedtls_test_srv_pwd_ec_der_len = 0; +const size_t mbedtls_test_srv_key_rsa_der_len = + sizeof( mbedtls_test_srv_key_rsa_der ); +const size_t mbedtls_test_srv_pwd_rsa_der_len = 0; +const size_t mbedtls_test_srv_crt_rsa_sha1_der_len = + sizeof( mbedtls_test_srv_crt_rsa_sha1_der ); +const size_t mbedtls_test_srv_crt_rsa_sha256_der_len = + sizeof( mbedtls_test_srv_crt_rsa_sha256_der ); + +/* + * Client + */ + +const char mbedtls_test_cli_crt_ec_pem[] = TEST_CLI_CRT_EC_PEM; +const char mbedtls_test_cli_key_ec_pem[] = TEST_CLI_KEY_EC_PEM; +const char mbedtls_test_cli_pwd_ec_pem[] = ""; +const char mbedtls_test_cli_key_rsa_pem[] = TEST_CLI_KEY_RSA_PEM; +const char mbedtls_test_cli_pwd_rsa_pem[] = ""; +const char mbedtls_test_cli_crt_rsa_pem[] = TEST_CLI_CRT_RSA_PEM; + +const unsigned char mbedtls_test_cli_crt_ec_der[] = TEST_CLI_CRT_EC_DER; +const unsigned char mbedtls_test_cli_key_ec_der[] = TEST_CLI_KEY_EC_DER; +const unsigned char mbedtls_test_cli_key_rsa_der[] = TEST_CLI_KEY_RSA_DER; +const unsigned char mbedtls_test_cli_crt_rsa_der[] = TEST_CLI_CRT_RSA_DER; + +const size_t mbedtls_test_cli_crt_ec_pem_len = + sizeof( mbedtls_test_cli_crt_ec_pem ); +const size_t mbedtls_test_cli_key_ec_pem_len = + sizeof( mbedtls_test_cli_key_ec_pem ); +const size_t mbedtls_test_cli_pwd_ec_pem_len = + sizeof( mbedtls_test_cli_pwd_ec_pem ) - 1; +const size_t mbedtls_test_cli_key_rsa_pem_len = + sizeof( mbedtls_test_cli_key_rsa_pem ); +const size_t mbedtls_test_cli_pwd_rsa_pem_len = + sizeof( mbedtls_test_cli_pwd_rsa_pem ) - 1; +const size_t mbedtls_test_cli_crt_rsa_pem_len = + sizeof( mbedtls_test_cli_crt_rsa_pem ); + +const size_t mbedtls_test_cli_crt_ec_der_len = + sizeof( mbedtls_test_cli_crt_ec_der ); +const size_t mbedtls_test_cli_key_ec_der_len = + sizeof( mbedtls_test_cli_key_ec_der ); +const size_t mbedtls_test_cli_key_rsa_der_len = + sizeof( mbedtls_test_cli_key_rsa_der ); +const size_t mbedtls_test_cli_crt_rsa_der_len = + sizeof( mbedtls_test_cli_crt_rsa_der ); + +/* + * + * Definitions of test CRTs without specification of all parameters, choosing + * them automatically according to the config. For example, mbedtls_test_ca_crt + * is one of mbedtls_test_ca_crt_{rsa|ec}_{sha1|sha256}_{pem|der}. + * + */ + +/* + * Dispatch between PEM and DER according to config + */ + +#if defined(MBEDTLS_PEM_PARSE_C) + +/* PEM encoded test CA certificates and keys */ + +#define TEST_CA_KEY_RSA TEST_CA_KEY_RSA_PEM +#define TEST_CA_PWD_RSA TEST_CA_PWD_RSA_PEM +#define TEST_CA_CRT_RSA_SHA256 TEST_CA_CRT_RSA_SHA256_PEM +#define TEST_CA_CRT_RSA_SHA1 TEST_CA_CRT_RSA_SHA1_PEM +#define TEST_CA_KEY_EC TEST_CA_KEY_EC_PEM +#define TEST_CA_PWD_EC TEST_CA_PWD_EC_PEM +#define TEST_CA_CRT_EC TEST_CA_CRT_EC_PEM + +/* PEM encoded test server certificates and keys */ + +#define TEST_SRV_KEY_RSA TEST_SRV_KEY_RSA_PEM +#define TEST_SRV_PWD_RSA "" +#define TEST_SRV_CRT_RSA_SHA256 TEST_SRV_CRT_RSA_SHA256_PEM +#define TEST_SRV_CRT_RSA_SHA1 TEST_SRV_CRT_RSA_SHA1_PEM +#define TEST_SRV_KEY_EC TEST_SRV_KEY_EC_PEM +#define TEST_SRV_PWD_EC "" +#define TEST_SRV_CRT_EC TEST_SRV_CRT_EC_PEM + +/* PEM encoded test client certificates and keys */ + +#define TEST_CLI_KEY_RSA TEST_CLI_KEY_RSA_PEM +#define TEST_CLI_PWD_RSA "" +#define TEST_CLI_CRT_RSA TEST_CLI_CRT_RSA_PEM +#define TEST_CLI_KEY_EC TEST_CLI_KEY_EC_PEM +#define TEST_CLI_PWD_EC "" +#define TEST_CLI_CRT_EC TEST_CLI_CRT_EC_PEM + +#else /* MBEDTLS_PEM_PARSE_C */ + +/* DER encoded test CA certificates and keys */ + +#define TEST_CA_KEY_RSA TEST_CA_KEY_RSA_DER +#define TEST_CA_PWD_RSA "" +#define TEST_CA_CRT_RSA_SHA256 TEST_CA_CRT_RSA_SHA256_DER +#define TEST_CA_CRT_RSA_SHA1 TEST_CA_CRT_RSA_SHA1_DER +#define TEST_CA_KEY_EC TEST_CA_KEY_EC_DER +#define TEST_CA_PWD_EC "" +#define TEST_CA_CRT_EC TEST_CA_CRT_EC_DER + +/* DER encoded test server certificates and keys */ + +#define TEST_SRV_KEY_RSA TEST_SRV_KEY_RSA_DER +#define TEST_SRV_PWD_RSA "" +#define TEST_SRV_CRT_RSA_SHA256 TEST_SRV_CRT_RSA_SHA256_DER +#define TEST_SRV_CRT_RSA_SHA1 TEST_SRV_CRT_RSA_SHA1_DER +#define TEST_SRV_KEY_EC TEST_SRV_KEY_EC_DER +#define TEST_SRV_PWD_EC "" +#define TEST_SRV_CRT_EC TEST_SRV_CRT_EC_DER + +/* DER encoded test client certificates and keys */ + +#define TEST_CLI_KEY_RSA TEST_CLI_KEY_RSA_DER +#define TEST_CLI_PWD_RSA "" +#define TEST_CLI_CRT_RSA TEST_CLI_CRT_RSA_DER +#define TEST_CLI_KEY_EC TEST_CLI_KEY_EC_DER +#define TEST_CLI_PWD_EC "" +#define TEST_CLI_CRT_EC TEST_CLI_CRT_EC_DER + +#endif /* MBEDTLS_PEM_PARSE_C */ + +const char mbedtls_test_ca_key_rsa[] = TEST_CA_KEY_RSA; +const char mbedtls_test_ca_pwd_rsa[] = TEST_CA_PWD_RSA; +const char mbedtls_test_ca_crt_rsa_sha256[] = TEST_CA_CRT_RSA_SHA256; +const char mbedtls_test_ca_crt_rsa_sha1[] = TEST_CA_CRT_RSA_SHA1; +const char mbedtls_test_ca_key_ec[] = TEST_CA_KEY_EC; +const char mbedtls_test_ca_pwd_ec[] = TEST_CA_PWD_EC; +const char mbedtls_test_ca_crt_ec[] = TEST_CA_CRT_EC; + +const char mbedtls_test_srv_key_rsa[] = TEST_SRV_KEY_RSA; +const char mbedtls_test_srv_pwd_rsa[] = TEST_SRV_PWD_RSA; +const char mbedtls_test_srv_crt_rsa_sha256[] = TEST_SRV_CRT_RSA_SHA256; +const char mbedtls_test_srv_crt_rsa_sha1[] = TEST_SRV_CRT_RSA_SHA1; +const char mbedtls_test_srv_key_ec[] = TEST_SRV_KEY_EC; +const char mbedtls_test_srv_pwd_ec[] = TEST_SRV_PWD_EC; +const char mbedtls_test_srv_crt_ec[] = TEST_SRV_CRT_EC; + +const char mbedtls_test_cli_key_rsa[] = TEST_CLI_KEY_RSA; +const char mbedtls_test_cli_pwd_rsa[] = TEST_CLI_PWD_RSA; +const char mbedtls_test_cli_crt_rsa[] = TEST_CLI_CRT_RSA; +const char mbedtls_test_cli_key_ec[] = TEST_CLI_KEY_EC; +const char mbedtls_test_cli_pwd_ec[] = TEST_CLI_PWD_EC; +const char mbedtls_test_cli_crt_ec[] = TEST_CLI_CRT_EC; + +const size_t mbedtls_test_ca_key_rsa_len = + sizeof( mbedtls_test_ca_key_rsa ); +const size_t mbedtls_test_ca_pwd_rsa_len = + sizeof( mbedtls_test_ca_pwd_rsa ) - 1; +const size_t mbedtls_test_ca_crt_rsa_sha256_len = + sizeof( mbedtls_test_ca_crt_rsa_sha256 ); +const size_t mbedtls_test_ca_crt_rsa_sha1_len = + sizeof( mbedtls_test_ca_crt_rsa_sha1 ); +const size_t mbedtls_test_ca_key_ec_len = + sizeof( mbedtls_test_ca_key_ec ); +const size_t mbedtls_test_ca_pwd_ec_len = + sizeof( mbedtls_test_ca_pwd_ec ) - 1; +const size_t mbedtls_test_ca_crt_ec_len = + sizeof( mbedtls_test_ca_crt_ec ); + +const size_t mbedtls_test_srv_key_rsa_len = + sizeof( mbedtls_test_srv_key_rsa ); +const size_t mbedtls_test_srv_pwd_rsa_len = + sizeof( mbedtls_test_srv_pwd_rsa ) -1; +const size_t mbedtls_test_srv_crt_rsa_sha256_len = + sizeof( mbedtls_test_srv_crt_rsa_sha256 ); +const size_t mbedtls_test_srv_crt_rsa_sha1_len = + sizeof( mbedtls_test_srv_crt_rsa_sha1 ); +const size_t mbedtls_test_srv_key_ec_len = + sizeof( mbedtls_test_srv_key_ec ); +const size_t mbedtls_test_srv_pwd_ec_len = + sizeof( mbedtls_test_srv_pwd_ec ) - 1; +const size_t mbedtls_test_srv_crt_ec_len = + sizeof( mbedtls_test_srv_crt_ec ); + +const size_t mbedtls_test_cli_key_rsa_len = + sizeof( mbedtls_test_cli_key_rsa ); +const size_t mbedtls_test_cli_pwd_rsa_len = + sizeof( mbedtls_test_cli_pwd_rsa ) - 1; +const size_t mbedtls_test_cli_crt_rsa_len = + sizeof( mbedtls_test_cli_crt_rsa ); +const size_t mbedtls_test_cli_key_ec_len = + sizeof( mbedtls_test_cli_key_ec ); +const size_t mbedtls_test_cli_pwd_ec_len = + sizeof( mbedtls_test_cli_pwd_ec ) - 1; +const size_t mbedtls_test_cli_crt_ec_len = + sizeof( mbedtls_test_cli_crt_ec ); + +/* + * Dispatch between SHA-1 and SHA-256 + */ #if defined(MBEDTLS_SHA256_C) -#define TEST_CA_CRT_RSA_SHA256 \ -"-----BEGIN CERTIFICATE-----\r\n" \ -"MIIDhzCCAm+gAwIBAgIBADANBgkqhkiG9w0BAQsFADA7MQswCQYDVQQGEwJOTDER\r\n" \ -"MA8GA1UECgwIUG9sYXJTU0wxGTAXBgNVBAMMEFBvbGFyU1NMIFRlc3QgQ0EwHhcN\r\n" \ -"MTcwNTA0MTY1NzAxWhcNMjcwNTA1MTY1NzAxWjA7MQswCQYDVQQGEwJOTDERMA8G\r\n" \ -"A1UECgwIUG9sYXJTU0wxGTAXBgNVBAMMEFBvbGFyU1NMIFRlc3QgQ0EwggEiMA0G\r\n" \ -"CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDA3zf8F7vglp0/ht6WMn1EpRagzSHx\r\n" \ -"mdTs6st8GFgIlKXsm8WL3xoemTiZhx57wI053zhdcHgH057Zk+i5clHFzqMwUqny\r\n" \ -"50BwFMtEonILwuVA+T7lpg6z+exKY8C4KQB0nFc7qKUEkHHxvYPZP9al4jwqj+8n\r\n" \ -"YMPGn8u67GB9t+aEMr5P+1gmIgNb1LTV+/Xjli5wwOQuvfwu7uJBVcA0Ln0kcmnL\r\n" \ -"R7EUQIN9Z/SG9jGr8XmksrUuEvmEF/Bibyc+E1ixVA0hmnM3oTDPb5Lc9un8rNsu\r\n" \ -"KNF+AksjoBXyOGVkCeoMbo4bF6BxyLObyavpw/LPh5aPgAIynplYb6LVAgMBAAGj\r\n" \ -"gZUwgZIwHQYDVR0OBBYEFLRa5KWz3tJS9rnVppUP6z68x/3/MGMGA1UdIwRcMFqA\r\n" \ -"FLRa5KWz3tJS9rnVppUP6z68x/3/oT+kPTA7MQswCQYDVQQGEwJOTDERMA8GA1UE\r\n" \ -"CgwIUG9sYXJTU0wxGTAXBgNVBAMMEFBvbGFyU1NMIFRlc3QgQ0GCAQAwDAYDVR0T\r\n" \ -"BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAHK/HHrTZMnnVMpde1io+voAtql7j\r\n" \ -"4sRhLrjD7o3THtwRbDa2diCvpq0Sq23Ng2LMYoXsOxoL/RQK3iN7UKxV3MKPEr0w\r\n" \ -"XQS+kKQqiT2bsfrjnWMVHZtUOMpm6FNqcdGm/Rss3vKda2lcKl8kUnq/ylc1+QbB\r\n" \ -"G6A6tUvQcr2ZyWfVg+mM5XkhTrOOXus2OLikb4WwEtJTJRNE0f+yPODSUz0/vT57\r\n" \ -"ApH0CnB80bYJshYHPHHymOtleAB8KSYtqm75g/YNobjnjB6cm4HkW3OZRVIl6fYY\r\n" \ -"n20NRVA1Vjs6GAROr4NqW4k/+LofY9y0LLDE+p0oIEKXIsIvhPr39swxSA==\r\n" \ -"-----END CERTIFICATE-----\r\n" - -const char mbedtls_test_ca_crt_rsa[] = TEST_CA_CRT_RSA_SHA256; -const size_t mbedtls_test_ca_crt_rsa_len = sizeof( mbedtls_test_ca_crt_rsa ); -#define TEST_CA_CRT_RSA_SOME - -static const char mbedtls_test_ca_crt_rsa_sha256[] = TEST_CA_CRT_RSA_SHA256; +#define TEST_CA_CRT_RSA TEST_CA_CRT_RSA_SHA256 +#define TEST_SRV_CRT_RSA TEST_SRV_CRT_RSA_SHA256 +#else +#define TEST_CA_CRT_RSA TEST_CA_CRT_RSA_SHA1 +#define TEST_SRV_CRT_RSA TEST_SRV_CRT_RSA_SHA1 +#endif /* MBEDTLS_SHA256_C */ -#endif +const char mbedtls_test_ca_crt_rsa[] = TEST_CA_CRT_RSA; +const char mbedtls_test_srv_crt_rsa[] = TEST_SRV_CRT_RSA; -#if !defined(TEST_CA_CRT_RSA_SOME) || defined(MBEDTLS_SHA1_C) -#define TEST_CA_CRT_RSA_SHA1 \ -"-----BEGIN CERTIFICATE-----\r\n" \ -"MIIDhzCCAm+gAwIBAgIBADANBgkqhkiG9w0BAQUFADA7MQswCQYDVQQGEwJOTDER\r\n" \ -"MA8GA1UEChMIUG9sYXJTU0wxGTAXBgNVBAMTEFBvbGFyU1NMIFRlc3QgQ0EwHhcN\r\n" \ -"MTEwMjEyMTQ0NDAwWhcNMjEwMjEyMTQ0NDAwWjA7MQswCQYDVQQGEwJOTDERMA8G\r\n" \ -"A1UEChMIUG9sYXJTU0wxGTAXBgNVBAMTEFBvbGFyU1NMIFRlc3QgQ0EwggEiMA0G\r\n" \ -"CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDA3zf8F7vglp0/ht6WMn1EpRagzSHx\r\n" \ -"mdTs6st8GFgIlKXsm8WL3xoemTiZhx57wI053zhdcHgH057Zk+i5clHFzqMwUqny\r\n" \ -"50BwFMtEonILwuVA+T7lpg6z+exKY8C4KQB0nFc7qKUEkHHxvYPZP9al4jwqj+8n\r\n" \ -"YMPGn8u67GB9t+aEMr5P+1gmIgNb1LTV+/Xjli5wwOQuvfwu7uJBVcA0Ln0kcmnL\r\n" \ -"R7EUQIN9Z/SG9jGr8XmksrUuEvmEF/Bibyc+E1ixVA0hmnM3oTDPb5Lc9un8rNsu\r\n" \ -"KNF+AksjoBXyOGVkCeoMbo4bF6BxyLObyavpw/LPh5aPgAIynplYb6LVAgMBAAGj\r\n" \ -"gZUwgZIwDAYDVR0TBAUwAwEB/zAdBgNVHQ4EFgQUtFrkpbPe0lL2udWmlQ/rPrzH\r\n" \ -"/f8wYwYDVR0jBFwwWoAUtFrkpbPe0lL2udWmlQ/rPrzH/f+hP6Q9MDsxCzAJBgNV\r\n" \ -"BAYTAk5MMREwDwYDVQQKEwhQb2xhclNTTDEZMBcGA1UEAxMQUG9sYXJTU0wgVGVz\r\n" \ -"dCBDQYIBADANBgkqhkiG9w0BAQUFAAOCAQEAuP1U2ABUkIslsCfdlc2i94QHHYeJ\r\n" \ -"SsR4EdgHtdciUI5I62J6Mom+Y0dT/7a+8S6MVMCZP6C5NyNyXw1GWY/YR82XTJ8H\r\n" \ -"DBJiCTok5DbZ6SzaONBzdWHXwWwmi5vg1dxn7YxrM9d0IjxM27WNKs4sDQhZBQkF\r\n" \ -"pjmfs2cb4oPl4Y9T9meTx/lvdkRYEug61Jfn6cA+qHpyPYdTH+UshITnmp5/Ztkf\r\n" \ -"m/UTSLBNFNHesiTZeH31NcxYGdHSme9Nc/gfidRa0FLOCfWxRlFqAI47zG9jAQCZ\r\n" \ -"7Z2mCGDNMhjQc+BYcdnl0lPXjdDK6V0qCg1dVewhUBcW5gZKzV7e9+DpVA==\r\n" \ -"-----END CERTIFICATE-----\r\n" - -#if !defined (TEST_CA_CRT_RSA_SOME) -const char mbedtls_test_ca_crt_rsa[] = TEST_CA_CRT_RSA_SHA1; -const size_t mbedtls_test_ca_crt_rsa_len = sizeof( mbedtls_test_ca_crt_rsa ); -#endif +const size_t mbedtls_test_ca_crt_rsa_len = + sizeof( mbedtls_test_ca_crt_rsa ); +const size_t mbedtls_test_srv_crt_rsa_len = + sizeof( mbedtls_test_srv_crt_rsa ); -static const char mbedtls_test_ca_crt_rsa_sha1[] = TEST_CA_CRT_RSA_SHA1; +/* + * Dispatch between RSA and EC + */ -#endif +#if defined(MBEDTLS_RSA_C) + +#define TEST_CA_KEY TEST_CA_KEY_RSA +#define TEST_CA_PWD TEST_CA_PWD_RSA +#define TEST_CA_CRT TEST_CA_CRT_RSA + +#define TEST_SRV_KEY TEST_SRV_KEY_RSA +#define TEST_SRV_PWD TEST_SRV_PWD_RSA +#define TEST_SRV_CRT TEST_SRV_CRT_RSA + +#define TEST_CLI_KEY TEST_CLI_KEY_RSA +#define TEST_CLI_PWD TEST_CLI_PWD_RSA +#define TEST_CLI_CRT TEST_CLI_CRT_RSA + +#else /* no RSA, so assume ECDSA */ + +#define TEST_CA_KEY TEST_CA_KEY_EC +#define TEST_CA_PWD TEST_CA_PWD_EC +#define TEST_CA_CRT TEST_CA_CRT_EC + +#define TEST_SRV_KEY TEST_SRV_KEY_EC +#define TEST_SRV_PWD TEST_SRV_PWD_EC +#define TEST_SRV_CRT TEST_SRV_CRT_EC + +#define TEST_CLI_KEY TEST_CLI_KEY_EC +#define TEST_CLI_PWD TEST_CLI_PWD_EC +#define TEST_CLI_CRT TEST_CLI_CRT_EC -const char mbedtls_test_ca_key_rsa[] = -"-----BEGIN RSA PRIVATE KEY-----\r\n" -"Proc-Type: 4,ENCRYPTED\r\n" -"DEK-Info: DES-EDE3-CBC,A8A95B05D5B7206B\r\n" -"\r\n" -"9Qd9GeArejl1GDVh2lLV1bHt0cPtfbh5h/5zVpAVaFpqtSPMrElp50Rntn9et+JA\r\n" -"7VOyboR+Iy2t/HU4WvA687k3Bppe9GwKHjHhtl//8xFKwZr3Xb5yO5JUP8AUctQq\r\n" -"Nb8CLlZyuUC+52REAAthdWgsX+7dJO4yabzUcQ22Tp9JSD0hiL43BlkWYUNK3dAo\r\n" -"PZlmiptjnzVTjg1MxsBSydZinWOLBV8/JQgxSPo2yD4uEfig28qbvQ2wNIn0pnAb\r\n" -"GxnSAOazkongEGfvcjIIs+LZN9gXFhxcOh6kc4Q/c99B7QWETwLLkYgZ+z1a9VY9\r\n" -"gEU7CwCxYCD+h9hY6FPmsK0/lC4O7aeRKpYq00rPPxs6i7phiexg6ax6yTMmArQq\r\n" -"QmK3TAsJm8V/J5AWpLEV6jAFgRGymGGHnof0DXzVWZidrcZJWTNuGEX90nB3ee2w\r\n" -"PXJEFWKoD3K3aFcSLdHYr3mLGxP7H9ThQai9VsycxZKS5kwvBKQ//YMrmFfwPk8x\r\n" -"vTeY4KZMaUrveEel5tWZC94RSMKgxR6cyE1nBXyTQnDOGbfpNNgBKxyKbINWoOJU\r\n" -"WJZAwlsQn+QzCDwpri7+sV1mS3gBE6UY7aQmnmiiaC2V3Hbphxct/en5QsfDOt1X\r\n" -"JczSfpRWLlbPznZg8OQh/VgCMA58N5DjOzTIK7sJJ5r+94ZBTCpgAMbF588f0NTR\r\n" -"KCe4yrxGJR7X02M4nvD4IwOlpsQ8xQxZtOSgXv4LkxvdU9XJJKWZ/XNKJeWztxSe\r\n" -"Z1vdTc2YfsDBA2SEv33vxHx2g1vqtw8SjDRT2RaQSS0QuSaMJimdOX6mTOCBKk1J\r\n" -"9Q5mXTrER+/LnK0jEmXsBXWA5bqqVZIyahXSx4VYZ7l7w/PHiUDtDgyRhMMKi4n2\r\n" -"iQvQcWSQTjrpnlJbca1/DkpRt3YwrvJwdqb8asZU2VrNETh5x0QVefDRLFiVpif/\r\n" -"tUaeAe/P1F8OkS7OIZDs1SUbv/sD2vMbhNkUoCms3/PvNtdnvgL4F0zhaDpKCmlT\r\n" -"P8vx49E7v5CyRNmED9zZg4o3wmMqrQO93PtTug3Eu9oVx1zPQM1NVMyBa2+f29DL\r\n" -"1nuTCeXdo9+ni45xx+jAI4DCwrRdhJ9uzZyC6962H37H6D+5naNvClFR1s6li1Gb\r\n" -"nqPoiy/OBsEx9CaDGcqQBp5Wme/3XW+6z1ISOx+igwNTVCT14mHdBMbya0eIKft5\r\n" -"X+GnwtgEMyCYyyWuUct8g4RzErcY9+yW9Om5Hzpx4zOuW4NPZgPDTgK+t2RSL/Yq\r\n" -"rE1njrgeGYcVeG3f+OftH4s6fPbq7t1A5ZgUscbLMBqr9tK+OqygR4EgKBPsH6Cz\r\n" -"L6zlv/2RV0qAHvVuDJcIDIgwY5rJtINEm32rhOeFNJwZS5MNIC1czXZx5//ugX7l\r\n" -"I4sy5nbVhwSjtAk8Xg5dZbdTZ6mIrb7xqH+fdakZor1khG7bC2uIwibD3cSl2XkR\r\n" -"wN48lslbHnqqagr6Xm1nNOSVl8C/6kbJEsMpLhAezfRtGwvOucoaE+WbeUNolGde\r\n" -"P/eQiddSf0brnpiLJRh7qZrl9XuqYdpUqnoEdMAfotDOID8OtV7gt8a48ad8VPW2\r\n" -"-----END RSA PRIVATE KEY-----\r\n"; -const size_t mbedtls_test_ca_key_rsa_len = sizeof( mbedtls_test_ca_key_rsa ); - -const char mbedtls_test_ca_pwd_rsa[] = "PolarSSLTest"; -const size_t mbedtls_test_ca_pwd_rsa_len = sizeof( mbedtls_test_ca_pwd_rsa ) - 1; - -/* tests/data_files/server2.crt */ -const char mbedtls_test_srv_crt_rsa[] = -"-----BEGIN CERTIFICATE-----\r\n" -"MIIDNzCCAh+gAwIBAgIBAjANBgkqhkiG9w0BAQUFADA7MQswCQYDVQQGEwJOTDER\r\n" -"MA8GA1UECgwIUG9sYXJTU0wxGTAXBgNVBAMMEFBvbGFyU1NMIFRlc3QgQ0EwHhcN\r\n" -"MTEwMjEyMTQ0NDA2WhcNMjEwMjEyMTQ0NDA2WjA0MQswCQYDVQQGEwJOTDERMA8G\r\n" -"A1UECgwIUG9sYXJTU0wxEjAQBgNVBAMMCWxvY2FsaG9zdDCCASIwDQYJKoZIhvcN\r\n" -"AQEBBQADggEPADCCAQoCggEBAMFNo93nzR3RBNdJcriZrA545Do8Ss86ExbQWuTN\r\n" -"owCIp+4ea5anUrSQ7y1yej4kmvy2NKwk9XfgJmSMnLAofaHa6ozmyRyWvP7BBFKz\r\n" -"NtSj+uGxdtiQwWG0ZlI2oiZTqqt0Xgd9GYLbKtgfoNkNHC1JZvdbJXNG6AuKT2kM\r\n" -"tQCQ4dqCEGZ9rlQri2V5kaHiYcPNQEkI7mgM8YuG0ka/0LiqEQMef1aoGh5EGA8P\r\n" -"hYvai0Re4hjGYi/HZo36Xdh98yeJKQHFkA4/J/EwyEoO79bex8cna8cFPXrEAjya\r\n" -"HT4P6DSYW8tzS1KW2BGiLICIaTla0w+w3lkvEcf36hIBMJcCAwEAAaNNMEswCQYD\r\n" -"VR0TBAIwADAdBgNVHQ4EFgQUpQXoZLjc32APUBJNYKhkr02LQ5MwHwYDVR0jBBgw\r\n" -"FoAUtFrkpbPe0lL2udWmlQ/rPrzH/f8wDQYJKoZIhvcNAQEFBQADggEBAAFzC0rF\r\n" -"y6De8WMcdgQrEw3AhBHFjzqnxZw1ene4IBSC7lTw8rBSy3jOWQdPUWn+0y/pCeeF\r\n" -"kti6sevFdl1hLemGtd4q+T9TKEKGg3ND4ARfB5AUZZ9uEHq8WBkiwus5clGS17Qd\r\n" -"dS/TOisB59tQruLx1E1bPLtBKyqk4koC5WAULJwfpswGSyWJTpYwIpxcWE3D2tBu\r\n" -"UB6MZfXZFzWmWEOyKbeoXjXe8GBCGgHLywvYDsGQ36HSGtEsAvR2QaTLSxWYcfk1\r\n" -"fbDn4jSWkb4yZy1r01UEigFQtONieGwRFaUqEcFJHJvEEGVgh9keaVlOj2vrwf5r\r\n" -"4mN4lW7gLdenN6g=\r\n" -"-----END CERTIFICATE-----\r\n"; -const size_t mbedtls_test_srv_crt_rsa_len = sizeof( mbedtls_test_srv_crt_rsa ); - -/* tests/data_files/server2.key */ -const char mbedtls_test_srv_key_rsa[] = -"-----BEGIN RSA PRIVATE KEY-----\r\n" -"MIIEpAIBAAKCAQEAwU2j3efNHdEE10lyuJmsDnjkOjxKzzoTFtBa5M2jAIin7h5r\r\n" -"lqdStJDvLXJ6PiSa/LY0rCT1d+AmZIycsCh9odrqjObJHJa8/sEEUrM21KP64bF2\r\n" -"2JDBYbRmUjaiJlOqq3ReB30Zgtsq2B+g2Q0cLUlm91slc0boC4pPaQy1AJDh2oIQ\r\n" -"Zn2uVCuLZXmRoeJhw81ASQjuaAzxi4bSRr/QuKoRAx5/VqgaHkQYDw+Fi9qLRF7i\r\n" -"GMZiL8dmjfpd2H3zJ4kpAcWQDj8n8TDISg7v1t7HxydrxwU9esQCPJodPg/oNJhb\r\n" -"y3NLUpbYEaIsgIhpOVrTD7DeWS8Rx/fqEgEwlwIDAQABAoIBAQCXR0S8EIHFGORZ\r\n" -"++AtOg6eENxD+xVs0f1IeGz57Tjo3QnXX7VBZNdj+p1ECvhCE/G7XnkgU5hLZX+G\r\n" -"Z0jkz/tqJOI0vRSdLBbipHnWouyBQ4e/A1yIJdlBtqXxJ1KE/ituHRbNc4j4kL8Z\r\n" -"/r6pvwnTI0PSx2Eqs048YdS92LT6qAv4flbNDxMn2uY7s4ycS4Q8w1JXnCeaAnYm\r\n" -"WYI5wxO+bvRELR2Mcz5DmVnL8jRyml6l6582bSv5oufReFIbyPZbQWlXgYnpu6He\r\n" -"GTc7E1zKYQGG/9+DQUl/1vQuCPqQwny0tQoX2w5tdYpdMdVm+zkLtbajzdTviJJa\r\n" -"TWzL6lt5AoGBAN86+SVeJDcmQJcv4Eq6UhtRr4QGMiQMz0Sod6ettYxYzMgxtw28\r\n" -"CIrgpozCc+UaZJLo7UxvC6an85r1b2nKPCLQFaggJ0H4Q0J/sZOhBIXaoBzWxveK\r\n" -"nupceKdVxGsFi8CDy86DBfiyFivfBj+47BbaQzPBj7C4rK7UlLjab2rDAoGBAN2u\r\n" -"AM2gchoFiu4v1HFL8D7lweEpi6ZnMJjnEu/dEgGQJFjwdpLnPbsj4c75odQ4Gz8g\r\n" -"sw9lao9VVzbusoRE/JGI4aTdO0pATXyG7eG1Qu+5Yc1YGXcCrliA2xM9xx+d7f+s\r\n" -"mPzN+WIEg5GJDYZDjAzHG5BNvi/FfM1C9dOtjv2dAoGAF0t5KmwbjWHBhcVqO4Ic\r\n" -"BVvN3BIlc1ue2YRXEDlxY5b0r8N4XceMgKmW18OHApZxfl8uPDauWZLXOgl4uepv\r\n" -"whZC3EuWrSyyICNhLY21Ah7hbIEBPF3L3ZsOwC+UErL+dXWLdB56Jgy3gZaBeW7b\r\n" -"vDrEnocJbqCm7IukhXHOBK8CgYEAwqdHB0hqyNSzIOGY7v9abzB6pUdA3BZiQvEs\r\n" -"3LjHVd4HPJ2x0N8CgrBIWOE0q8+0hSMmeE96WW/7jD3fPWwCR5zlXknxBQsfv0gP\r\n" -"3BC5PR0Qdypz+d+9zfMf625kyit4T/hzwhDveZUzHnk1Cf+IG7Q+TOEnLnWAWBED\r\n" -"ISOWmrUCgYAFEmRxgwAc/u+D6t0syCwAYh6POtscq9Y0i9GyWk89NzgC4NdwwbBH\r\n" -"4AgahOxIxXx2gxJnq3yfkJfIjwf0s2DyP0kY2y6Ua1OeomPeY9mrIS4tCuDQ6LrE\r\n" -"TB6l9VGoxJL4fyHnZb8L5gGvnB1bbD8cL6YPaDiOhcRseC9vBiEuVg==\r\n" -"-----END RSA PRIVATE KEY-----\r\n"; -const size_t mbedtls_test_srv_key_rsa_len = sizeof( mbedtls_test_srv_key_rsa ); - -/* tests/data_files/cli-rsa-sha256.crt */ -const char mbedtls_test_cli_crt_rsa[] = -"-----BEGIN CERTIFICATE-----\r\n" -"MIIDPzCCAiegAwIBAgIBBDANBgkqhkiG9w0BAQsFADA7MQswCQYDVQQGEwJOTDER\r\n" -"MA8GA1UECgwIUG9sYXJTU0wxGTAXBgNVBAMMEFBvbGFyU1NMIFRlc3QgQ0EwHhcN\r\n" -"MTEwMjEyMTQ0NDA2WhcNMjEwMjEyMTQ0NDA2WjA8MQswCQYDVQQGEwJOTDERMA8G\r\n" -"A1UECgwIUG9sYXJTU0wxGjAYBgNVBAMMEVBvbGFyU1NMIENsaWVudCAyMIIBIjAN\r\n" -"BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyHTEzLn5tXnpRdkUYLB9u5Pyax6f\r\n" -"M60Nj4o8VmXl3ETZzGaFB9X4J7BKNdBjngpuG7fa8H6r7gwQk4ZJGDTzqCrSV/Uu\r\n" -"1C93KYRhTYJQj6eVSHD1bk2y1RPD0hrt5kPqQhTrdOrA7R/UV06p86jt0uDBMHEw\r\n" -"MjDV0/YI0FZPRo7yX/k9Z5GIMC5Cst99++UMd//sMcB4j7/Cf8qtbCHWjdmLao5v\r\n" -"4Jv4EFbMs44TFeY0BGbH7vk2DmqV9gmaBmf0ZXH4yqSxJeD+PIs1BGe64E92hfx/\r\n" -"/DZrtenNLQNiTrM9AM+vdqBpVoNq0qjU51Bx5rU2BXcFbXvI5MT9TNUhXwIDAQAB\r\n" -"o00wSzAJBgNVHRMEAjAAMB0GA1UdDgQWBBRxoQBzckAvVHZeM/xSj7zx3WtGITAf\r\n" -"BgNVHSMEGDAWgBS0WuSls97SUva51aaVD+s+vMf9/zANBgkqhkiG9w0BAQsFAAOC\r\n" -"AQEAlHabem2Tu69VUN7EipwnQn1dIHdgvT5i+iQHpSxY1crPnBbAeSdAXwsVEqLQ\r\n" -"gOOIAQD5VIITNuoGgo4i+4OpNh9u7ZkpRHla+/swsfrFWRRbBNP5Bcu74AGLstwU\r\n" -"zM8gIkBiyfM1Q1qDQISV9trlCG6O8vh8dp/rbI3rfzo99BOHXgFCrzXjCuW4vDsF\r\n" -"r+Dao26bX3sJ6UnEWg1H3o2x6PpUcvQ36h71/bz4TEbbUUEpe02V4QWuL+wrhHJL\r\n" -"U7o3SVE3Og7jPF8sat0a50YUWhwEFI256m02KAXLg89ueUyYKEr6rNwhcvXJpvU9\r\n" -"giIVvd0Sbjjnn7NC4VDbcXV8vw==\r\n" -"-----END CERTIFICATE-----\r\n"; -const size_t mbedtls_test_cli_crt_rsa_len = sizeof( mbedtls_test_cli_crt_rsa ); - -/* tests/data_files/cli-rsa.key */ -const char mbedtls_test_cli_key_rsa[] = -"-----BEGIN RSA PRIVATE KEY-----\r\n" -"MIIEpAIBAAKCAQEAyHTEzLn5tXnpRdkUYLB9u5Pyax6fM60Nj4o8VmXl3ETZzGaF\r\n" -"B9X4J7BKNdBjngpuG7fa8H6r7gwQk4ZJGDTzqCrSV/Uu1C93KYRhTYJQj6eVSHD1\r\n" -"bk2y1RPD0hrt5kPqQhTrdOrA7R/UV06p86jt0uDBMHEwMjDV0/YI0FZPRo7yX/k9\r\n" -"Z5GIMC5Cst99++UMd//sMcB4j7/Cf8qtbCHWjdmLao5v4Jv4EFbMs44TFeY0BGbH\r\n" -"7vk2DmqV9gmaBmf0ZXH4yqSxJeD+PIs1BGe64E92hfx//DZrtenNLQNiTrM9AM+v\r\n" -"dqBpVoNq0qjU51Bx5rU2BXcFbXvI5MT9TNUhXwIDAQABAoIBAGdNtfYDiap6bzst\r\n" -"yhCiI8m9TtrhZw4MisaEaN/ll3XSjaOG2dvV6xMZCMV+5TeXDHOAZnY18Yi18vzz\r\n" -"4Ut2TnNFzizCECYNaA2fST3WgInnxUkV3YXAyP6CNxJaCmv2aA0yFr2kFVSeaKGt\r\n" -"ymvljNp2NVkvm7Th8fBQBO7I7AXhz43k0mR7XmPgewe8ApZOG3hstkOaMvbWAvWA\r\n" -"zCZupdDjZYjOJqlA4eEA4H8/w7F83r5CugeBE8LgEREjLPiyejrU5H1fubEY+h0d\r\n" -"l5HZBJ68ybTXfQ5U9o/QKA3dd0toBEhhdRUDGzWtjvwkEQfqF1reGWj/tod/gCpf\r\n" -"DFi6X0ECgYEA4wOv/pjSC3ty6TuOvKX2rOUiBrLXXv2JSxZnMoMiWI5ipLQt+RYT\r\n" -"VPafL/m7Dn6MbwjayOkcZhBwk5CNz5A6Q4lJ64Mq/lqHznRCQQ2Mc1G8eyDF/fYL\r\n" -"Ze2pLvwP9VD5jTc2miDfw+MnvJhywRRLcemDFP8k4hQVtm8PMp3ZmNECgYEA4gz7\r\n" -"wzObR4gn8ibe617uQPZjWzUj9dUHYd+in1gwBCIrtNnaRn9I9U/Q6tegRYpii4ys\r\n" -"c176NmU+umy6XmuSKV5qD9bSpZWG2nLFnslrN15Lm3fhZxoeMNhBaEDTnLT26yoi\r\n" -"33gp0mSSWy94ZEqipms+ULF6sY1ZtFW6tpGFoy8CgYAQHhnnvJflIs2ky4q10B60\r\n" -"ZcxFp3rtDpkp0JxhFLhiizFrujMtZSjYNm5U7KkgPVHhLELEUvCmOnKTt4ap/vZ0\r\n" -"BxJNe1GZH3pW6SAvGDQpl9sG7uu/vTFP+lCxukmzxB0DrrDcvorEkKMom7ZCCRvW\r\n" -"KZsZ6YeH2Z81BauRj218kQKBgQCUV/DgKP2985xDTT79N08jUo3hTP5MVYCCuj/+\r\n" -"UeEw1TvZcx3LJby7P6Xad6a1/BqveaGyFKIfEFIaBUBItk801sDDpDaYc4gL00Xc\r\n" -"7lFuBHOZkxJYlss5QrGpuOEl9ZwUt5IrFLBdYaKqNHzNVC1pCPfb/JyH6Dr2HUxq\r\n" -"gxUwAQKBgQCcU6G2L8AG9d9c0UpOyL1tMvFe5Ttw0KjlQVdsh1MP6yigYo9DYuwu\r\n" -"bHFVW2r0dBTqegP2/KTOxKzaHfC1qf0RGDsUoJCNJrd1cwoCLG8P2EF4w3OBrKqv\r\n" -"8u4ytY0F+Vlanj5lm3TaoHSVF1+NWPyOTiwevIECGKwSxvlki4fDAA==\r\n" -"-----END RSA PRIVATE KEY-----\r\n"; -const size_t mbedtls_test_cli_key_rsa_len = sizeof( mbedtls_test_cli_key_rsa ); #endif /* MBEDTLS_RSA_C */ -#if defined(MBEDTLS_PEM_PARSE_C) -/* Concatenation of all available CA certificates */ -const char mbedtls_test_cas_pem[] = -#ifdef TEST_CA_CRT_RSA_SHA1 - TEST_CA_CRT_RSA_SHA1 -#endif -#ifdef TEST_CA_CRT_RSA_SHA256 - TEST_CA_CRT_RSA_SHA256 -#endif -#ifdef TEST_CA_CRT_EC - TEST_CA_CRT_EC -#endif - ""; -const size_t mbedtls_test_cas_pem_len = sizeof( mbedtls_test_cas_pem ); -#endif +/* API stability forces us to declare + * mbedtls_test_{ca|srv|cli}_{key|pwd|crt} + * as pointers. */ +static const char test_ca_key[] = TEST_CA_KEY; +static const char test_ca_pwd[] = TEST_CA_PWD; +static const char test_ca_crt[] = TEST_CA_CRT; + +static const char test_srv_key[] = TEST_SRV_KEY; +static const char test_srv_pwd[] = TEST_SRV_PWD; +static const char test_srv_crt[] = TEST_SRV_CRT; + +static const char test_cli_key[] = TEST_CLI_KEY; +static const char test_cli_pwd[] = TEST_CLI_PWD; +static const char test_cli_crt[] = TEST_CLI_CRT; + +const char *mbedtls_test_ca_key = test_ca_key; +const char *mbedtls_test_ca_pwd = test_ca_pwd; +const char *mbedtls_test_ca_crt = test_ca_crt; + +const char *mbedtls_test_srv_key = test_srv_key; +const char *mbedtls_test_srv_pwd = test_srv_pwd; +const char *mbedtls_test_srv_crt = test_srv_crt; + +const char *mbedtls_test_cli_key = test_cli_key; +const char *mbedtls_test_cli_pwd = test_cli_pwd; +const char *mbedtls_test_cli_crt = test_cli_crt; + +const size_t mbedtls_test_ca_key_len = + sizeof( test_ca_key ); +const size_t mbedtls_test_ca_pwd_len = + sizeof( test_ca_pwd ) - 1; +const size_t mbedtls_test_ca_crt_len = + sizeof( test_ca_crt ); -/* List of all available CA certificates */ +const size_t mbedtls_test_srv_key_len = + sizeof( test_srv_key ); +const size_t mbedtls_test_srv_pwd_len = + sizeof( test_srv_pwd ) - 1; +const size_t mbedtls_test_srv_crt_len = + sizeof( test_srv_crt ); + +const size_t mbedtls_test_cli_key_len = + sizeof( test_cli_key ); +const size_t mbedtls_test_cli_pwd_len = + sizeof( test_cli_pwd ) - 1; +const size_t mbedtls_test_cli_crt_len = + sizeof( test_cli_crt ); + +/* + * + * Lists of certificates + * + */ + +/* List of CAs in PEM or DER, depending on config */ const char * mbedtls_test_cas[] = { -#if defined(TEST_CA_CRT_RSA_SHA1) +#if defined(MBEDTLS_RSA_C) && defined(MBEDTLS_SHA1_C) mbedtls_test_ca_crt_rsa_sha1, #endif -#if defined(TEST_CA_CRT_RSA_SHA256) +#if defined(MBEDTLS_RSA_C) && defined(MBEDTLS_SHA256_C) mbedtls_test_ca_crt_rsa_sha256, #endif #if defined(MBEDTLS_ECDSA_C) @@ -359,10 +1704,10 @@ const char * mbedtls_test_cas[] = { NULL }; const size_t mbedtls_test_cas_len[] = { -#if defined(TEST_CA_CRT_RSA_SHA1) +#if defined(MBEDTLS_RSA_C) && defined(MBEDTLS_SHA1_C) sizeof( mbedtls_test_ca_crt_rsa_sha1 ), #endif -#if defined(TEST_CA_CRT_RSA_SHA256) +#if defined(MBEDTLS_RSA_C) && defined(MBEDTLS_SHA256_C) sizeof( mbedtls_test_ca_crt_rsa_sha256 ), #endif #if defined(MBEDTLS_ECDSA_C) @@ -371,36 +1716,53 @@ const size_t mbedtls_test_cas_len[] = { 0 }; +/* List of all available CA certificates in DER format */ +const unsigned char * mbedtls_test_cas_der[] = { #if defined(MBEDTLS_RSA_C) -const char *mbedtls_test_ca_crt = mbedtls_test_ca_crt_rsa; /* SHA1 or SHA256 */ -const char *mbedtls_test_ca_key = mbedtls_test_ca_key_rsa; -const char *mbedtls_test_ca_pwd = mbedtls_test_ca_pwd_rsa; -const char *mbedtls_test_srv_crt = mbedtls_test_srv_crt_rsa; -const char *mbedtls_test_srv_key = mbedtls_test_srv_key_rsa; -const char *mbedtls_test_cli_crt = mbedtls_test_cli_crt_rsa; -const char *mbedtls_test_cli_key = mbedtls_test_cli_key_rsa; -const size_t mbedtls_test_ca_crt_len = sizeof( mbedtls_test_ca_crt_rsa ); -const size_t mbedtls_test_ca_key_len = sizeof( mbedtls_test_ca_key_rsa ); -const size_t mbedtls_test_ca_pwd_len = sizeof( mbedtls_test_ca_pwd_rsa ) - 1; -const size_t mbedtls_test_srv_crt_len = sizeof( mbedtls_test_srv_crt_rsa ); -const size_t mbedtls_test_srv_key_len = sizeof( mbedtls_test_srv_key_rsa ); -const size_t mbedtls_test_cli_crt_len = sizeof( mbedtls_test_cli_crt_rsa ); -const size_t mbedtls_test_cli_key_len = sizeof( mbedtls_test_cli_key_rsa ); -#else /* ! MBEDTLS_RSA_C, so MBEDTLS_ECDSA_C */ -const char *mbedtls_test_ca_crt = mbedtls_test_ca_crt_ec; -const char *mbedtls_test_ca_key = mbedtls_test_ca_key_ec; -const char *mbedtls_test_ca_pwd = mbedtls_test_ca_pwd_ec; -const char *mbedtls_test_srv_crt = mbedtls_test_srv_crt_ec; -const char *mbedtls_test_srv_key = mbedtls_test_srv_key_ec; -const char *mbedtls_test_cli_crt = mbedtls_test_cli_crt_ec; -const char *mbedtls_test_cli_key = mbedtls_test_cli_key_ec; -const size_t mbedtls_test_ca_crt_len = sizeof( mbedtls_test_ca_crt_ec ); -const size_t mbedtls_test_ca_key_len = sizeof( mbedtls_test_ca_key_ec ); -const size_t mbedtls_test_ca_pwd_len = sizeof( mbedtls_test_ca_pwd_ec ) - 1; -const size_t mbedtls_test_srv_crt_len = sizeof( mbedtls_test_srv_crt_ec ); -const size_t mbedtls_test_srv_key_len = sizeof( mbedtls_test_srv_key_ec ); -const size_t mbedtls_test_cli_crt_len = sizeof( mbedtls_test_cli_crt_ec ); -const size_t mbedtls_test_cli_key_len = sizeof( mbedtls_test_cli_key_ec ); +#if defined(MBEDTLS_SHA256_C) + mbedtls_test_ca_crt_rsa_sha256_der, +#endif /* MBEDTLS_SHA256_C */ +#if defined(MBEDTLS_SHA1_C) + mbedtls_test_ca_crt_rsa_sha1_der, +#endif /* MBEDTLS_SHA1_C */ #endif /* MBEDTLS_RSA_C */ +#if defined(MBEDTLS_ECDSA_C) + mbedtls_test_ca_crt_ec_der, +#endif /* MBEDTLS_ECDSA_C */ + NULL +}; + +const size_t mbedtls_test_cas_der_len[] = { +#if defined(MBEDTLS_RSA_C) +#if defined(MBEDTLS_SHA256_C) + sizeof( mbedtls_test_ca_crt_rsa_sha256_der ), +#endif /* MBEDTLS_SHA256_C */ +#if defined(MBEDTLS_SHA1_C) + sizeof( mbedtls_test_ca_crt_rsa_sha1_der ), +#endif /* MBEDTLS_SHA1_C */ +#endif /* MBEDTLS_RSA_C */ +#if defined(MBEDTLS_ECDSA_C) + sizeof( mbedtls_test_ca_crt_ec_der ), +#endif /* MBEDTLS_ECDSA_C */ + 0 +}; + +/* Concatenation of all available CA certificates in PEM format */ +#if defined(MBEDTLS_PEM_PARSE_C) +const char mbedtls_test_cas_pem[] = +#if defined(MBEDTLS_RSA_C) +#if defined(MBEDTLS_SHA256_C) + TEST_CA_CRT_RSA_SHA256_PEM +#endif /* MBEDTLS_SHA256_C */ +#if defined(MBEDTLS_SHA1_C) + TEST_CA_CRT_RSA_SHA1_PEM +#endif /* MBEDTLS_SHA1_C */ +#endif /* MBEDTLS_RSA_C */ +#if defined(MBEDTLS_ECDSA_C) + TEST_CA_CRT_EC_PEM +#endif /* MBEDTLS_ECDSA_C */ + ""; +const size_t mbedtls_test_cas_pem_len = sizeof( mbedtls_test_cas_pem ); +#endif /* MBEDTLS_PEM_PARSE_C */ #endif /* MBEDTLS_CERTS_C */ diff --git a/thirdparty/mbedtls/library/chacha20.c b/thirdparty/mbedtls/library/chacha20.c index 0757163e2f..8a3610f0e0 100644 --- a/thirdparty/mbedtls/library/chacha20.c +++ b/thirdparty/mbedtls/library/chacha20.c @@ -60,14 +60,14 @@ MBEDTLS_INTERNAL_VALIDATE( cond ) #define BYTES_TO_U32_LE( data, offset ) \ - ( (uint32_t) data[offset] \ - | (uint32_t) ( (uint32_t) data[( offset ) + 1] << 8 ) \ - | (uint32_t) ( (uint32_t) data[( offset ) + 2] << 16 ) \ - | (uint32_t) ( (uint32_t) data[( offset ) + 3] << 24 ) \ + ( (uint32_t) (data)[offset] \ + | (uint32_t) ( (uint32_t) (data)[( offset ) + 1] << 8 ) \ + | (uint32_t) ( (uint32_t) (data)[( offset ) + 2] << 16 ) \ + | (uint32_t) ( (uint32_t) (data)[( offset ) + 3] << 24 ) \ ) #define ROTL32( value, amount ) \ - ( (uint32_t) ( value << amount ) | ( value >> ( 32 - amount ) ) ) + ( (uint32_t) ( (value) << (amount) ) | ( (value) >> ( 32 - (amount) ) ) ) #define CHACHA20_CTR_INDEX ( 12U ) diff --git a/thirdparty/mbedtls/library/debug.c b/thirdparty/mbedtls/library/debug.c index 824cd0236e..36510cdd56 100644 --- a/thirdparty/mbedtls/library/debug.c +++ b/thirdparty/mbedtls/library/debug.c @@ -86,8 +86,13 @@ void mbedtls_debug_print_msg( const mbedtls_ssl_context *ssl, int level, char str[DEBUG_BUF_SIZE]; int ret; - if( NULL == ssl || NULL == ssl->conf || NULL == ssl->conf->f_dbg || level > debug_threshold ) + if( NULL == ssl || + NULL == ssl->conf || + NULL == ssl->conf->f_dbg || + level > debug_threshold ) + { return; + } va_start( argp, format ); #if defined(_WIN32) @@ -121,8 +126,13 @@ void mbedtls_debug_print_ret( const mbedtls_ssl_context *ssl, int level, { char str[DEBUG_BUF_SIZE]; - if( ssl->conf == NULL || ssl->conf->f_dbg == NULL || level > debug_threshold ) + if( NULL == ssl || + NULL == ssl->conf || + NULL == ssl->conf->f_dbg || + level > debug_threshold ) + { return; + } /* * With non-blocking I/O and examples that just retry immediately, @@ -146,8 +156,13 @@ void mbedtls_debug_print_buf( const mbedtls_ssl_context *ssl, int level, char txt[17]; size_t i, idx = 0; - if( ssl->conf == NULL || ssl->conf->f_dbg == NULL || level > debug_threshold ) + if( NULL == ssl || + NULL == ssl->conf || + NULL == ssl->conf->f_dbg || + level > debug_threshold ) + { return; + } mbedtls_snprintf( str + idx, sizeof( str ) - idx, "dumping '%s' (%u bytes)\n", text, (unsigned int) len ); @@ -199,8 +214,13 @@ void mbedtls_debug_print_ecp( const mbedtls_ssl_context *ssl, int level, { char str[DEBUG_BUF_SIZE]; - if( ssl->conf == NULL || ssl->conf->f_dbg == NULL || level > debug_threshold ) + if( NULL == ssl || + NULL == ssl->conf || + NULL == ssl->conf->f_dbg || + level > debug_threshold ) + { return; + } mbedtls_snprintf( str, sizeof( str ), "%s(X)", text ); mbedtls_debug_print_mpi( ssl, level, file, line, str, &X->X ); @@ -219,8 +239,14 @@ void mbedtls_debug_print_mpi( const mbedtls_ssl_context *ssl, int level, int j, k, zeros = 1; size_t i, n, idx = 0; - if( ssl->conf == NULL || ssl->conf->f_dbg == NULL || X == NULL || level > debug_threshold ) + if( NULL == ssl || + NULL == ssl->conf || + NULL == ssl->conf->f_dbg || + NULL == X || + level > debug_threshold ) + { return; + } for( n = X->n - 1; n > 0; n-- ) if( X->p[n] != 0 ) @@ -345,8 +371,14 @@ void mbedtls_debug_print_crt( const mbedtls_ssl_context *ssl, int level, char str[DEBUG_BUF_SIZE]; int i = 0; - if( ssl->conf == NULL || ssl->conf->f_dbg == NULL || crt == NULL || level > debug_threshold ) + if( NULL == ssl || + NULL == ssl->conf || + NULL == ssl->conf->f_dbg || + NULL == crt || + level > debug_threshold ) + { return; + } while( crt != NULL ) { diff --git a/thirdparty/mbedtls/library/des.c b/thirdparty/mbedtls/library/des.c index ca9e071f32..8a33d82e50 100644 --- a/thirdparty/mbedtls/library/des.c +++ b/thirdparty/mbedtls/library/des.c @@ -257,50 +257,57 @@ static const uint32_t RHs[16] = /* * Initial Permutation macro */ -#define DES_IP(X,Y) \ -{ \ - T = ((X >> 4) ^ Y) & 0x0F0F0F0F; Y ^= T; X ^= (T << 4); \ - T = ((X >> 16) ^ Y) & 0x0000FFFF; Y ^= T; X ^= (T << 16); \ - T = ((Y >> 2) ^ X) & 0x33333333; X ^= T; Y ^= (T << 2); \ - T = ((Y >> 8) ^ X) & 0x00FF00FF; X ^= T; Y ^= (T << 8); \ - Y = ((Y << 1) | (Y >> 31)) & 0xFFFFFFFF; \ - T = (X ^ Y) & 0xAAAAAAAA; Y ^= T; X ^= T; \ - X = ((X << 1) | (X >> 31)) & 0xFFFFFFFF; \ -} +#define DES_IP(X,Y) \ + do \ + { \ + T = (((X) >> 4) ^ (Y)) & 0x0F0F0F0F; (Y) ^= T; (X) ^= (T << 4); \ + T = (((X) >> 16) ^ (Y)) & 0x0000FFFF; (Y) ^= T; (X) ^= (T << 16); \ + T = (((Y) >> 2) ^ (X)) & 0x33333333; (X) ^= T; (Y) ^= (T << 2); \ + T = (((Y) >> 8) ^ (X)) & 0x00FF00FF; (X) ^= T; (Y) ^= (T << 8); \ + (Y) = (((Y) << 1) | ((Y) >> 31)) & 0xFFFFFFFF; \ + T = ((X) ^ (Y)) & 0xAAAAAAAA; (Y) ^= T; (X) ^= T; \ + (X) = (((X) << 1) | ((X) >> 31)) & 0xFFFFFFFF; \ + } while( 0 ) /* * Final Permutation macro */ -#define DES_FP(X,Y) \ -{ \ - X = ((X << 31) | (X >> 1)) & 0xFFFFFFFF; \ - T = (X ^ Y) & 0xAAAAAAAA; X ^= T; Y ^= T; \ - Y = ((Y << 31) | (Y >> 1)) & 0xFFFFFFFF; \ - T = ((Y >> 8) ^ X) & 0x00FF00FF; X ^= T; Y ^= (T << 8); \ - T = ((Y >> 2) ^ X) & 0x33333333; X ^= T; Y ^= (T << 2); \ - T = ((X >> 16) ^ Y) & 0x0000FFFF; Y ^= T; X ^= (T << 16); \ - T = ((X >> 4) ^ Y) & 0x0F0F0F0F; Y ^= T; X ^= (T << 4); \ -} +#define DES_FP(X,Y) \ + do \ + { \ + (X) = (((X) << 31) | ((X) >> 1)) & 0xFFFFFFFF; \ + T = ((X) ^ (Y)) & 0xAAAAAAAA; (X) ^= T; (Y) ^= T; \ + (Y) = (((Y) << 31) | ((Y) >> 1)) & 0xFFFFFFFF; \ + T = (((Y) >> 8) ^ (X)) & 0x00FF00FF; (X) ^= T; (Y) ^= (T << 8); \ + T = (((Y) >> 2) ^ (X)) & 0x33333333; (X) ^= T; (Y) ^= (T << 2); \ + T = (((X) >> 16) ^ (Y)) & 0x0000FFFF; (Y) ^= T; (X) ^= (T << 16); \ + T = (((X) >> 4) ^ (Y)) & 0x0F0F0F0F; (Y) ^= T; (X) ^= (T << 4); \ + } while( 0 ) /* * DES round macro */ -#define DES_ROUND(X,Y) \ -{ \ - T = *SK++ ^ X; \ - Y ^= SB8[ (T ) & 0x3F ] ^ \ - SB6[ (T >> 8) & 0x3F ] ^ \ - SB4[ (T >> 16) & 0x3F ] ^ \ - SB2[ (T >> 24) & 0x3F ]; \ - \ - T = *SK++ ^ ((X << 28) | (X >> 4)); \ - Y ^= SB7[ (T ) & 0x3F ] ^ \ - SB5[ (T >> 8) & 0x3F ] ^ \ - SB3[ (T >> 16) & 0x3F ] ^ \ - SB1[ (T >> 24) & 0x3F ]; \ -} - -#define SWAP(a,b) { uint32_t t = a; a = b; b = t; t = 0; } +#define DES_ROUND(X,Y) \ + do \ + { \ + T = *SK++ ^ (X); \ + (Y) ^= SB8[ (T ) & 0x3F ] ^ \ + SB6[ (T >> 8) & 0x3F ] ^ \ + SB4[ (T >> 16) & 0x3F ] ^ \ + SB2[ (T >> 24) & 0x3F ]; \ + \ + T = *SK++ ^ (((X) << 28) | ((X) >> 4)); \ + (Y) ^= SB7[ (T ) & 0x3F ] ^ \ + SB5[ (T >> 8) & 0x3F ] ^ \ + SB3[ (T >> 16) & 0x3F ] ^ \ + SB1[ (T >> 24) & 0x3F ]; \ + } while( 0 ) + +#define SWAP(a,b) \ + do \ + { \ + uint32_t t = (a); (a) = (b); (b) = t; t = 0; \ + } while( 0 ) void mbedtls_des_init( mbedtls_des_context *ctx ) { diff --git a/thirdparty/mbedtls/library/dhm.c b/thirdparty/mbedtls/library/dhm.c index fb6937e854..8255632a99 100644 --- a/thirdparty/mbedtls/library/dhm.c +++ b/thirdparty/mbedtls/library/dhm.c @@ -649,12 +649,28 @@ int mbedtls_dhm_parse_dhmfile( mbedtls_dhm_context *dhm, const char *path ) #if defined(MBEDTLS_SELF_TEST) +#if defined(MBEDTLS_PEM_PARSE_C) static const char mbedtls_test_dhm_params[] = "-----BEGIN DH PARAMETERS-----\r\n" "MIGHAoGBAJ419DBEOgmQTzo5qXl5fQcN9TN455wkOL7052HzxxRVMyhYmwQcgJvh\r\n" "1sa18fyfR9OiVEMYglOpkqVoGLN7qd5aQNNi5W7/C+VBdHTBJcGZJyyP5B3qcz32\r\n" "9mLJKudlVudV0Qxk5qUJaPZ/xupz0NyoVpviuiBOI1gNi8ovSXWzAgEC\r\n" "-----END DH PARAMETERS-----\r\n"; +#else /* MBEDTLS_PEM_PARSE_C */ +static const char mbedtls_test_dhm_params[] = { + 0x30, 0x81, 0x87, 0x02, 0x81, 0x81, 0x00, 0x9e, 0x35, 0xf4, 0x30, 0x44, + 0x3a, 0x09, 0x90, 0x4f, 0x3a, 0x39, 0xa9, 0x79, 0x79, 0x7d, 0x07, 0x0d, + 0xf5, 0x33, 0x78, 0xe7, 0x9c, 0x24, 0x38, 0xbe, 0xf4, 0xe7, 0x61, 0xf3, + 0xc7, 0x14, 0x55, 0x33, 0x28, 0x58, 0x9b, 0x04, 0x1c, 0x80, 0x9b, 0xe1, + 0xd6, 0xc6, 0xb5, 0xf1, 0xfc, 0x9f, 0x47, 0xd3, 0xa2, 0x54, 0x43, 0x18, + 0x82, 0x53, 0xa9, 0x92, 0xa5, 0x68, 0x18, 0xb3, 0x7b, 0xa9, 0xde, 0x5a, + 0x40, 0xd3, 0x62, 0xe5, 0x6e, 0xff, 0x0b, 0xe5, 0x41, 0x74, 0x74, 0xc1, + 0x25, 0xc1, 0x99, 0x27, 0x2c, 0x8f, 0xe4, 0x1d, 0xea, 0x73, 0x3d, 0xf6, + 0xf6, 0x62, 0xc9, 0x2a, 0xe7, 0x65, 0x56, 0xe7, 0x55, 0xd1, 0x0c, 0x64, + 0xe6, 0xa5, 0x09, 0x68, 0xf6, 0x7f, 0xc6, 0xea, 0x73, 0xd0, 0xdc, 0xa8, + 0x56, 0x9b, 0xe2, 0xba, 0x20, 0x4e, 0x23, 0x58, 0x0d, 0x8b, 0xca, 0x2f, + 0x49, 0x75, 0xb3, 0x02, 0x01, 0x02 }; +#endif /* MBEDTLS_PEM_PARSE_C */ static const size_t mbedtls_test_dhm_params_len = sizeof( mbedtls_test_dhm_params ); diff --git a/thirdparty/mbedtls/library/ecdh.c b/thirdparty/mbedtls/library/ecdh.c index da95c60dad..c5726877d5 100644 --- a/thirdparty/mbedtls/library/ecdh.c +++ b/thirdparty/mbedtls/library/ecdh.c @@ -49,6 +49,16 @@ typedef mbedtls_ecdh_context mbedtls_ecdh_context_mbed; #endif +static mbedtls_ecp_group_id mbedtls_ecdh_grp_id( + const mbedtls_ecdh_context *ctx ) +{ +#if defined(MBEDTLS_ECDH_LEGACY_CONTEXT) + return( ctx->grp.id ); +#else + return( ctx->grp_id ); +#endif +} + #if !defined(MBEDTLS_ECDH_GEN_PUBLIC_ALT) /* * Generate public key (restartable version) @@ -442,8 +452,21 @@ int mbedtls_ecdh_get_params( mbedtls_ecdh_context *ctx, ECDH_VALIDATE_RET( side == MBEDTLS_ECDH_OURS || side == MBEDTLS_ECDH_THEIRS ); - if( ( ret = mbedtls_ecdh_setup( ctx, key->grp.id ) ) != 0 ) - return( ret ); + if( mbedtls_ecdh_grp_id( ctx ) == MBEDTLS_ECP_DP_NONE ) + { + /* This is the first call to get_params(). Set up the context + * for use with the group. */ + if( ( ret = mbedtls_ecdh_setup( ctx, key->grp.id ) ) != 0 ) + return( ret ); + } + else + { + /* This is not the first call to get_params(). Check that the + * current key's group is the same as the context's, which was set + * from the first key's group. */ + if( mbedtls_ecdh_grp_id( ctx ) != key->grp.id ) + return( MBEDTLS_ERR_ECP_BAD_INPUT_DATA ); + } #if defined(MBEDTLS_ECDH_LEGACY_CONTEXT) return( ecdh_get_params_internal( ctx, key, side ) ); diff --git a/thirdparty/mbedtls/library/ecdsa.c b/thirdparty/mbedtls/library/ecdsa.c index 1204ef9949..dc19384d61 100644 --- a/thirdparty/mbedtls/library/ecdsa.c +++ b/thirdparty/mbedtls/library/ecdsa.c @@ -800,11 +800,16 @@ cleanup: int mbedtls_ecdsa_genkey( mbedtls_ecdsa_context *ctx, mbedtls_ecp_group_id gid, int (*f_rng)(void *, unsigned char *, size_t), void *p_rng ) { + int ret = 0; ECDSA_VALIDATE_RET( ctx != NULL ); ECDSA_VALIDATE_RET( f_rng != NULL ); - return( mbedtls_ecp_group_load( &ctx->grp, gid ) || - mbedtls_ecp_gen_keypair( &ctx->grp, &ctx->d, &ctx->Q, f_rng, p_rng ) ); + ret = mbedtls_ecp_group_load( &ctx->grp, gid ); + if( ret != 0 ) + return( ret ); + + return( mbedtls_ecp_gen_keypair( &ctx->grp, &ctx->d, + &ctx->Q, f_rng, p_rng ) ); } #endif /* !MBEDTLS_ECDSA_GENKEY_ALT */ diff --git a/thirdparty/mbedtls/library/ecp.c b/thirdparty/mbedtls/library/ecp.c index ecea5910e0..db36191b9b 100644 --- a/thirdparty/mbedtls/library/ecp.c +++ b/thirdparty/mbedtls/library/ecp.c @@ -1046,25 +1046,29 @@ cleanup: #define INC_MUL_COUNT #endif -#define MOD_MUL( N ) do { MBEDTLS_MPI_CHK( ecp_modp( &N, grp ) ); INC_MUL_COUNT } \ - while( 0 ) +#define MOD_MUL( N ) \ + do \ + { \ + MBEDTLS_MPI_CHK( ecp_modp( &(N), grp ) ); \ + INC_MUL_COUNT \ + } while( 0 ) /* * Reduce a mbedtls_mpi mod p in-place, to use after mbedtls_mpi_sub_mpi * N->s < 0 is a very fast test, which fails only if N is 0 */ -#define MOD_SUB( N ) \ - while( N.s < 0 && mbedtls_mpi_cmp_int( &N, 0 ) != 0 ) \ - MBEDTLS_MPI_CHK( mbedtls_mpi_add_mpi( &N, &N, &grp->P ) ) +#define MOD_SUB( N ) \ + while( (N).s < 0 && mbedtls_mpi_cmp_int( &(N), 0 ) != 0 ) \ + MBEDTLS_MPI_CHK( mbedtls_mpi_add_mpi( &(N), &(N), &grp->P ) ) /* * Reduce a mbedtls_mpi mod p in-place, to use after mbedtls_mpi_add_mpi and mbedtls_mpi_mul_int. * We known P, N and the result are positive, so sub_abs is correct, and * a bit faster. */ -#define MOD_ADD( N ) \ - while( mbedtls_mpi_cmp_mpi( &N, &grp->P ) >= 0 ) \ - MBEDTLS_MPI_CHK( mbedtls_mpi_sub_abs( &N, &N, &grp->P ) ) +#define MOD_ADD( N ) \ + while( mbedtls_mpi_cmp_mpi( &(N), &grp->P ) >= 0 ) \ + MBEDTLS_MPI_CHK( mbedtls_mpi_sub_abs( &(N), &(N), &grp->P ) ) #if defined(ECP_SHORTWEIERSTRASS) /* diff --git a/thirdparty/mbedtls/library/ecp_curves.c b/thirdparty/mbedtls/library/ecp_curves.c index 731621dc3c..282481d053 100644 --- a/thirdparty/mbedtls/library/ecp_curves.c +++ b/thirdparty/mbedtls/library/ecp_curves.c @@ -51,11 +51,11 @@ */ #if defined(MBEDTLS_HAVE_INT32) -#define BYTES_TO_T_UINT_4( a, b, c, d ) \ - ( (mbedtls_mpi_uint) a << 0 ) | \ - ( (mbedtls_mpi_uint) b << 8 ) | \ - ( (mbedtls_mpi_uint) c << 16 ) | \ - ( (mbedtls_mpi_uint) d << 24 ) +#define BYTES_TO_T_UINT_4( a, b, c, d ) \ + ( (mbedtls_mpi_uint) (a) << 0 ) | \ + ( (mbedtls_mpi_uint) (b) << 8 ) | \ + ( (mbedtls_mpi_uint) (c) << 16 ) | \ + ( (mbedtls_mpi_uint) (d) << 24 ) #define BYTES_TO_T_UINT_2( a, b ) \ BYTES_TO_T_UINT_4( a, b, 0, 0 ) @@ -67,14 +67,14 @@ #else /* 64-bits */ #define BYTES_TO_T_UINT_8( a, b, c, d, e, f, g, h ) \ - ( (mbedtls_mpi_uint) a << 0 ) | \ - ( (mbedtls_mpi_uint) b << 8 ) | \ - ( (mbedtls_mpi_uint) c << 16 ) | \ - ( (mbedtls_mpi_uint) d << 24 ) | \ - ( (mbedtls_mpi_uint) e << 32 ) | \ - ( (mbedtls_mpi_uint) f << 40 ) | \ - ( (mbedtls_mpi_uint) g << 48 ) | \ - ( (mbedtls_mpi_uint) h << 56 ) + ( (mbedtls_mpi_uint) (a) << 0 ) | \ + ( (mbedtls_mpi_uint) (b) << 8 ) | \ + ( (mbedtls_mpi_uint) (c) << 16 ) | \ + ( (mbedtls_mpi_uint) (d) << 24 ) | \ + ( (mbedtls_mpi_uint) (e) << 32 ) | \ + ( (mbedtls_mpi_uint) (f) << 40 ) | \ + ( (mbedtls_mpi_uint) (g) << 48 ) | \ + ( (mbedtls_mpi_uint) (h) << 56 ) #define BYTES_TO_T_UINT_4( a, b, c, d ) \ BYTES_TO_T_UINT_8( a, b, c, d, 0, 0, 0, 0 ) @@ -890,7 +890,7 @@ static inline void carry64( mbedtls_mpi_uint *dst, mbedtls_mpi_uint *carry ) } #define WIDTH 8 / sizeof( mbedtls_mpi_uint ) -#define A( i ) N->p + i * WIDTH +#define A( i ) N->p + (i) * WIDTH #define ADD( i ) add64( p, A( i ), &c ) #define NEXT p += WIDTH; carry64( p, &c ) #define LAST p += WIDTH; *p = c; while( ++p < end ) *p = 0 @@ -955,7 +955,8 @@ cleanup: #else /* 64-bit */ #define MAX32 N->n * 2 -#define A( j ) j % 2 ? (uint32_t)( N->p[j/2] >> 32 ) : (uint32_t)( N->p[j/2] ) +#define A( j ) (j) % 2 ? (uint32_t)( N->p[(j)/2] >> 32 ) : \ + (uint32_t)( N->p[(j)/2] ) #define STORE32 \ if( i % 2 ) { \ N->p[i/2] &= 0x00000000FFFFFFFF; \ @@ -989,20 +990,21 @@ static inline void sub32( uint32_t *dst, uint32_t src, signed char *carry ) * Helpers for the main 'loop' * (see fix_negative for the motivation of C) */ -#define INIT( b ) \ - int ret; \ - signed char c = 0, cc; \ - uint32_t cur; \ - size_t i = 0, bits = b; \ - mbedtls_mpi C; \ - mbedtls_mpi_uint Cp[ b / 8 / sizeof( mbedtls_mpi_uint) + 1 ]; \ - \ - C.s = 1; \ - C.n = b / 8 / sizeof( mbedtls_mpi_uint) + 1; \ - C.p = Cp; \ - memset( Cp, 0, C.n * sizeof( mbedtls_mpi_uint ) ); \ - \ - MBEDTLS_MPI_CHK( mbedtls_mpi_grow( N, b * 2 / 8 / sizeof( mbedtls_mpi_uint ) ) ); \ +#define INIT( b ) \ + int ret; \ + signed char c = 0, cc; \ + uint32_t cur; \ + size_t i = 0, bits = (b); \ + mbedtls_mpi C; \ + mbedtls_mpi_uint Cp[ (b) / 8 / sizeof( mbedtls_mpi_uint) + 1 ]; \ + \ + C.s = 1; \ + C.n = (b) / 8 / sizeof( mbedtls_mpi_uint) + 1; \ + C.p = Cp; \ + memset( Cp, 0, C.n * sizeof( mbedtls_mpi_uint ) ); \ + \ + MBEDTLS_MPI_CHK( mbedtls_mpi_grow( N, (b) * 2 / 8 / \ + sizeof( mbedtls_mpi_uint ) ) ); \ LOAD32; #define NEXT \ diff --git a/thirdparty/mbedtls/library/entropy_poll.c b/thirdparty/mbedtls/library/entropy_poll.c index ba56b70f77..4556f88a55 100644 --- a/thirdparty/mbedtls/library/entropy_poll.c +++ b/thirdparty/mbedtls/library/entropy_poll.c @@ -61,43 +61,28 @@ #define _WIN32_WINNT 0x0400 #endif #include <windows.h> -#include <bcrypt.h> -#if defined(_MSC_VER) && _MSC_VER <= 1600 -/* Visual Studio 2010 and earlier issue a warning when both <stdint.h> and - * <intsafe.h> are included, as they redefine a number of <TYPE>_MAX constants. - * These constants are guaranteed to be the same, though, so we suppress the - * warning when including intsafe.h. - */ -#pragma warning( push ) -#pragma warning( disable : 4005 ) -#endif -#include <intsafe.h> -#if defined(_MSC_VER) && _MSC_VER <= 1600 -#pragma warning( pop ) -#endif +#include <wincrypt.h> int mbedtls_platform_entropy_poll( void *data, unsigned char *output, size_t len, size_t *olen ) { - ULONG len_as_ulong = 0; + HCRYPTPROV provider; ((void) data); *olen = 0; - /* - * BCryptGenRandom takes ULONG for size, which is smaller than size_t on - * 64-bit Windows platforms. Ensure len's value can be safely converted into - * a ULONG. - */ - if ( FAILED( SizeTToULong( len, &len_as_ulong ) ) ) + if( CryptAcquireContext( &provider, NULL, NULL, + PROV_RSA_FULL, CRYPT_VERIFYCONTEXT ) == FALSE ) { return( MBEDTLS_ERR_ENTROPY_SOURCE_FAILED ); } - if ( !BCRYPT_SUCCESS( BCryptGenRandom( NULL, output, len_as_ulong, BCRYPT_USE_SYSTEM_PREFERRED_RNG ) ) ) + if( CryptGenRandom( provider, (DWORD) len, output ) == FALSE ) { + CryptReleaseContext( provider, 0 ); return( MBEDTLS_ERR_ENTROPY_SOURCE_FAILED ); } + CryptReleaseContext( provider, 0 ); *olen = len; return( 0 ); diff --git a/thirdparty/mbedtls/library/havege.c b/thirdparty/mbedtls/library/havege.c index 4dcac02875..54f897c6e7 100644 --- a/thirdparty/mbedtls/library/havege.c +++ b/thirdparty/mbedtls/library/havege.c @@ -54,7 +54,7 @@ * ------------------------------------------------------------------------ */ -#define SWAP(X,Y) { int *T = X; X = Y; Y = T; } +#define SWAP(X,Y) { int *T = (X); (X) = (Y); (Y) = T; } #define TST1_ENTER if( PTEST & 1 ) { PTEST ^= 3; PTEST >>= 1; #define TST2_ENTER if( PTEST & 1 ) { PTEST ^= 3; PTEST >>= 1; diff --git a/thirdparty/mbedtls/library/md4.c b/thirdparty/mbedtls/library/md4.c index 3f8ddff31d..828fd42999 100644 --- a/thirdparty/mbedtls/library/md4.c +++ b/thirdparty/mbedtls/library/md4.c @@ -137,15 +137,21 @@ int mbedtls_internal_md4_process( mbedtls_md4_context *ctx, GET_UINT32_LE( X[14], data, 56 ); GET_UINT32_LE( X[15], data, 60 ); -#define S(x,n) ((x << n) | ((x & 0xFFFFFFFF) >> (32 - n))) +#define S(x,n) (((x) << (n)) | (((x) & 0xFFFFFFFF) >> (32 - (n)))) A = ctx->state[0]; B = ctx->state[1]; C = ctx->state[2]; D = ctx->state[3]; -#define F(x, y, z) ((x & y) | ((~x) & z)) -#define P(a,b,c,d,x,s) { a += F(b,c,d) + x; a = S(a,s); } +#define F(x, y, z) (((x) & (y)) | ((~(x)) & (z))) +#define P(a,b,c,d,x,s) \ + do \ + { \ + (a) += F((b),(c),(d)) + (x); \ + (a) = S((a),(s)); \ + } while( 0 ) + P( A, B, C, D, X[ 0], 3 ); P( D, A, B, C, X[ 1], 7 ); @@ -167,8 +173,13 @@ int mbedtls_internal_md4_process( mbedtls_md4_context *ctx, #undef P #undef F -#define F(x,y,z) ((x & y) | (x & z) | (y & z)) -#define P(a,b,c,d,x,s) { a += F(b,c,d) + x + 0x5A827999; a = S(a,s); } +#define F(x,y,z) (((x) & (y)) | ((x) & (z)) | ((y) & (z))) +#define P(a,b,c,d,x,s) \ + do \ + { \ + (a) += F((b),(c),(d)) + (x) + 0x5A827999; \ + (a) = S((a),(s)); \ + } while( 0 ) P( A, B, C, D, X[ 0], 3 ); P( D, A, B, C, X[ 4], 5 ); @@ -190,8 +201,13 @@ int mbedtls_internal_md4_process( mbedtls_md4_context *ctx, #undef P #undef F -#define F(x,y,z) (x ^ y ^ z) -#define P(a,b,c,d,x,s) { a += F(b,c,d) + x + 0x6ED9EBA1; a = S(a,s); } +#define F(x,y,z) ((x) ^ (y) ^ (z)) +#define P(a,b,c,d,x,s) \ + do \ + { \ + (a) += F((b),(c),(d)) + (x) + 0x6ED9EBA1; \ + (a) = S((a),(s)); \ + } while( 0 ) P( A, B, C, D, X[ 0], 3 ); P( D, A, B, C, X[ 8], 9 ); diff --git a/thirdparty/mbedtls/library/md5.c b/thirdparty/mbedtls/library/md5.c index 2a740cda81..a93da8a061 100644 --- a/thirdparty/mbedtls/library/md5.c +++ b/thirdparty/mbedtls/library/md5.c @@ -136,19 +136,22 @@ int mbedtls_internal_md5_process( mbedtls_md5_context *ctx, GET_UINT32_LE( X[14], data, 56 ); GET_UINT32_LE( X[15], data, 60 ); -#define S(x,n) ((x << n) | ((x & 0xFFFFFFFF) >> (32 - n))) +#define S(x,n) \ + ( ( (x) << (n) ) | ( ( (x) & 0xFFFFFFFF) >> ( 32 - (n) ) ) ) -#define P(a,b,c,d,k,s,t) \ -{ \ - a += F(b,c,d) + X[k] + t; a = S(a,s) + b; \ -} +#define P(a,b,c,d,k,s,t) \ + do \ + { \ + (a) += F((b),(c),(d)) + X[(k)] + (t); \ + (a) = S((a),(s)) + (b); \ + } while( 0 ) A = ctx->state[0]; B = ctx->state[1]; C = ctx->state[2]; D = ctx->state[3]; -#define F(x,y,z) (z ^ (x & (y ^ z))) +#define F(x,y,z) ((z) ^ ((x) & ((y) ^ (z)))) P( A, B, C, D, 0, 7, 0xD76AA478 ); P( D, A, B, C, 1, 12, 0xE8C7B756 ); @@ -169,7 +172,7 @@ int mbedtls_internal_md5_process( mbedtls_md5_context *ctx, #undef F -#define F(x,y,z) (y ^ (z & (x ^ y))) +#define F(x,y,z) ((y) ^ ((z) & ((x) ^ (y)))) P( A, B, C, D, 1, 5, 0xF61E2562 ); P( D, A, B, C, 6, 9, 0xC040B340 ); @@ -190,7 +193,7 @@ int mbedtls_internal_md5_process( mbedtls_md5_context *ctx, #undef F -#define F(x,y,z) (x ^ y ^ z) +#define F(x,y,z) ((x) ^ (y) ^ (z)) P( A, B, C, D, 5, 4, 0xFFFA3942 ); P( D, A, B, C, 8, 11, 0x8771F681 ); @@ -211,7 +214,7 @@ int mbedtls_internal_md5_process( mbedtls_md5_context *ctx, #undef F -#define F(x,y,z) (y ^ (x | ~z)) +#define F(x,y,z) ((y) ^ ((x) | ~(z))) P( A, B, C, D, 0, 6, 0xF4292244 ); P( D, A, B, C, 7, 10, 0x432AFF97 ); diff --git a/thirdparty/mbedtls/library/oid.c b/thirdparty/mbedtls/library/oid.c index edea950f8f..33f437cbe6 100644 --- a/thirdparty/mbedtls/library/oid.c +++ b/thirdparty/mbedtls/library/oid.c @@ -54,22 +54,24 @@ * Macro to generate an internal function for oid_XXX_from_asn1() (used by * the other functions) */ -#define FN_OID_TYPED_FROM_ASN1( TYPE_T, NAME, LIST ) \ -static const TYPE_T * oid_ ## NAME ## _from_asn1( const mbedtls_asn1_buf *oid ) \ -{ \ - const TYPE_T *p = LIST; \ - const mbedtls_oid_descriptor_t *cur = (const mbedtls_oid_descriptor_t *) p; \ - if( p == NULL || oid == NULL ) return( NULL ); \ - while( cur->asn1 != NULL ) { \ - if( cur->asn1_len == oid->len && \ - memcmp( cur->asn1, oid->p, oid->len ) == 0 ) { \ - return( p ); \ - } \ - p++; \ - cur = (const mbedtls_oid_descriptor_t *) p; \ - } \ - return( NULL ); \ -} +#define FN_OID_TYPED_FROM_ASN1( TYPE_T, NAME, LIST ) \ + static const TYPE_T * oid_ ## NAME ## _from_asn1( \ + const mbedtls_asn1_buf *oid ) \ + { \ + const TYPE_T *p = (LIST); \ + const mbedtls_oid_descriptor_t *cur = \ + (const mbedtls_oid_descriptor_t *) p; \ + if( p == NULL || oid == NULL ) return( NULL ); \ + while( cur->asn1 != NULL ) { \ + if( cur->asn1_len == oid->len && \ + memcmp( cur->asn1, oid->p, oid->len ) == 0 ) { \ + return( p ); \ + } \ + p++; \ + cur = (const mbedtls_oid_descriptor_t *) p; \ + } \ + return( NULL ); \ + } /* * Macro to generate a function for retrieving a single attribute from the @@ -103,12 +105,13 @@ int FN_NAME( const mbedtls_asn1_buf *oid, ATTR1_TYPE * ATTR1 ) */ #define FN_OID_GET_ATTR2(FN_NAME, TYPE_T, TYPE_NAME, ATTR1_TYPE, ATTR1, \ ATTR2_TYPE, ATTR2) \ -int FN_NAME( const mbedtls_asn1_buf *oid, ATTR1_TYPE * ATTR1, ATTR2_TYPE * ATTR2 ) \ +int FN_NAME( const mbedtls_asn1_buf *oid, ATTR1_TYPE * ATTR1, \ + ATTR2_TYPE * ATTR2 ) \ { \ const TYPE_T *data = oid_ ## TYPE_NAME ## _from_asn1( oid ); \ - if( data == NULL ) return( MBEDTLS_ERR_OID_NOT_FOUND ); \ - *ATTR1 = data->ATTR1; \ - *ATTR2 = data->ATTR2; \ + if( data == NULL ) return( MBEDTLS_ERR_OID_NOT_FOUND ); \ + *(ATTR1) = data->ATTR1; \ + *(ATTR2) = data->ATTR2; \ return( 0 ); \ } @@ -119,16 +122,16 @@ int FN_NAME( const mbedtls_asn1_buf *oid, ATTR1_TYPE * ATTR1, ATTR2_TYPE * ATTR2 #define FN_OID_GET_OID_BY_ATTR1(FN_NAME, TYPE_T, LIST, ATTR1_TYPE, ATTR1) \ int FN_NAME( ATTR1_TYPE ATTR1, const char **oid, size_t *olen ) \ { \ - const TYPE_T *cur = LIST; \ + const TYPE_T *cur = (LIST); \ while( cur->descriptor.asn1 != NULL ) { \ - if( cur->ATTR1 == ATTR1 ) { \ + if( cur->ATTR1 == (ATTR1) ) { \ *oid = cur->descriptor.asn1; \ *olen = cur->descriptor.asn1_len; \ return( 0 ); \ } \ cur++; \ } \ - return( MBEDTLS_ERR_OID_NOT_FOUND ); \ + return( MBEDTLS_ERR_OID_NOT_FOUND ); \ } /* @@ -140,9 +143,9 @@ int FN_NAME( ATTR1_TYPE ATTR1, const char **oid, size_t *olen ) \ int FN_NAME( ATTR1_TYPE ATTR1, ATTR2_TYPE ATTR2, const char **oid , \ size_t *olen ) \ { \ - const TYPE_T *cur = LIST; \ + const TYPE_T *cur = (LIST); \ while( cur->descriptor.asn1 != NULL ) { \ - if( cur->ATTR1 == ATTR1 && cur->ATTR2 == ATTR2 ) { \ + if( cur->ATTR1 == (ATTR1) && cur->ATTR2 == (ATTR2) ) { \ *oid = cur->descriptor.asn1; \ *olen = cur->descriptor.asn1_len; \ return( 0 ); \ diff --git a/thirdparty/mbedtls/library/poly1305.c b/thirdparty/mbedtls/library/poly1305.c index b274119181..2b56c5f7ef 100644 --- a/thirdparty/mbedtls/library/poly1305.c +++ b/thirdparty/mbedtls/library/poly1305.c @@ -58,10 +58,10 @@ #define POLY1305_BLOCK_SIZE_BYTES ( 16U ) #define BYTES_TO_U32_LE( data, offset ) \ - ( (uint32_t) data[offset] \ - | (uint32_t) ( (uint32_t) data[( offset ) + 1] << 8 ) \ - | (uint32_t) ( (uint32_t) data[( offset ) + 2] << 16 ) \ - | (uint32_t) ( (uint32_t) data[( offset ) + 3] << 24 ) \ + ( (uint32_t) (data)[offset] \ + | (uint32_t) ( (uint32_t) (data)[( offset ) + 1] << 8 ) \ + | (uint32_t) ( (uint32_t) (data)[( offset ) + 2] << 16 ) \ + | (uint32_t) ( (uint32_t) (data)[( offset ) + 3] << 24 ) \ ) /* diff --git a/thirdparty/mbedtls/library/ripemd160.c b/thirdparty/mbedtls/library/ripemd160.c index bd25ada62c..0791ae4cc9 100644 --- a/thirdparty/mbedtls/library/ripemd160.c +++ b/thirdparty/mbedtls/library/ripemd160.c @@ -147,22 +147,29 @@ int mbedtls_internal_ripemd160_process( mbedtls_ripemd160_context *ctx, D = Dp = ctx->state[3]; E = Ep = ctx->state[4]; -#define F1( x, y, z ) ( x ^ y ^ z ) -#define F2( x, y, z ) ( ( x & y ) | ( ~x & z ) ) -#define F3( x, y, z ) ( ( x | ~y ) ^ z ) -#define F4( x, y, z ) ( ( x & z ) | ( y & ~z ) ) -#define F5( x, y, z ) ( x ^ ( y | ~z ) ) - -#define S( x, n ) ( ( x << n ) | ( x >> (32 - n) ) ) - -#define P( a, b, c, d, e, r, s, f, k ) \ - a += f( b, c, d ) + X[r] + k; \ - a = S( a, s ) + e; \ - c = S( c, 10 ); - -#define P2( a, b, c, d, e, r, s, rp, sp ) \ - P( a, b, c, d, e, r, s, F, K ); \ - P( a ## p, b ## p, c ## p, d ## p, e ## p, rp, sp, Fp, Kp ); +#define F1( x, y, z ) ( (x) ^ (y) ^ (z) ) +#define F2( x, y, z ) ( ( (x) & (y) ) | ( ~(x) & (z) ) ) +#define F3( x, y, z ) ( ( (x) | ~(y) ) ^ (z) ) +#define F4( x, y, z ) ( ( (x) & (z) ) | ( (y) & ~(z) ) ) +#define F5( x, y, z ) ( (x) ^ ( (y) | ~(z) ) ) + +#define S( x, n ) ( ( (x) << (n) ) | ( (x) >> (32 - (n)) ) ) + +#define P( a, b, c, d, e, r, s, f, k ) \ + do \ + { \ + (a) += f( (b), (c), (d) ) + X[r] + (k); \ + (a) = S( (a), (s) ) + (e); \ + (c) = S( (c), 10 ); \ + } while( 0 ) + +#define P2( a, b, c, d, e, r, s, rp, sp ) \ + do \ + { \ + P( (a), (b), (c), (d), (e), (r), (s), F, K ); \ + P( a ## p, b ## p, c ## p, d ## p, e ## p, \ + (rp), (sp), Fp, Kp ); \ + } while( 0 ) #define F F1 #define K 0x00000000 diff --git a/thirdparty/mbedtls/library/sha1.c b/thirdparty/mbedtls/library/sha1.c index e8d4096fbb..355c83d2f7 100644 --- a/thirdparty/mbedtls/library/sha1.c +++ b/thirdparty/mbedtls/library/sha1.c @@ -152,19 +152,21 @@ int mbedtls_internal_sha1_process( mbedtls_sha1_context *ctx, GET_UINT32_BE( W[14], data, 56 ); GET_UINT32_BE( W[15], data, 60 ); -#define S(x,n) ((x << n) | ((x & 0xFFFFFFFF) >> (32 - n))) - -#define R(t) \ -( \ - temp = W[( t - 3 ) & 0x0F] ^ W[( t - 8 ) & 0x0F] ^ \ - W[( t - 14 ) & 0x0F] ^ W[ t & 0x0F], \ - ( W[t & 0x0F] = S(temp,1) ) \ -) - -#define P(a,b,c,d,e,x) \ -{ \ - e += S(a,5) + F(b,c,d) + K + x; b = S(b,30); \ -} +#define S(x,n) (((x) << (n)) | (((x) & 0xFFFFFFFF) >> (32 - (n)))) + +#define R(t) \ + ( \ + temp = W[( (t) - 3 ) & 0x0F] ^ W[( (t) - 8 ) & 0x0F] ^ \ + W[( (t) - 14 ) & 0x0F] ^ W[ (t) & 0x0F], \ + ( W[(t) & 0x0F] = S(temp,1) ) \ + ) + +#define P(a,b,c,d,e,x) \ + do \ + { \ + (e) += S((a),5) + F((b),(c),(d)) + K + (x); \ + (b) = S((b),30); \ + } while( 0 ) A = ctx->state[0]; B = ctx->state[1]; @@ -172,7 +174,7 @@ int mbedtls_internal_sha1_process( mbedtls_sha1_context *ctx, D = ctx->state[3]; E = ctx->state[4]; -#define F(x,y,z) (z ^ (x & (y ^ z))) +#define F(x,y,z) ((z) ^ ((x) & ((y) ^ (z)))) #define K 0x5A827999 P( A, B, C, D, E, W[0] ); @@ -199,7 +201,7 @@ int mbedtls_internal_sha1_process( mbedtls_sha1_context *ctx, #undef K #undef F -#define F(x,y,z) (x ^ y ^ z) +#define F(x,y,z) ((x) ^ (y) ^ (z)) #define K 0x6ED9EBA1 P( A, B, C, D, E, R(20) ); @@ -226,7 +228,7 @@ int mbedtls_internal_sha1_process( mbedtls_sha1_context *ctx, #undef K #undef F -#define F(x,y,z) ((x & y) | (z & (x | y))) +#define F(x,y,z) (((x) & (y)) | ((z) & ((x) | (y)))) #define K 0x8F1BBCDC P( A, B, C, D, E, R(40) ); @@ -253,7 +255,7 @@ int mbedtls_internal_sha1_process( mbedtls_sha1_context *ctx, #undef K #undef F -#define F(x,y,z) (x ^ y ^ z) +#define F(x,y,z) ((x) ^ (y) ^ (z)) #define K 0xCA62C1D6 P( A, B, C, D, E, R(60) ); diff --git a/thirdparty/mbedtls/library/sha256.c b/thirdparty/mbedtls/library/sha256.c index 8a540adfbe..2dc0e1a2c9 100644 --- a/thirdparty/mbedtls/library/sha256.c +++ b/thirdparty/mbedtls/library/sha256.c @@ -172,8 +172,8 @@ static const uint32_t K[] = 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2, }; -#define SHR(x,n) ((x & 0xFFFFFFFF) >> n) -#define ROTR(x,n) (SHR(x,n) | (x << (32 - n))) +#define SHR(x,n) (((x) & 0xFFFFFFFF) >> (n)) +#define ROTR(x,n) (SHR(x,n) | ((x) << (32 - (n)))) #define S0(x) (ROTR(x, 7) ^ ROTR(x,18) ^ SHR(x, 3)) #define S1(x) (ROTR(x,17) ^ ROTR(x,19) ^ SHR(x,10)) @@ -181,21 +181,22 @@ static const uint32_t K[] = #define S2(x) (ROTR(x, 2) ^ ROTR(x,13) ^ ROTR(x,22)) #define S3(x) (ROTR(x, 6) ^ ROTR(x,11) ^ ROTR(x,25)) -#define F0(x,y,z) ((x & y) | (z & (x | y))) -#define F1(x,y,z) (z ^ (x & (y ^ z))) +#define F0(x,y,z) (((x) & (y)) | ((z) & ((x) | (y)))) +#define F1(x,y,z) ((z) ^ ((x) & ((y) ^ (z)))) #define R(t) \ -( \ - W[t] = S1(W[t - 2]) + W[t - 7] + \ - S0(W[t - 15]) + W[t - 16] \ -) - -#define P(a,b,c,d,e,f,g,h,x,K) \ -{ \ - temp1 = h + S3(e) + F1(e,f,g) + K + x; \ - temp2 = S2(a) + F0(a,b,c); \ - d += temp1; h = temp1 + temp2; \ -} + ( \ + W[t] = S1(W[(t) - 2]) + W[(t) - 7] + \ + S0(W[(t) - 15]) + W[(t) - 16] \ + ) + +#define P(a,b,c,d,e,f,g,h,x,K) \ + do \ + { \ + temp1 = (h) + S3(e) + F1((e),(f),(g)) + (K) + (x); \ + temp2 = S2(a) + F0((a),(b),(c)); \ + (d) += temp1; (h) = temp1 + temp2; \ + } while( 0 ) int mbedtls_internal_sha256_process( mbedtls_sha256_context *ctx, const unsigned char data[64] ) diff --git a/thirdparty/mbedtls/library/sha512.c b/thirdparty/mbedtls/library/sha512.c index 941ecda762..bdd20b284a 100644 --- a/thirdparty/mbedtls/library/sha512.c +++ b/thirdparty/mbedtls/library/sha512.c @@ -224,8 +224,8 @@ int mbedtls_internal_sha512_process( mbedtls_sha512_context *ctx, SHA512_VALIDATE_RET( ctx != NULL ); SHA512_VALIDATE_RET( (const unsigned char *)data != NULL ); -#define SHR(x,n) (x >> n) -#define ROTR(x,n) (SHR(x,n) | (x << (64 - n))) +#define SHR(x,n) ((x) >> (n)) +#define ROTR(x,n) (SHR((x),(n)) | ((x) << (64 - (n)))) #define S0(x) (ROTR(x, 1) ^ ROTR(x, 8) ^ SHR(x, 7)) #define S1(x) (ROTR(x,19) ^ ROTR(x,61) ^ SHR(x, 6)) @@ -233,15 +233,16 @@ int mbedtls_internal_sha512_process( mbedtls_sha512_context *ctx, #define S2(x) (ROTR(x,28) ^ ROTR(x,34) ^ ROTR(x,39)) #define S3(x) (ROTR(x,14) ^ ROTR(x,18) ^ ROTR(x,41)) -#define F0(x,y,z) ((x & y) | (z & (x | y))) -#define F1(x,y,z) (z ^ (x & (y ^ z))) +#define F0(x,y,z) (((x) & (y)) | ((z) & ((x) | (y)))) +#define F1(x,y,z) ((z) ^ ((x) & ((y) ^ (z)))) -#define P(a,b,c,d,e,f,g,h,x,K) \ -{ \ - temp1 = h + S3(e) + F1(e,f,g) + K + x; \ - temp2 = S2(a) + F0(a,b,c); \ - d += temp1; h = temp1 + temp2; \ -} +#define P(a,b,c,d,e,f,g,h,x,K) \ + do \ + { \ + temp1 = (h) + S3(e) + F1((e),(f),(g)) + (K) + (x); \ + temp2 = S2(a) + F0((a),(b),(c)); \ + (d) += temp1; (h) = temp1 + temp2; \ + } while( 0 ) for( i = 0; i < 16; i++ ) { diff --git a/thirdparty/mbedtls/library/ssl_ciphersuites.c b/thirdparty/mbedtls/library/ssl_ciphersuites.c index 745474effe..518f7dde00 100644 --- a/thirdparty/mbedtls/library/ssl_ciphersuites.c +++ b/thirdparty/mbedtls/library/ssl_ciphersuites.c @@ -43,11 +43,11 @@ /* * Ordered from most preferred to least preferred in terms of security. * - * Current rule (except rc4, weak and null which come last): + * Current rule (except RC4 and 3DES, weak and null which come last): * 1. By key exchange: * Forward-secure non-PSK > forward-secure PSK > ECJPAKE > other non-PSK > other PSK * 2. By key length and cipher: - * ChaCha > AES-256 > Camellia-256 > ARIA-256 > AES-128 > Camellia-128 > ARIA-128 > 3DES + * ChaCha > AES-256 > Camellia-256 > ARIA-256 > AES-128 > Camellia-128 > ARIA-128 * 3. By cipher mode when relevant GCM > CCM > CBC > CCM_8 * 4. By hash function used when relevant * 5. By key exchange/auth again: EC > non-EC @@ -126,11 +126,6 @@ static const int ciphersuite_preference[] = MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256, MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256, - /* All remaining >= 128-bit ephemeral suites */ - MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, - MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, - MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA, - /* The PSK ephemeral suites */ MBEDTLS_TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256, MBEDTLS_TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256, @@ -162,9 +157,6 @@ static const int ciphersuite_preference[] = MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256, MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256, - MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA, - MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA, - /* The ECJPAKE suite */ MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8, @@ -228,11 +220,6 @@ static const int ciphersuite_preference[] = MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256, MBEDTLS_TLS_RSA_WITH_ARIA_128_CBC_SHA256, - /* All remaining >= 128-bit suites */ - MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA, - MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA, - MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, - /* The RSA PSK suites */ MBEDTLS_TLS_RSA_PSK_WITH_CHACHA20_POLY1305_SHA256, MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384, @@ -251,8 +238,6 @@ static const int ciphersuite_preference[] = MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256, MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256, - MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA, - /* The PSK suites */ MBEDTLS_TLS_PSK_WITH_CHACHA20_POLY1305_SHA256, MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384, @@ -275,6 +260,16 @@ static const int ciphersuite_preference[] = MBEDTLS_TLS_PSK_WITH_ARIA_128_GCM_SHA256, MBEDTLS_TLS_PSK_WITH_ARIA_128_CBC_SHA256, + /* 3DES suites */ + MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, + MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, + MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA, + MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA, + MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA, + MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA, + MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA, + MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, + MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA, MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA, /* RC4 suites */ @@ -2187,6 +2182,26 @@ const int *mbedtls_ssl_list_ciphersuites( void ) static int supported_ciphersuites[MAX_CIPHERSUITES]; static int supported_init = 0; +static int ciphersuite_is_removed( const mbedtls_ssl_ciphersuite_t *cs_info ) +{ + (void)cs_info; + +#if defined(MBEDTLS_REMOVE_ARC4_CIPHERSUITES) + if( cs_info->cipher == MBEDTLS_CIPHER_ARC4_128 ) + return( 1 ); +#endif /* MBEDTLS_REMOVE_ARC4_CIPHERSUITES */ + +#if defined(MBEDTLS_REMOVE_3DES_CIPHERSUITES) + if( cs_info->cipher == MBEDTLS_CIPHER_DES_EDE3_ECB || + cs_info->cipher == MBEDTLS_CIPHER_DES_EDE3_CBC ) + { + return( 1 ); + } +#endif /* MBEDTLS_REMOVE_3DES_CIPHERSUITES */ + + return( 0 ); +} + const int *mbedtls_ssl_list_ciphersuites( void ) { /* @@ -2202,14 +2217,12 @@ const int *mbedtls_ssl_list_ciphersuites( void ) *p != 0 && q < supported_ciphersuites + MAX_CIPHERSUITES - 1; p++ ) { -#if defined(MBEDTLS_REMOVE_ARC4_CIPHERSUITES) const mbedtls_ssl_ciphersuite_t *cs_info; if( ( cs_info = mbedtls_ssl_ciphersuite_from_id( *p ) ) != NULL && - cs_info->cipher != MBEDTLS_CIPHER_ARC4_128 ) -#else - if( mbedtls_ssl_ciphersuite_from_id( *p ) != NULL ) -#endif + !ciphersuite_is_removed( cs_info ) ) + { *(q++) = *p; + } } *q = 0; diff --git a/thirdparty/mbedtls/library/version_features.c b/thirdparty/mbedtls/library/version_features.c index 4c36d3caaa..24143d052c 100644 --- a/thirdparty/mbedtls/library/version_features.c +++ b/thirdparty/mbedtls/library/version_features.c @@ -300,6 +300,9 @@ static const char *features[] = { #if defined(MBEDTLS_REMOVE_ARC4_CIPHERSUITES) "MBEDTLS_REMOVE_ARC4_CIPHERSUITES", #endif /* MBEDTLS_REMOVE_ARC4_CIPHERSUITES */ +#if defined(MBEDTLS_REMOVE_3DES_CIPHERSUITES) + "MBEDTLS_REMOVE_3DES_CIPHERSUITES", +#endif /* MBEDTLS_REMOVE_3DES_CIPHERSUITES */ #if defined(MBEDTLS_ECP_DP_SECP192R1_ENABLED) "MBEDTLS_ECP_DP_SECP192R1_ENABLED", #endif /* MBEDTLS_ECP_DP_SECP192R1_ENABLED */ diff --git a/thirdparty/mbedtls/library/x509.c b/thirdparty/mbedtls/library/x509.c index 52b5b649f7..a562df7ca3 100644 --- a/thirdparty/mbedtls/library/x509.c +++ b/thirdparty/mbedtls/library/x509.c @@ -67,8 +67,15 @@ #include <time.h> #endif -#define CHECK(code) if( ( ret = code ) != 0 ){ return( ret ); } -#define CHECK_RANGE(min, max, val) if( val < min || val > max ){ return( ret ); } +#define CHECK(code) if( ( ret = ( code ) ) != 0 ){ return( ret ); } +#define CHECK_RANGE(min, max, val) \ + do \ + { \ + if( ( val ) < ( min ) || ( val ) > ( max ) ) \ + { \ + return( ret ); \ + } \ + } while( 0 ) /* * CertificateSerialNumber ::= INTEGER @@ -354,6 +361,8 @@ static int x509_get_attr_type_value( unsigned char **p, MBEDTLS_ASN1_CONSTRUCTED | MBEDTLS_ASN1_SEQUENCE ) ) != 0 ) return( MBEDTLS_ERR_X509_INVALID_NAME + ret ); + end = *p + len; + if( ( end - *p ) < 1 ) return( MBEDTLS_ERR_X509_INVALID_NAME + MBEDTLS_ERR_ASN1_OUT_OF_DATA ); @@ -387,6 +396,12 @@ static int x509_get_attr_type_value( unsigned char **p, val->p = *p; *p += val->len; + if( *p != end ) + { + return( MBEDTLS_ERR_X509_INVALID_NAME + + MBEDTLS_ERR_ASN1_LENGTH_MISMATCH ); + } + cur->next = NULL; return( 0 ); @@ -693,30 +708,25 @@ int mbedtls_x509_get_sig_alg( const mbedtls_x509_buf *sig_oid, const mbedtls_x50 * be either manually updated or extensions should be parsed!) */ int mbedtls_x509_get_ext( unsigned char **p, const unsigned char *end, - mbedtls_x509_buf *ext, int tag ) + mbedtls_x509_buf *ext, int tag ) { int ret; size_t len; - if( *p == end ) - return( 0 ); - - ext->tag = **p; - - if( ( ret = mbedtls_asn1_get_tag( p, end, &ext->len, - MBEDTLS_ASN1_CONTEXT_SPECIFIC | MBEDTLS_ASN1_CONSTRUCTED | tag ) ) != 0 ) - return( ret ); + /* Extension structure use EXPLICIT tagging. That is, the actual + * `Extensions` structure is wrapped by a tag-length pair using + * the respective context-specific tag. */ + ret = mbedtls_asn1_get_tag( p, end, &ext->len, + MBEDTLS_ASN1_CONTEXT_SPECIFIC | MBEDTLS_ASN1_CONSTRUCTED | tag ); + if( ret != 0 ) + return( MBEDTLS_ERR_X509_INVALID_EXTENSIONS + ret ); - ext->p = *p; - end = *p + ext->len; + ext->tag = MBEDTLS_ASN1_CONTEXT_SPECIFIC | MBEDTLS_ASN1_CONSTRUCTED | tag; + ext->p = *p; + end = *p + ext->len; /* * Extensions ::= SEQUENCE SIZE (1..MAX) OF Extension - * - * Extension ::= SEQUENCE { - * extnID OBJECT IDENTIFIER, - * critical BOOLEAN DEFAULT FALSE, - * extnValue OCTET STRING } */ if( ( ret = mbedtls_asn1_get_tag( p, end, &len, MBEDTLS_ASN1_CONSTRUCTED | MBEDTLS_ASN1_SEQUENCE ) ) != 0 ) @@ -1001,8 +1011,8 @@ int mbedtls_x509_time_is_future( const mbedtls_x509_time *from ) */ int mbedtls_x509_self_test( int verbose ) { + int ret = 0; #if defined(MBEDTLS_CERTS_C) && defined(MBEDTLS_SHA256_C) - int ret; uint32_t flags; mbedtls_x509_crt cacert; mbedtls_x509_crt clicert; @@ -1010,6 +1020,7 @@ int mbedtls_x509_self_test( int verbose ) if( verbose != 0 ) mbedtls_printf( " X.509 certificate load: " ); + mbedtls_x509_crt_init( &cacert ); mbedtls_x509_crt_init( &clicert ); ret = mbedtls_x509_crt_parse( &clicert, (const unsigned char *) mbedtls_test_cli_crt, @@ -1019,11 +1030,9 @@ int mbedtls_x509_self_test( int verbose ) if( verbose != 0 ) mbedtls_printf( "failed\n" ); - return( ret ); + goto cleanup; } - mbedtls_x509_crt_init( &cacert ); - ret = mbedtls_x509_crt_parse( &cacert, (const unsigned char *) mbedtls_test_ca_crt, mbedtls_test_ca_crt_len ); if( ret != 0 ) @@ -1031,7 +1040,7 @@ int mbedtls_x509_self_test( int verbose ) if( verbose != 0 ) mbedtls_printf( "failed\n" ); - return( ret ); + goto cleanup; } if( verbose != 0 ) @@ -1043,20 +1052,19 @@ int mbedtls_x509_self_test( int verbose ) if( verbose != 0 ) mbedtls_printf( "failed\n" ); - return( ret ); + goto cleanup; } if( verbose != 0 ) mbedtls_printf( "passed\n\n"); +cleanup: mbedtls_x509_crt_free( &cacert ); mbedtls_x509_crt_free( &clicert ); - - return( 0 ); #else ((void) verbose); - return( 0 ); #endif /* MBEDTLS_CERTS_C && MBEDTLS_SHA1_C */ + return( ret ); } #endif /* MBEDTLS_SELF_TEST */ diff --git a/thirdparty/mbedtls/library/x509_crl.c b/thirdparty/mbedtls/library/x509_crl.c index 8450f87e03..00f8545d7c 100644 --- a/thirdparty/mbedtls/library/x509_crl.c +++ b/thirdparty/mbedtls/library/x509_crl.c @@ -103,17 +103,17 @@ static int x509_get_crl_ext( unsigned char **p, { int ret; + if( *p == end ) + return( 0 ); + /* * crlExtensions [0] EXPLICIT Extensions OPTIONAL * -- if present, version MUST be v2 */ if( ( ret = mbedtls_x509_get_ext( p, end, ext, 0 ) ) != 0 ) - { - if( ret == MBEDTLS_ERR_ASN1_UNEXPECTED_TAG ) - return( 0 ); - return( ret ); - } + + end = ext->p + ext->len; while( *p < end ) { diff --git a/thirdparty/mbedtls/library/x509_crt.c b/thirdparty/mbedtls/library/x509_crt.c index 35a134950e..97e1d72e3c 100644 --- a/thirdparty/mbedtls/library/x509_crt.c +++ b/thirdparty/mbedtls/library/x509_crt.c @@ -65,19 +65,6 @@ #if defined(_WIN32) && !defined(EFIX64) && !defined(EFI32) #include <windows.h> -#if defined(_MSC_VER) && _MSC_VER <= 1600 -/* Visual Studio 2010 and earlier issue a warning when both <stdint.h> and - * <intsafe.h> are included, as they redefine a number of <TYPE>_MAX constants. - * These constants are guaranteed to be the same, though, so we suppress the - * warning when including intsafe.h. - */ -#pragma warning( push ) -#pragma warning( disable : 4005 ) -#endif -#include <intsafe.h> -#if defined(_MSC_VER) && _MSC_VER <= 1600 -#pragma warning( pop ) -#endif #else #include <time.h> #endif @@ -381,7 +368,7 @@ static void x509_crt_verify_chain_reset( for( i = 0; i < MBEDTLS_X509_MAX_VERIFY_CHAIN_SIZE; i++ ) { ver_chain->items[i].crt = NULL; - ver_chain->items[i].flags = -1; + ver_chain->items[i].flags = (uint32_t) -1; } ver_chain->len = 0; @@ -406,7 +393,7 @@ static int x509_get_version( unsigned char **p, return( 0 ); } - return( ret ); + return( MBEDTLS_ERR_X509_INVALID_FORMAT + ret ); } end = *p + len; @@ -473,7 +460,7 @@ static int x509_get_uid( unsigned char **p, if( ret == MBEDTLS_ERR_ASN1_UNEXPECTED_TAG ) return( 0 ); - return( ret ); + return( MBEDTLS_ERR_X509_INVALID_FORMAT + ret ); } uid->p = *p; @@ -712,14 +699,13 @@ static int x509_get_crt_ext( unsigned char **p, size_t len; unsigned char *end_ext_data, *end_ext_octet; - if( ( ret = mbedtls_x509_get_ext( p, end, &crt->v3_ext, 3 ) ) != 0 ) - { - if( ret == MBEDTLS_ERR_ASN1_UNEXPECTED_TAG ) - return( 0 ); + if( *p == end ) + return( 0 ); + if( ( ret = mbedtls_x509_get_ext( p, end, &crt->v3_ext, 3 ) ) != 0 ) return( ret ); - } + end = crt->v3_ext.p + crt->v3_ext.len; while( *p < end ) { /* @@ -1291,7 +1277,6 @@ int mbedtls_x509_crt_parse_path( mbedtls_x509_crt *chain, const char *path ) char filename[MAX_PATH]; char *p; size_t len = strlen( path ); - int lengthAsInt = 0; WIN32_FIND_DATAW file_data; HANDLE hFind; @@ -1306,18 +1291,7 @@ int mbedtls_x509_crt_parse_path( mbedtls_x509_crt *chain, const char *path ) p = filename + len; filename[len++] = '*'; - if ( FAILED ( SizeTToInt( len, &lengthAsInt ) ) ) - return( MBEDTLS_ERR_X509_FILE_IO_ERROR ); - - /* - * Note this function uses the code page CP_ACP, and assumes the incoming - * string is encoded in ANSI, before translating it into Unicode. If the - * incoming string were changed to be UTF-8, then the length check needs to - * change to check the number of characters, not the number of bytes, in the - * incoming string are less than MAX_PATH to avoid a buffer overrun with - * MultiByteToWideChar(). - */ - w_ret = MultiByteToWideChar( CP_ACP, 0, filename, lengthAsInt, szDir, + w_ret = MultiByteToWideChar( CP_ACP, 0, filename, (int)len, szDir, MAX_PATH - 3 ); if( w_ret == 0 ) return( MBEDTLS_ERR_X509_BAD_INPUT_DATA ); @@ -1334,11 +1308,8 @@ int mbedtls_x509_crt_parse_path( mbedtls_x509_crt *chain, const char *path ) if( file_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) continue; - if ( FAILED( SizeTToInt( wcslen( file_data.cFileName ), &lengthAsInt ) ) ) - return( MBEDTLS_ERR_X509_FILE_IO_ERROR ); - w_ret = WideCharToMultiByte( CP_ACP, 0, file_data.cFileName, - lengthAsInt, + lstrlenW( file_data.cFileName ), p, (int) len - 1, NULL, NULL ); if( w_ret == 0 ) @@ -1467,7 +1438,7 @@ static int x509_info_subject_alt_name( char **buf, size_t *size, } #define CERT_TYPE(type,name) \ - if( ns_cert_type & type ) \ + if( ns_cert_type & (type) ) \ PRINT_ITEM( name ); static int x509_info_cert_type( char **buf, size_t *size, @@ -1494,7 +1465,7 @@ static int x509_info_cert_type( char **buf, size_t *size, } #define KEY_USAGE(code,name) \ - if( key_usage & code ) \ + if( key_usage & (code) ) \ PRINT_ITEM( name ); static int x509_info_key_usage( char **buf, size_t *size, diff --git a/thirdparty/mbedtls/library/x509_csr.c b/thirdparty/mbedtls/library/x509_csr.c index f84425728a..c8c08c87b2 100644 --- a/thirdparty/mbedtls/library/x509_csr.c +++ b/thirdparty/mbedtls/library/x509_csr.c @@ -279,15 +279,24 @@ int mbedtls_x509_csr_parse( mbedtls_x509_csr *csr, const unsigned char *buf, siz { mbedtls_pem_init( &pem ); ret = mbedtls_pem_read_buffer( &pem, - "-----BEGIN CERTIFICATE REQUEST-----", - "-----END CERTIFICATE REQUEST-----", - buf, NULL, 0, &use_len ); + "-----BEGIN CERTIFICATE REQUEST-----", + "-----END CERTIFICATE REQUEST-----", + buf, NULL, 0, &use_len ); + if( ret == MBEDTLS_ERR_PEM_NO_HEADER_FOOTER_PRESENT ) + { + ret = mbedtls_pem_read_buffer( &pem, + "-----BEGIN NEW CERTIFICATE REQUEST-----", + "-----END NEW CERTIFICATE REQUEST-----", + buf, NULL, 0, &use_len ); + } if( ret == 0 ) + { /* * Was PEM encoded, parse the result */ ret = mbedtls_x509_csr_parse_der( csr, pem.buf, pem.buflen ); + } mbedtls_pem_free( &pem ); if( ret != MBEDTLS_ERR_PEM_NO_HEADER_FOOTER_PRESENT ) diff --git a/thirdparty/mbedtls/library/x509write_crt.c b/thirdparty/mbedtls/library/x509write_crt.c index b1ef216c95..10497e752b 100644 --- a/thirdparty/mbedtls/library/x509write_crt.c +++ b/thirdparty/mbedtls/library/x509write_crt.c @@ -218,26 +218,51 @@ int mbedtls_x509write_crt_set_authority_key_identifier( mbedtls_x509write_cert * } #endif /* MBEDTLS_SHA1_C */ +static size_t crt_get_unused_bits_for_named_bitstring( unsigned char bitstring, + size_t bit_offset ) +{ + size_t unused_bits; + + /* Count the unused bits removing trailing 0s */ + for( unused_bits = bit_offset; unused_bits < 8; unused_bits++ ) + if( ( ( bitstring >> unused_bits ) & 0x1 ) != 0 ) + break; + + return( unused_bits ); +} + int mbedtls_x509write_crt_set_key_usage( mbedtls_x509write_cert *ctx, unsigned int key_usage ) { unsigned char buf[4], ku; unsigned char *c; int ret; - - /* We currently only support 7 bits, from 0x80 to 0x02 */ - if( ( key_usage & ~0xfe ) != 0 ) + size_t unused_bits; + const unsigned int allowed_bits = MBEDTLS_X509_KU_DIGITAL_SIGNATURE | + MBEDTLS_X509_KU_NON_REPUDIATION | + MBEDTLS_X509_KU_KEY_ENCIPHERMENT | + MBEDTLS_X509_KU_DATA_ENCIPHERMENT | + MBEDTLS_X509_KU_KEY_AGREEMENT | + MBEDTLS_X509_KU_KEY_CERT_SIGN | + MBEDTLS_X509_KU_CRL_SIGN; + + /* Check that nothing other than the allowed flags is set */ + if( ( key_usage & ~allowed_bits ) != 0 ) return( MBEDTLS_ERR_X509_FEATURE_UNAVAILABLE ); c = buf + 4; - ku = (unsigned char) key_usage; + ku = (unsigned char)key_usage; + unused_bits = crt_get_unused_bits_for_named_bitstring( ku, 1 ); + ret = mbedtls_asn1_write_bitstring( &c, buf, &ku, 8 - unused_bits ); - if( ( ret = mbedtls_asn1_write_bitstring( &c, buf, &ku, 7 ) ) != 4 ) + if( ret < 0 ) return( ret ); + else if( ret < 3 || ret > 4 ) + return( MBEDTLS_ERR_X509_INVALID_FORMAT ); ret = mbedtls_x509write_crt_set_extension( ctx, MBEDTLS_OID_KEY_USAGE, MBEDTLS_OID_SIZE( MBEDTLS_OID_KEY_USAGE ), - 1, buf, 4 ); + 1, c, (size_t)ret ); if( ret != 0 ) return( ret ); @@ -249,16 +274,22 @@ int mbedtls_x509write_crt_set_ns_cert_type( mbedtls_x509write_cert *ctx, { unsigned char buf[4]; unsigned char *c; + size_t unused_bits; int ret; c = buf + 4; - if( ( ret = mbedtls_asn1_write_bitstring( &c, buf, &ns_cert_type, 8 ) ) != 4 ) + unused_bits = crt_get_unused_bits_for_named_bitstring( ns_cert_type, 0 ); + ret = mbedtls_asn1_write_bitstring( &c, + buf, + &ns_cert_type, + 8 - unused_bits ); + if( ret < 3 || ret > 4 ) return( ret ); ret = mbedtls_x509write_crt_set_extension( ctx, MBEDTLS_OID_NS_CERT_TYPE, MBEDTLS_OID_SIZE( MBEDTLS_OID_NS_CERT_TYPE ), - 0, buf, 4 ); + 0, c, (size_t)ret ); if( ret != 0 ) return( ret ); diff --git a/thirdparty/mbedtls/library/x509write_csr.c b/thirdparty/mbedtls/library/x509write_csr.c index 66cee56014..d70ba0ed92 100644 --- a/thirdparty/mbedtls/library/x509write_csr.c +++ b/thirdparty/mbedtls/library/x509write_csr.c @@ -81,20 +81,39 @@ int mbedtls_x509write_csr_set_extension( mbedtls_x509write_csr *ctx, 0, val, val_len ); } +static size_t csr_get_unused_bits_for_named_bitstring( unsigned char bitstring, + size_t bit_offset ) +{ + size_t unused_bits; + + /* Count the unused bits removing trailing 0s */ + for( unused_bits = bit_offset; unused_bits < 8; unused_bits++ ) + if( ( ( bitstring >> unused_bits ) & 0x1 ) != 0 ) + break; + + return( unused_bits ); +} + int mbedtls_x509write_csr_set_key_usage( mbedtls_x509write_csr *ctx, unsigned char key_usage ) { unsigned char buf[4]; unsigned char *c; + size_t unused_bits; int ret; c = buf + 4; - if( ( ret = mbedtls_asn1_write_bitstring( &c, buf, &key_usage, 7 ) ) != 4 ) + unused_bits = csr_get_unused_bits_for_named_bitstring( key_usage, 0 ); + ret = mbedtls_asn1_write_bitstring( &c, buf, &key_usage, 8 - unused_bits ); + + if( ret < 0 ) return( ret ); + else if( ret < 3 || ret > 4 ) + return( MBEDTLS_ERR_X509_INVALID_FORMAT ); ret = mbedtls_x509write_csr_set_extension( ctx, MBEDTLS_OID_KEY_USAGE, MBEDTLS_OID_SIZE( MBEDTLS_OID_KEY_USAGE ), - buf, 4 ); + c, (size_t)ret ); if( ret != 0 ) return( ret ); @@ -106,16 +125,25 @@ int mbedtls_x509write_csr_set_ns_cert_type( mbedtls_x509write_csr *ctx, { unsigned char buf[4]; unsigned char *c; + size_t unused_bits; int ret; c = buf + 4; - if( ( ret = mbedtls_asn1_write_bitstring( &c, buf, &ns_cert_type, 8 ) ) != 4 ) + unused_bits = csr_get_unused_bits_for_named_bitstring( ns_cert_type, 0 ); + ret = mbedtls_asn1_write_bitstring( &c, + buf, + &ns_cert_type, + 8 - unused_bits ); + + if( ret < 0 ) + return( ret ); + else if( ret < 3 || ret > 4 ) return( ret ); ret = mbedtls_x509write_csr_set_extension( ctx, MBEDTLS_OID_NS_CERT_TYPE, MBEDTLS_OID_SIZE( MBEDTLS_OID_NS_CERT_TYPE ), - buf, 4 ); + c, (size_t)ret ); if( ret != 0 ) return( ret ); diff --git a/thirdparty/misc/stb_vorbis.c b/thirdparty/misc/stb_vorbis.c index 88276026ef..71af404dae 100644 --- a/thirdparty/misc/stb_vorbis.c +++ b/thirdparty/misc/stb_vorbis.c @@ -1,4 +1,4 @@ -// Ogg Vorbis audio decoder - v1.15 - public domain +// Ogg Vorbis audio decoder - v1.16 - public domain // http://nothings.org/stb_vorbis/ // // Original version written by Sean Barrett in 2007. @@ -33,6 +33,7 @@ // Timur Gagiev // // Partial history: +// 1.16 - 2019-03-04 - fix warnings // 1.15 - 2019-02-07 - explicit failure if Ogg Skeleton data is found // 1.14 - 2018-02-11 - delete bogus dealloca usage // 1.13 - 2018-01-29 - fix truncation of last frame (hopefully) @@ -4990,7 +4991,13 @@ stb_vorbis * stb_vorbis_open_file(FILE *file, int close_on_free, int *error, con stb_vorbis * stb_vorbis_open_filename(const char *filename, int *error, const stb_vorbis_alloc *alloc) { - FILE *f = fopen(filename, "rb"); + FILE *f; +#if defined(_WIN32) && defined(__STDC_WANT_SECURE_LIB__) + if (0 != fopen_s(&f, filename, "rb")) + f = NULL; +#else + f = fopen(filename, "rb"); +#endif if (f) return stb_vorbis_open_file(f, TRUE, error, alloc); if (error) *error = VORBIS_file_open_failure; diff --git a/thirdparty/pcre2/AUTHORS b/thirdparty/pcre2/AUTHORS index d5592bbc5b..8d4e15a247 100644 --- a/thirdparty/pcre2/AUTHORS +++ b/thirdparty/pcre2/AUTHORS @@ -8,7 +8,7 @@ Email domain: cam.ac.uk University of Cambridge Computing Service, Cambridge, England. -Copyright (c) 1997-2018 University of Cambridge +Copyright (c) 1997-2019 University of Cambridge All rights reserved @@ -19,7 +19,7 @@ Written by: Zoltan Herczeg Email local part: hzmester Emain domain: freemail.hu -Copyright(c) 2010-2018 Zoltan Herczeg +Copyright(c) 2010-2019 Zoltan Herczeg All rights reserved. @@ -30,7 +30,7 @@ Written by: Zoltan Herczeg Email local part: hzmester Emain domain: freemail.hu -Copyright(c) 2009-2018 Zoltan Herczeg +Copyright(c) 2009-2019 Zoltan Herczeg All rights reserved. #### diff --git a/thirdparty/pcre2/LICENCE b/thirdparty/pcre2/LICENCE index b0f8804fff..142b3b3f9a 100644 --- a/thirdparty/pcre2/LICENCE +++ b/thirdparty/pcre2/LICENCE @@ -26,7 +26,7 @@ Email domain: cam.ac.uk University of Cambridge Computing Service, Cambridge, England. -Copyright (c) 1997-2018 University of Cambridge +Copyright (c) 1997-2019 University of Cambridge All rights reserved. @@ -37,7 +37,7 @@ Written by: Zoltan Herczeg Email local part: hzmester Email domain: freemail.hu -Copyright(c) 2010-2018 Zoltan Herczeg +Copyright(c) 2010-2019 Zoltan Herczeg All rights reserved. @@ -48,7 +48,7 @@ Written by: Zoltan Herczeg Email local part: hzmester Email domain: freemail.hu -Copyright(c) 2009-2018 Zoltan Herczeg +Copyright(c) 2009-2019 Zoltan Herczeg All rights reserved. diff --git a/thirdparty/pcre2/src/config.h b/thirdparty/pcre2/src/config.h index 89a52ef848..25d45eeb38 100644 --- a/thirdparty/pcre2/src/config.h +++ b/thirdparty/pcre2/src/config.h @@ -35,6 +35,10 @@ sure both macros are undefined; an emulation function will then be used. */ */ /* #undef BSR_ANYCRLF */ +/* Define to any value to disable the use of the z and t modifiers in + formatting settings such as %zu or %td (this is rarely needed). */ +/* #undef DISABLE_PERCENT_ZT */ + /* If you are compiling for a system that uses EBCDIC instead of ASCII character codes, define this macro to any value. When EBCDIC is set, PCRE2 assumes that all input strings are in EBCDIC. If you do not define this @@ -214,7 +218,7 @@ sure both macros are undefined; an emulation function will then be used. */ #define PACKAGE_NAME "PCRE2" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "PCRE2 10.32" +#define PACKAGE_STRING "PCRE2 10.33" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "pcre2" @@ -223,7 +227,7 @@ sure both macros are undefined; an emulation function will then be used. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "10.32" +#define PACKAGE_VERSION "10.33" /* The value of PARENS_NEST_LIMIT specifies the maximum depth of nested parentheses (of any kind) in a pattern. This limits the amount of system @@ -299,6 +303,11 @@ sure both macros are undefined; an emulation function will then be used. */ /* Define to any value to enable callout script support in pcre2grep. */ /* #undef SUPPORT_PCRE2GREP_CALLOUT */ +/* Define to any value to enable fork support in pcre2grep callout scripts. + This will have no effect unless SUPPORT_PCRE2GREP_CALLOUT is also defined. + */ +/* #undef SUPPORT_PCRE2GREP_CALLOUT_FORK */ + /* Define to any value to enable JIT support in pcre2grep. Note that this will have no effect unless SUPPORT_JIT is also defined. */ /* #undef SUPPORT_PCRE2GREP_JIT */ @@ -343,7 +352,7 @@ sure both macros are undefined; an emulation function will then be used. */ #endif /* Version number of package */ -#define VERSION "10.32" +#define VERSION "10.33" /* Define to 1 if on MINIX. */ /* #undef _MINIX */ diff --git a/thirdparty/pcre2/src/pcre2.h b/thirdparty/pcre2/src/pcre2.h index 3d2feb7a6b..102b5d91f1 100644 --- a/thirdparty/pcre2/src/pcre2.h +++ b/thirdparty/pcre2/src/pcre2.h @@ -42,15 +42,9 @@ POSSIBILITY OF SUCH DAMAGE. /* The current PCRE version information. */ #define PCRE2_MAJOR 10 -#define PCRE2_MINOR 32 +#define PCRE2_MINOR 33 #define PCRE2_PRERELEASE -#define PCRE2_DATE 2018-09-10 - -/* For the benefit of systems without stdint.h, an alternative is to use -inttypes.h. The existence of these headers is checked by configure or CMake. */ - -#define PCRE2_HAVE_STDINT_H 1 -#define PCRE2_HAVE_INTTYPES_H 1 +#define PCRE2_DATE 2019-04-16 /* When an application links to a PCRE DLL in Windows, the symbols that are imported have to be identified as such. When building PCRE2, the appropriate @@ -87,18 +81,15 @@ set, we ensure here that it has no effect. */ #define PCRE2_CALL_CONVENTION #endif -/* Have to include limits.h, stdlib.h and stdint.h (or inttypes.h) to ensure -that size_t and uint8_t, UCHAR_MAX, etc are defined. If the system has neither -header, the relevant values must be provided by some other means. */ +/* Have to include limits.h, stdlib.h, and inttypes.h to ensure that size_t and +uint8_t, UCHAR_MAX, etc are defined. Some systems that do have inttypes.h do +not have stdint.h, which is why we use inttypes.h, which according to the C +standard is a superset of stdint.h. If none of these headers are available, +the relevant values must be provided by some other means. */ #include <limits.h> #include <stdlib.h> - -#if PCRE2_HAVE_STDINT_H -#include <stdint.h> -#elif PCRE2_HAVE_INTTYPES_H #include <inttypes.h> -#endif /* Allow for C++ users compiling this directly. */ @@ -158,43 +149,37 @@ D is inspected during pcre2_dfa_match() execution #define PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL 0x00000002u /* C */ #define PCRE2_EXTRA_MATCH_WORD 0x00000004u /* C */ #define PCRE2_EXTRA_MATCH_LINE 0x00000008u /* C */ +#define PCRE2_EXTRA_ESCAPED_CR_IS_LF 0x00000010u /* C */ +#define PCRE2_EXTRA_ALT_BSUX 0x00000020u /* C */ /* These are for pcre2_jit_compile(). */ #define PCRE2_JIT_COMPLETE 0x00000001u /* For full matching */ #define PCRE2_JIT_PARTIAL_SOFT 0x00000002u #define PCRE2_JIT_PARTIAL_HARD 0x00000004u - -/* These are for pcre2_match(), pcre2_dfa_match(), and pcre2_jit_match(). Note -that PCRE2_ANCHORED and PCRE2_NO_UTF_CHECK can also be passed to these -functions (though pcre2_jit_match() ignores the latter since it bypasses all -sanity checks). */ - -#define PCRE2_NOTBOL 0x00000001u -#define PCRE2_NOTEOL 0x00000002u -#define PCRE2_NOTEMPTY 0x00000004u /* ) These two must be kept */ -#define PCRE2_NOTEMPTY_ATSTART 0x00000008u /* ) adjacent to each other. */ -#define PCRE2_PARTIAL_SOFT 0x00000010u -#define PCRE2_PARTIAL_HARD 0x00000020u - -/* These are additional options for pcre2_dfa_match(). */ - -#define PCRE2_DFA_RESTART 0x00000040u -#define PCRE2_DFA_SHORTEST 0x00000080u - -/* These are additional options for pcre2_substitute(), which passes any others -through to pcre2_match(). */ - -#define PCRE2_SUBSTITUTE_GLOBAL 0x00000100u -#define PCRE2_SUBSTITUTE_EXTENDED 0x00000200u -#define PCRE2_SUBSTITUTE_UNSET_EMPTY 0x00000400u -#define PCRE2_SUBSTITUTE_UNKNOWN_UNSET 0x00000800u -#define PCRE2_SUBSTITUTE_OVERFLOW_LENGTH 0x00001000u - -/* A further option for pcre2_match(), not allowed for pcre2_dfa_match(), -ignored for pcre2_jit_match(). */ - -#define PCRE2_NO_JIT 0x00002000u +#define PCRE2_JIT_INVALID_UTF 0x00000100u + +/* These are for pcre2_match(), pcre2_dfa_match(), pcre2_jit_match(), and +pcre2_substitute(). Some are allowed only for one of the functions, and in +these cases it is noted below. Note that PCRE2_ANCHORED, PCRE2_ENDANCHORED and +PCRE2_NO_UTF_CHECK can also be passed to these functions (though +pcre2_jit_match() ignores the latter since it bypasses all sanity checks). */ + +#define PCRE2_NOTBOL 0x00000001u +#define PCRE2_NOTEOL 0x00000002u +#define PCRE2_NOTEMPTY 0x00000004u /* ) These two must be kept */ +#define PCRE2_NOTEMPTY_ATSTART 0x00000008u /* ) adjacent to each other. */ +#define PCRE2_PARTIAL_SOFT 0x00000010u +#define PCRE2_PARTIAL_HARD 0x00000020u +#define PCRE2_DFA_RESTART 0x00000040u /* pcre2_dfa_match() only */ +#define PCRE2_DFA_SHORTEST 0x00000080u /* pcre2_dfa_match() only */ +#define PCRE2_SUBSTITUTE_GLOBAL 0x00000100u /* pcre2_substitute() only */ +#define PCRE2_SUBSTITUTE_EXTENDED 0x00000200u /* pcre2_substitute() only */ +#define PCRE2_SUBSTITUTE_UNSET_EMPTY 0x00000400u /* pcre2_substitute() only */ +#define PCRE2_SUBSTITUTE_UNKNOWN_UNSET 0x00000800u /* pcre2_substitute() only */ +#define PCRE2_SUBSTITUTE_OVERFLOW_LENGTH 0x00001000u /* pcre2_substitute() only */ +#define PCRE2_NO_JIT 0x00002000u /* Not for pcre2_dfa_match() */ +#define PCRE2_COPY_MATCHED_SUBJECT 0x00004000u /* Options for pcre2_pattern_convert(). */ @@ -318,6 +303,8 @@ pcre2_pattern_convert(). */ #define PCRE2_ERROR_BAD_LITERAL_OPTIONS 192 #define PCRE2_ERROR_SUPPORTED_ONLY_IN_UNICODE 193 #define PCRE2_ERROR_INVALID_HYPHEN_IN_OPTIONS 194 +#define PCRE2_ERROR_ALPHA_ASSERTION_UNKNOWN 195 +#define PCRE2_ERROR_SCRIPT_RUN_NOT_AVAILABLE 196 /* "Expected" matching error codes: no match and partial match. */ @@ -504,10 +491,10 @@ typedef struct pcre2_real_jit_stack pcre2_jit_stack; \ typedef pcre2_jit_stack *(*pcre2_jit_callback)(void *); -/* The structure for passing out data via the pcre_callout_function. We use a -structure so that new fields can be added on the end in future versions, -without changing the API of the function, thereby allowing old clients to work -without modification. Define the generic version in a macro; the width-specific +/* The structures for passing out data via callout functions. We use structures +so that new fields can be added on the end in future versions, without changing +the API of the function, thereby allowing old clients to work without +modification. Define the generic versions in a macro; the width-specific versions are generated from this macro below. */ /* Flags for the callout_flags field. These are cleared after a callout. */ @@ -549,7 +536,19 @@ typedef struct pcre2_callout_enumerate_block { \ PCRE2_SIZE callout_string_length; /* Length of string compiled into pattern */ \ PCRE2_SPTR callout_string; /* String compiled into pattern */ \ /* ------------------------------------------------------------------ */ \ -} pcre2_callout_enumerate_block; +} pcre2_callout_enumerate_block; \ +\ +typedef struct pcre2_substitute_callout_block { \ + uint32_t version; /* Identifies version of block */ \ + /* ------------------------ Version 0 ------------------------------- */ \ + PCRE2_SPTR input; /* Pointer to input subject string */ \ + PCRE2_SPTR output; /* Pointer to output buffer */ \ + PCRE2_SIZE output_offsets[2]; /* Changed portion of the output */ \ + PCRE2_SIZE *ovector; /* Pointer to current ovector */ \ + uint32_t oveccount; /* Count of pairs set in ovector */ \ + uint32_t subscount; /* Substitution number */ \ + /* ------------------------------------------------------------------ */ \ +} pcre2_substitute_callout_block; /* List the generic forms of all other functions in macros, which will be @@ -605,6 +604,9 @@ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_set_callout(pcre2_match_context *, \ int (*)(pcre2_callout_block *, void *), void *); \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ + pcre2_set_substitute_callout(pcre2_match_context *, \ + int (*)(pcre2_substitute_callout_block *, void *), void *); \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_set_depth_limit(pcre2_match_context *, uint32_t); \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_set_heap_limit(pcre2_match_context *, uint32_t); \ @@ -807,6 +809,7 @@ pcre2_compile are called by application code. */ #define pcre2_callout_block PCRE2_SUFFIX(pcre2_callout_block_) #define pcre2_callout_enumerate_block PCRE2_SUFFIX(pcre2_callout_enumerate_block_) +#define pcre2_substitute_callout_block PCRE2_SUFFIX(pcre2_substitute_callout_block_) #define pcre2_general_context PCRE2_SUFFIX(pcre2_general_context_) #define pcre2_compile_context PCRE2_SUFFIX(pcre2_compile_context_) #define pcre2_convert_context PCRE2_SUFFIX(pcre2_convert_context_) @@ -872,6 +875,7 @@ pcre2_compile are called by application code. */ #define pcre2_set_newline PCRE2_SUFFIX(pcre2_set_newline_) #define pcre2_set_parens_nest_limit PCRE2_SUFFIX(pcre2_set_parens_nest_limit_) #define pcre2_set_offset_limit PCRE2_SUFFIX(pcre2_set_offset_limit_) +#define pcre2_set_substitute_callout PCRE2_SUFFIX(pcre2_set_substitute_callout_) #define pcre2_substitute PCRE2_SUFFIX(pcre2_substitute_) #define pcre2_substring_copy_byname PCRE2_SUFFIX(pcre2_substring_copy_byname_) #define pcre2_substring_copy_bynumber PCRE2_SUFFIX(pcre2_substring_copy_bynumber_) diff --git a/thirdparty/pcre2/src/pcre2_auto_possess.c b/thirdparty/pcre2/src/pcre2_auto_possess.c index 2ce152e952..6d7b7c4a4d 100644 --- a/thirdparty/pcre2/src/pcre2_auto_possess.c +++ b/thirdparty/pcre2/src/pcre2_auto_possess.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2018 University of Cambridge + New API code Copyright (c) 2016-2019 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -605,6 +605,15 @@ for(;;) if (cb->had_recurse) return FALSE; break; + /* A script run might have to backtrack if the iterated item can match + characters from more than one script. So give up unless repeating an + explicit character. */ + + case OP_SCRIPT_RUN: + if (base_list[0] != OP_CHAR && base_list[0] != OP_CHARI) + return FALSE; + break; + /* Atomic sub-patterns and assertions can always auto-possessify their last iterator. However, if the group was entered as a result of checking a previous iterator, this is not possible. */ @@ -614,7 +623,6 @@ for(;;) case OP_ASSERTBACK: case OP_ASSERTBACK_NOT: case OP_ONCE: - return !entered_a_group; } @@ -1043,7 +1051,7 @@ for(;;) if (chr > 255) break; class_bitset = (uint8_t *) ((list_ptr == list ? code : base_end) - list_ptr[2]); - if ((class_bitset[chr >> 3] & (1 << (chr & 7))) != 0) return FALSE; + if ((class_bitset[chr >> 3] & (1u << (chr & 7))) != 0) return FALSE; break; #ifdef SUPPORT_WIDE_CHARS diff --git a/thirdparty/pcre2/src/pcre2_chartables.c b/thirdparty/pcre2/src/pcre2_chartables.c index 4046500c00..0e07edb494 100644 --- a/thirdparty/pcre2/src/pcre2_chartables.c +++ b/thirdparty/pcre2/src/pcre2_chartables.c @@ -157,8 +157,8 @@ graph print, punct, and cntrl. Other classes are built from combinations. */ /* This table identifies various classes of character by individual bits: 0x01 white space character 0x02 letter - 0x04 decimal digit - 0x08 hexadecimal digit + 0x04 lower case letter + 0x08 decimal digit 0x10 alphanumeric or '_' */ @@ -168,16 +168,16 @@ graph print, punct, and cntrl. Other classes are built from combinations. */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 24- 31 */ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* - ' */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* ( - / */ - 0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c, /* 0 - 7 */ - 0x1c,0x1c,0x00,0x00,0x00,0x00,0x00,0x00, /* 8 - ? */ - 0x00,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /* @ - G */ + 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, /* 0 - 7 */ + 0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00, /* 8 - ? */ + 0x00,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* @ - G */ 0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* H - O */ 0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* P - W */ 0x12,0x12,0x12,0x00,0x00,0x00,0x00,0x10, /* X - _ */ - 0x00,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /* ` - g */ - 0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* h - o */ - 0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* p - w */ - 0x12,0x12,0x12,0x00,0x00,0x00,0x00,0x00, /* x -127 */ + 0x00,0x16,0x16,0x16,0x16,0x16,0x16,0x16, /* ` - g */ + 0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16, /* h - o */ + 0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16, /* p - w */ + 0x16,0x16,0x16,0x00,0x00,0x00,0x00,0x00, /* x -127 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 128-135 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 136-143 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 144-151 */ diff --git a/thirdparty/pcre2/src/pcre2_compile.c b/thirdparty/pcre2/src/pcre2_compile.c index 6bb1de3610..068735ae8e 100644 --- a/thirdparty/pcre2/src/pcre2_compile.c +++ b/thirdparty/pcre2/src/pcre2_compile.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2018 University of Cambridge + New API code Copyright (c) 2016-2019 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -240,49 +240,57 @@ code (meta_extra_lengths, just below) must be updated to remain in step. */ #define META_RANGE_LITERAL 0x801f0000u /* range defined literally */ #define META_RECURSE 0x80200000u /* Recursion */ #define META_RECURSE_BYNAME 0x80210000u /* (?&name) */ +#define META_SCRIPT_RUN 0x80220000u /* (*script_run:...) */ /* These must be kept together to make it easy to check that an assertion is present where expected in a conditional group. */ -#define META_LOOKAHEAD 0x80220000u /* (?= */ -#define META_LOOKAHEADNOT 0x80230000u /* (?! */ -#define META_LOOKBEHIND 0x80240000u /* (?<= */ -#define META_LOOKBEHINDNOT 0x80250000u /* (?<! */ +#define META_LOOKAHEAD 0x80230000u /* (?= */ +#define META_LOOKAHEADNOT 0x80240000u /* (?! */ +#define META_LOOKBEHIND 0x80250000u /* (?<= */ +#define META_LOOKBEHINDNOT 0x80260000u /* (?<! */ /* These must be kept in this order, with consecutive values, and the _ARG versions of COMMIT, PRUNE, SKIP, and THEN immediately after their non-argument versions. */ -#define META_MARK 0x80260000u /* (*MARK) */ -#define META_ACCEPT 0x80270000u /* (*ACCEPT) */ -#define META_FAIL 0x80280000u /* (*FAIL) */ -#define META_COMMIT 0x80290000u /* These */ -#define META_COMMIT_ARG 0x802a0000u /* pairs */ -#define META_PRUNE 0x802b0000u /* must */ -#define META_PRUNE_ARG 0x802c0000u /* be */ -#define META_SKIP 0x802d0000u /* kept */ -#define META_SKIP_ARG 0x802e0000u /* in */ -#define META_THEN 0x802f0000u /* this */ -#define META_THEN_ARG 0x80300000u /* order */ +#define META_MARK 0x80270000u /* (*MARK) */ +#define META_ACCEPT 0x80280000u /* (*ACCEPT) */ +#define META_FAIL 0x80290000u /* (*FAIL) */ +#define META_COMMIT 0x802a0000u /* These */ +#define META_COMMIT_ARG 0x802b0000u /* pairs */ +#define META_PRUNE 0x802c0000u /* must */ +#define META_PRUNE_ARG 0x802d0000u /* be */ +#define META_SKIP 0x802e0000u /* kept */ +#define META_SKIP_ARG 0x802f0000u /* in */ +#define META_THEN 0x80300000u /* this */ +#define META_THEN_ARG 0x80310000u /* order */ /* These must be kept in groups of adjacent 3 values, and all together. */ -#define META_ASTERISK 0x80310000u /* * */ -#define META_ASTERISK_PLUS 0x80320000u /* *+ */ -#define META_ASTERISK_QUERY 0x80330000u /* *? */ -#define META_PLUS 0x80340000u /* + */ -#define META_PLUS_PLUS 0x80350000u /* ++ */ -#define META_PLUS_QUERY 0x80360000u /* +? */ -#define META_QUERY 0x80370000u /* ? */ -#define META_QUERY_PLUS 0x80380000u /* ?+ */ -#define META_QUERY_QUERY 0x80390000u /* ?? */ -#define META_MINMAX 0x803a0000u /* {n,m} repeat */ -#define META_MINMAX_PLUS 0x803b0000u /* {n,m}+ repeat */ -#define META_MINMAX_QUERY 0x803c0000u /* {n,m}? repeat */ +#define META_ASTERISK 0x80320000u /* * */ +#define META_ASTERISK_PLUS 0x80330000u /* *+ */ +#define META_ASTERISK_QUERY 0x80340000u /* *? */ +#define META_PLUS 0x80350000u /* + */ +#define META_PLUS_PLUS 0x80360000u /* ++ */ +#define META_PLUS_QUERY 0x80370000u /* +? */ +#define META_QUERY 0x80380000u /* ? */ +#define META_QUERY_PLUS 0x80390000u /* ?+ */ +#define META_QUERY_QUERY 0x803a0000u /* ?? */ +#define META_MINMAX 0x803b0000u /* {n,m} repeat */ +#define META_MINMAX_PLUS 0x803c0000u /* {n,m}+ repeat */ +#define META_MINMAX_QUERY 0x803d0000u /* {n,m}? repeat */ #define META_FIRST_QUANTIFIER META_ASTERISK #define META_LAST_QUANTIFIER META_MINMAX_QUERY +/* This is a special "meta code" that is used only to distinguish (*asr: from +(*sr: in the table of aphabetic assertions. It is never stored in the parsed +pattern because (*asr: is turned into (*sr:(*atomic: at that stage. There is +therefore no need for it to have a length entry, so use a high value. */ + +#define META_ATOMIC_SCRIPT_RUN 0x8fff0000u + /* Table of extra lengths for each of the meta codes. Must be kept in step with the definitions above. For some items these values are a basic length to which a variable amount has to be added. */ @@ -322,6 +330,7 @@ static unsigned char meta_extra_lengths[] = { 0, /* META_RANGE_LITERAL */ SIZEOFFSET, /* META_RECURSE */ 1+SIZEOFFSET, /* META_RECURSE_BYNAME */ + 0, /* META_SCRIPT_RUN */ 0, /* META_LOOKAHEAD */ 0, /* META_LOOKAHEADNOT */ SIZEOFFSET, /* META_LOOKBEHIND */ @@ -359,17 +368,17 @@ enum { PSKIP_ALT, PSKIP_CLASS, PSKIP_KET }; experimenting to figure out how to stop gcc 5.3.0 from warning with -Wconversion. This version gets a warning: - #define SETBIT(a,b) a[(b)/8] |= (uint8_t)(1 << ((b)&7)) + #define SETBIT(a,b) a[(b)/8] |= (uint8_t)(1u << ((b)&7)) Let's hope the apparently less efficient version isn't actually so bad if the compiler is clever with identical subexpressions. */ -#define SETBIT(a,b) a[(b)/8] = (uint8_t)(a[(b)/8] | (1 << ((b)&7))) +#define SETBIT(a,b) a[(b)/8] = (uint8_t)(a[(b)/8] | (1u << ((b)&7))) /* Private flags added to firstcu and reqcu. */ -#define REQ_CASELESS (1 << 0) /* Indicates caselessness */ -#define REQ_VARY (1 << 1) /* reqcu followed non-literal item */ +#define REQ_CASELESS (1u << 0) /* Indicates caselessness */ +#define REQ_VARY (1u << 1) /* reqcu followed non-literal item */ /* Negative values for the firstcu and reqcu flags */ #define REQ_UNSET (-2) /* Not yet found anything */ #define REQ_NONE (-1) /* Found not fixed char */ @@ -615,6 +624,46 @@ static const uint32_t verbops[] = { OP_MARK, OP_ACCEPT, OP_FAIL, OP_COMMIT, OP_COMMIT_ARG, OP_PRUNE, OP_PRUNE_ARG, OP_SKIP, OP_SKIP_ARG, OP_THEN, OP_THEN_ARG }; +/* Table of "alpha assertions" like (*pla:...), similar to the (*VERB) table. */ + +typedef struct alasitem { + unsigned int len; /* Length of name */ + uint32_t meta; /* Base META_ code */ +} alasitem; + +static const char alasnames[] = + STRING_pla0 + STRING_plb0 + STRING_nla0 + STRING_nlb0 + STRING_positive_lookahead0 + STRING_positive_lookbehind0 + STRING_negative_lookahead0 + STRING_negative_lookbehind0 + STRING_atomic0 + STRING_sr0 + STRING_asr0 + STRING_script_run0 + STRING_atomic_script_run; + +static const alasitem alasmeta[] = { + { 3, META_LOOKAHEAD }, + { 3, META_LOOKBEHIND }, + { 3, META_LOOKAHEADNOT }, + { 3, META_LOOKBEHINDNOT }, + { 18, META_LOOKAHEAD }, + { 19, META_LOOKBEHIND }, + { 18, META_LOOKAHEADNOT }, + { 19, META_LOOKBEHINDNOT }, + { 6, META_ATOMIC }, + { 2, META_SCRIPT_RUN }, /* sr = script run */ + { 3, META_ATOMIC_SCRIPT_RUN }, /* asr = atomic script run */ + { 10, META_SCRIPT_RUN }, /* script run */ + { 17, META_ATOMIC_SCRIPT_RUN } /* atomic script run */ +}; + +static const int alascount = sizeof(alasmeta)/sizeof(alasitem); + /* Offsets from OP_STAR for case-independent and negative repeat opcodes. */ static uint32_t chartypeoffset[] = { @@ -714,7 +763,8 @@ are allowed. */ #define PUBLIC_COMPILE_EXTRA_OPTIONS \ (PUBLIC_LITERAL_COMPILE_EXTRA_OPTIONS| \ - PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES|PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL) + PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES|PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL| \ + PCRE2_EXTRA_ESCAPED_CR_IS_LF|PCRE2_EXTRA_ALT_BSUX) /* Compile time error code numbers. They are given names so that they can more easily be tracked. When a new number is added, the tables called eint1 and @@ -731,7 +781,7 @@ enum { ERR0 = COMPILE_ERROR_BASE, ERR61, ERR62, ERR63, ERR64, ERR65, ERR66, ERR67, ERR68, ERR69, ERR70, ERR71, ERR72, ERR73, ERR74, ERR75, ERR76, ERR77, ERR78, ERR79, ERR80, ERR81, ERR82, ERR83, ERR84, ERR85, ERR86, ERR87, ERR88, ERR89, ERR90, - ERR91, ERR92, ERR93, ERR94 }; + ERR91, ERR92, ERR93, ERR94, ERR95, ERR96 }; /* This is a table of start-of-pattern options such as (*UTF) and settings such as (*LIMIT_MATCH=nnnn) and (*CRLF). For completeness and backward @@ -962,6 +1012,7 @@ for (;;) case META_NOCAPTURE: fprintf(stderr, "META (?:"); break; case META_LOOKAHEAD: fprintf(stderr, "META (?="); break; case META_LOOKAHEADNOT: fprintf(stderr, "META (?!"); break; + case META_SCRIPT_RUN: fprintf(stderr, "META (*sr:"); break; case META_KET: fprintf(stderr, "META )"); break; case META_ALT: fprintf(stderr, "META | %d", meta_arg); break; @@ -1191,7 +1242,7 @@ if (code != NULL) if ((code->flags & PCRE2_DEREF_TABLES) != 0) { /* Decoded tables belong to the codes after deserialization, and they must - be freed when there are no more reference to them. The *ref_count should + be freed when there are no more references to them. The *ref_count should always be > 0. */ ref_count = (PCRE2_SIZE *)(code->tables + tables_length); @@ -1398,7 +1449,7 @@ Arguments: errorcodeptr points to the errorcode variable (containing zero) options the current options bits isclass TRUE if inside a character class - cb compile data block + cb compile data block or NULL when called from pcre2_substitute() Returns: zero => a data character positive => a special escape sequence @@ -1408,7 +1459,8 @@ Returns: zero => a data character int PRIV(check_escape)(PCRE2_SPTR *ptrptr, PCRE2_SPTR ptrend, uint32_t *chptr, - int *errorcodeptr, uint32_t options, BOOL isclass, compile_block *cb) + int *errorcodeptr, uint32_t options, uint32_t extra_options, BOOL isclass, + compile_block *cb) { BOOL utf = (options & PCRE2_UTF) != 0; PCRE2_SPTR ptr = *ptrptr; @@ -1429,14 +1481,25 @@ GETCHARINCTEST(c, ptr); /* Get character value, increment pointer */ /* Non-alphanumerics are literals, so we just leave the value in c. An initial value test saves a memory lookup for code points outside the alphanumeric -range. Otherwise, do a table lookup. A non-zero result is something that can be -returned immediately. Otherwise further processing is required. */ +range. */ if (c < ESCAPES_FIRST || c > ESCAPES_LAST) {} /* Definitely literal */ +/* Otherwise, do a table lookup. Non-zero values need little processing here. A +positive value is a literal value for something like \n. A negative value is +the negation of one of the ESC_ macros that is passed back for handling by the +calling function. Some extra checking is needed for \N because only \N{U+dddd} +is supported. If the value is zero, further processing is handled below. */ + else if ((i = escapes[c - ESCAPES_FIRST]) != 0) { - if (i > 0) c = (uint32_t)i; else /* Positive is a data character */ + if (i > 0) + { + c = (uint32_t)i; + if (c == CHAR_CR && (extra_options & PCRE2_EXTRA_ESCAPED_CR_IS_LF) != 0) + c = CHAR_LF; + } + else /* Negative table entry */ { escape = -i; /* Else return a special escape */ if (cb != NULL && (escape == ESC_P || escape == ESC_p || escape == ESC_X)) @@ -1486,23 +1549,29 @@ else if ((i = escapes[c - ESCAPES_FIRST]) != 0) } } -/* Escapes that need further processing, including those that are unknown. -When called from pcre2_substitute(), only \c, \o, and \x are recognized (and \u -when BSUX is set). */ +/* Escapes that need further processing, including those that are unknown, have +a zero entry in the lookup table. When called from pcre2_substitute(), only \c, +\o, and \x are recognized (\u and \U can never appear as they are used for case +forcing). */ else { + int s; PCRE2_SPTR oldptr; BOOL overflow; - int s; + BOOL alt_bsux = + ((options & PCRE2_ALT_BSUX) | (extra_options & PCRE2_EXTRA_ALT_BSUX)) != 0; /* Filter calls from pcre2_substitute(). */ - if (cb == NULL && c != CHAR_c && c != CHAR_o && c != CHAR_x && - (c != CHAR_u || (options & PCRE2_ALT_BSUX) != 0)) + if (cb == NULL) { - *errorcodeptr = ERR3; - return 0; + if (c != CHAR_c && c != CHAR_o && c != CHAR_x) + { + *errorcodeptr = ERR3; + return 0; + } + alt_bsux = FALSE; /* Do not modify \x handling */ } switch (c) @@ -1516,40 +1585,75 @@ else *errorcodeptr = ERR37; break; - /* \u is unrecognized when PCRE2_ALT_BSUX is not set. When it is treated - specially, \u must be followed by four hex digits. Otherwise it is a - lowercase u letter. */ + /* \u is unrecognized when neither PCRE2_ALT_BSUX nor PCRE2_EXTRA_ALT_BSUX + is set. Otherwise, \u must be followed by exactly four hex digits or, if + PCRE2_EXTRA_ALT_BSUX is set, by any number of hex digits in braces. + Otherwise it is a lowercase u letter. This gives some compatibility with + ECMAScript (aka JavaScript). */ case CHAR_u: - if ((options & PCRE2_ALT_BSUX) == 0) *errorcodeptr = ERR37; else + if (!alt_bsux) *errorcodeptr = ERR37; else { uint32_t xc; - if (ptrend - ptr < 4) break; /* Less than 4 chars */ - if ((cc = XDIGIT(ptr[0])) == 0xff) break; /* Not a hex digit */ - if ((xc = XDIGIT(ptr[1])) == 0xff) break; /* Not a hex digit */ - cc = (cc << 4) | xc; - if ((xc = XDIGIT(ptr[2])) == 0xff) break; /* Not a hex digit */ - cc = (cc << 4) | xc; - if ((xc = XDIGIT(ptr[3])) == 0xff) break; /* Not a hex digit */ - c = (cc << 4) | xc; - ptr += 4; + + if (ptr >= ptrend) break; + if (*ptr == CHAR_LEFT_CURLY_BRACKET && + (extra_options & PCRE2_EXTRA_ALT_BSUX) != 0) + { + PCRE2_SPTR hptr = ptr + 1; + cc = 0; + + while (hptr < ptrend && (xc = XDIGIT(*hptr)) != 0xff) + { + if ((cc & 0xf0000000) != 0) /* Test for 32-bit overflow */ + { + *errorcodeptr = ERR77; + ptr = hptr; /* Show where */ + break; /* *hptr != } will cause another break below */ + } + cc = (cc << 4) | xc; + hptr++; + } + + if (hptr == ptr + 1 || /* No hex digits */ + hptr >= ptrend || /* Hit end of input */ + *hptr != CHAR_RIGHT_CURLY_BRACKET) /* No } terminator */ + break; /* Hex escape not recognized */ + + c = cc; /* Accept the code point */ + ptr = hptr + 1; + } + + else /* Must be exactly 4 hex digits */ + { + if (ptrend - ptr < 4) break; /* Less than 4 chars */ + if ((cc = XDIGIT(ptr[0])) == 0xff) break; /* Not a hex digit */ + if ((xc = XDIGIT(ptr[1])) == 0xff) break; /* Not a hex digit */ + cc = (cc << 4) | xc; + if ((xc = XDIGIT(ptr[2])) == 0xff) break; /* Not a hex digit */ + cc = (cc << 4) | xc; + if ((xc = XDIGIT(ptr[3])) == 0xff) break; /* Not a hex digit */ + c = (cc << 4) | xc; + ptr += 4; + } + if (utf) { if (c > 0x10ffffU) *errorcodeptr = ERR77; else if (c >= 0xd800 && c <= 0xdfff && - (cb->cx->extra_options & PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES) == 0) - *errorcodeptr = ERR73; + (extra_options & PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES) == 0) + *errorcodeptr = ERR73; } else if (c > MAX_NON_UTF_CHAR) *errorcodeptr = ERR77; } break; - /* \U is unrecognized unless PCRE2_ALT_BSUX is set, in which case it is an - upper case letter. */ + /* \U is unrecognized unless PCRE2_ALT_BSUX or PCRE2_EXTRA_ALT_BSUX is set, + in which case it is an upper case letter. */ case CHAR_U: - if ((options & PCRE2_ALT_BSUX) == 0) *errorcodeptr = ERR37; + if (!alt_bsux) *errorcodeptr = ERR37; break; /* In a character class, \g is just a literal "g". Outside a character @@ -1728,8 +1832,8 @@ else } else if (ptr < ptrend && *ptr++ == CHAR_RIGHT_CURLY_BRACKET) { - if (utf && c >= 0xd800 && c <= 0xdfff && (cb == NULL || - (cb->cx->extra_options & PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES) == 0)) + if (utf && c >= 0xd800 && c <= 0xdfff && + (extra_options & PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES) == 0) { ptr--; *errorcodeptr = ERR73; @@ -1743,11 +1847,11 @@ else } break; - /* \x is complicated. When PCRE2_ALT_BSUX is set, \x must be followed by - two hexadecimal digits. Otherwise it is a lowercase x letter. */ + /* When PCRE2_ALT_BSUX or PCRE2_EXTRA_ALT_BSUX is set, \x must be followed + by two hexadecimal digits. Otherwise it is a lowercase x letter. */ case CHAR_x: - if ((options & PCRE2_ALT_BSUX) != 0) + if (alt_bsux) { uint32_t xc; if (ptrend - ptr < 2) break; /* Less than 2 characters */ @@ -1755,9 +1859,9 @@ else if ((xc = XDIGIT(ptr[1])) == 0xff) break; /* Not a hex digit */ c = (cc << 4) | xc; ptr += 2; - } /* End PCRE2_ALT_BSUX handling */ + } - /* Handle \x in Perl's style. \x{ddd} is a character number which can be + /* Handle \x in Perl's style. \x{ddd} is a character code which can be greater than 0xff in UTF-8 or non-8bit mode, but only if the ddd are hex digits. If not, { used to be treated as a data character. However, Perl seems to read hex digits up to the first non-such, and ignore the rest, so @@ -1801,8 +1905,8 @@ else } else if (ptr < ptrend && *ptr++ == CHAR_RIGHT_CURLY_BRACKET) { - if (utf && c >= 0xd800 && c <= 0xdfff && (cb == NULL || - (cb->cx->extra_options & PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES) == 0)) + if (utf && c >= 0xd800 && c <= 0xdfff && + (extra_options & PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES) == 0) { ptr--; *errorcodeptr = ERR73; @@ -1874,9 +1978,9 @@ else c ^= 0x40; /* Handle \c in an EBCDIC environment. The special case \c? is converted to - 255 (0xff) or 95 (0x5f) if other character suggest we are using th POSIX-BC - encoding. (This is the way Perl indicates that it handles \c?.) The other - valid sequences correspond to a list of specific characters. */ + 255 (0xff) or 95 (0x5f) if other characters suggest we are using the + POSIX-BC encoding. (This is the way Perl indicates that it handles \c?.) + The other valid sequences correspond to a list of specific characters. */ #else if (c == CHAR_QUESTION_MARK) @@ -2120,9 +2224,10 @@ return -1; *************************************************/ /* This function is called from parse_regex() below whenever it needs to read -the name of a subpattern or a (*VERB). The initial pointer must be to the -character before the name. If that character is '*' we are reading a verb name. -The pointer is updated to point after the name, for a VERB, or after tha name's +the name of a subpattern or a (*VERB) or an (*alpha_assertion). The initial +pointer must be to the character before the name. If that character is '*' we +are reading a verb or alpha assertion name. The pointer is updated to point +after the name, for a VERB or alpha assertion name, or after tha name's terminator for a subpattern name. Returning both the offset and the name pointer is redundant information, but some callers use one and some the other, so it is simplest just to return both. @@ -2130,6 +2235,7 @@ so it is simplest just to return both. Arguments: ptrptr points to the character pointer variable ptrend points to the end of the input string + utf true if the input is UTF-encoded terminator the terminator of a subpattern name must be this offsetptr where to put the offset from the start of the pattern nameptr where to put a pointer to the name in the input @@ -2142,48 +2248,88 @@ Returns: TRUE if a name was read */ static BOOL -read_name(PCRE2_SPTR *ptrptr, PCRE2_SPTR ptrend, uint32_t terminator, +read_name(PCRE2_SPTR *ptrptr, PCRE2_SPTR ptrend, BOOL utf, uint32_t terminator, PCRE2_SIZE *offsetptr, PCRE2_SPTR *nameptr, uint32_t *namelenptr, int *errorcodeptr, compile_block *cb) { PCRE2_SPTR ptr = *ptrptr; -BOOL is_verb = (*ptr == CHAR_ASTERISK); -uint32_t namelen = 0; -uint32_t ctype = is_verb? ctype_letter : ctype_word; +BOOL is_group = (*ptr != CHAR_ASTERISK); -if (++ptr >= ptrend) +if (++ptr >= ptrend) /* No characters in name */ { - *errorcodeptr = is_verb? ERR60: /* Verb not recognized or malformed */ - ERR62; /* Subpattern name expected */ + *errorcodeptr = is_group? ERR62: /* Subpattern name expected */ + ERR60; /* Verb not recognized or malformed */ goto FAILED; } *nameptr = ptr; *offsetptr = (PCRE2_SIZE)(ptr - cb->start_pattern); -if (IS_DIGIT(*ptr)) +/* In UTF mode, a group name may contain letters and decimal digits as defined +by Unicode properties, and underscores, but must not start with a digit. */ + +#ifdef SUPPORT_UNICODE +if (utf && is_group) { - *errorcodeptr = ERR44; /* Group name must not start with digit */ - goto FAILED; + uint32_t c, type; + + GETCHAR(c, ptr); + type = UCD_CHARTYPE(c); + + if (type == ucp_Nd) + { + *errorcodeptr = ERR44; + goto FAILED; + } + + for(;;) + { + if (type != ucp_Nd && PRIV(ucp_gentype)[type] != ucp_L && + c != CHAR_UNDERSCORE) break; + ptr++; + FORWARDCHARTEST(ptr, ptrend); + if (ptr >= ptrend) break; + GETCHAR(c, ptr); + type = UCD_CHARTYPE(c); + } } +else +#else +(void)utf; /* Avoid compiler warning */ +#endif /* SUPPORT_UNICODE */ + +/* Handle non-group names and group names in non-UTF modes. A group name must +not start with a digit. If either of the others start with a digit it just +won't be recognized. */ -while (ptr < ptrend && MAX_255(*ptr) && (cb->ctypes[*ptr] & ctype) != 0) { - ptr++; - namelen++; - if (namelen > MAX_NAME_SIZE) + if (is_group && IS_DIGIT(*ptr)) { - *errorcodeptr = ERR48; + *errorcodeptr = ERR44; goto FAILED; } + + while (ptr < ptrend && MAX_255(*ptr) && (cb->ctypes[*ptr] & ctype_word) != 0) + { + ptr++; + } } +/* Check name length */ + +if (ptr > *nameptr + MAX_NAME_SIZE) + { + *errorcodeptr = ERR48; + goto FAILED; + } +*namelenptr = ptr - *nameptr; + /* Subpattern names must not be empty, and their terminator is checked here. -(What follows a verb name is checked separately.) */ +(What follows a verb or alpha assertion name is checked separately.) */ -if (!is_verb) +if (is_group) { - if (namelen == 0) + if (ptr == *nameptr) { *errorcodeptr = ERR62; /* Subpattern name expected */ goto FAILED; @@ -2196,7 +2342,6 @@ if (!is_verb) ptr++; } -*namelenptr = namelen; *ptrptr = ptr; return TRUE; @@ -2289,6 +2434,7 @@ typedef struct nest_save { #define NSF_RESET 0x0001u #define NSF_CONDASSERT 0x0002u +#define NSF_ATOMICSR 0x0004u /* Options that are changeable within the pattern must be tracked during parsing. Some (e.g. PCRE2_EXTENDED) are implemented entirely during parsing, @@ -2333,6 +2479,7 @@ uint32_t *parsed_pattern = cb->parsed_pattern; uint32_t *parsed_pattern_end = cb->parsed_pattern_end; uint32_t meta_quantifier = 0; uint32_t add_after_mark = 0; +uint32_t extra_options = cb->cx->extra_options; uint16_t nest_depth = 0; int after_manual_callout = 0; int expect_cond_assert = 0; @@ -2356,12 +2503,12 @@ nest_save *top_nest, *end_nests; /* Insert leading items for word and line matching (features provided for the benefit of pcre2grep). */ -if ((cb->cx->extra_options & PCRE2_EXTRA_MATCH_LINE) != 0) +if ((extra_options & PCRE2_EXTRA_MATCH_LINE) != 0) { *parsed_pattern++ = META_CIRCUMFLEX; *parsed_pattern++ = META_NOCAPTURE; } -else if ((cb->cx->extra_options & PCRE2_EXTRA_MATCH_WORD) != 0) +else if ((extra_options & PCRE2_EXTRA_MATCH_WORD) != 0) { *parsed_pattern++ = META_ESCAPE + ESC_b; *parsed_pattern++ = META_NOCAPTURE; @@ -2526,7 +2673,7 @@ while (ptr < ptrend) if ((options & PCRE2_ALT_VERBNAMES) != 0) { escape = PRIV(check_escape)(&ptr, ptrend, &c, &errorcode, options, - FALSE, cb); + cb->cx->extra_options, FALSE, cb); if (errorcode != 0) goto FAILED; } else escape = 0; /* Treat all as literal */ @@ -2639,23 +2786,30 @@ while (ptr < ptrend) if (expect_cond_assert > 0) { BOOL ok = c == CHAR_LEFT_PARENTHESIS && ptrend - ptr >= 3 && - ptr[0] == CHAR_QUESTION_MARK; - if (ok) switch(ptr[1]) + (ptr[0] == CHAR_QUESTION_MARK || ptr[0] == CHAR_ASTERISK); + if (ok) { - case CHAR_C: - ok = expect_cond_assert == 2; - break; + if (ptr[0] == CHAR_ASTERISK) /* New alpha assertion format, possibly */ + { + ok = MAX_255(ptr[1]) && (cb->ctypes[ptr[1]] & ctype_lcletter) != 0; + } + else switch(ptr[1]) /* Traditional symbolic format */ + { + case CHAR_C: + ok = expect_cond_assert == 2; + break; - case CHAR_EQUALS_SIGN: - case CHAR_EXCLAMATION_MARK: - break; + case CHAR_EQUALS_SIGN: + case CHAR_EXCLAMATION_MARK: + break; - case CHAR_LESS_THAN_SIGN: - ok = ptr[2] == CHAR_EQUALS_SIGN || ptr[2] == CHAR_EXCLAMATION_MARK; - break; + case CHAR_LESS_THAN_SIGN: + ok = ptr[2] == CHAR_EQUALS_SIGN || ptr[2] == CHAR_EXCLAMATION_MARK; + break; - default: - ok = FALSE; + default: + ok = FALSE; + } } if (!ok) @@ -2709,11 +2863,11 @@ while (ptr < ptrend) case CHAR_BACKSLASH: tempptr = ptr; escape = PRIV(check_escape)(&ptr, ptrend, &c, &errorcode, options, - FALSE, cb); + cb->cx->extra_options, FALSE, cb); if (errorcode != 0) { ESCAPE_FAILED: - if ((cb->cx->extra_options & PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL) == 0) + if ((extra_options & PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL) == 0) goto FAILED; ptr = tempptr; if (ptr >= ptrend) c = CHAR_BACKSLASH; else @@ -2907,7 +3061,7 @@ while (ptr < ptrend) /* Not a numerical recursion */ - if (!read_name(&ptr, ptrend, terminator, &offset, &name, &namelen, + if (!read_name(&ptr, ptrend, utf, terminator, &offset, &name, &namelen, &errorcode, cb)) goto ESCAPE_FAILED; /* \k and \g when used with braces are back references, whereas \g used @@ -3270,12 +3424,12 @@ while (ptr < ptrend) else { tempptr = ptr; - escape = PRIV(check_escape)(&ptr, ptrend, &c, &errorcode, - options, TRUE, cb); + escape = PRIV(check_escape)(&ptr, ptrend, &c, &errorcode, options, + cb->cx->extra_options, TRUE, cb); + if (errorcode != 0) { - CLASS_ESCAPE_FAILED: - if ((cb->cx->extra_options & PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL) == 0) + if ((extra_options & PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL) == 0) goto FAILED; ptr = tempptr; if (ptr >= ptrend) c = CHAR_BACKSLASH; else @@ -3285,30 +3439,32 @@ while (ptr < ptrend) escape = 0; /* Treat as literal character */ } - if (escape == 0) /* Escaped character code point is in c */ + switch(escape) { + case 0: /* Escaped character code point is in c */ char_is_literal = FALSE; goto CLASS_LITERAL; - } - - /* These three escapes do not alter the class range state. */ - if (escape == ESC_b) - { - c = CHAR_BS; /* \b is backspace in a class */ + case ESC_b: + c = CHAR_BS; /* \b is backspace in a class */ char_is_literal = FALSE; goto CLASS_LITERAL; - } - else if (escape == ESC_Q) - { + case ESC_Q: inescq = TRUE; /* Enter literal mode */ goto CLASS_CONTINUE; - } - else if (escape == ESC_E) /* Ignore orphan \E */ + case ESC_E: /* Ignore orphan \E */ goto CLASS_CONTINUE; + case ESC_B: /* Always an error in a class */ + case ESC_R: + case ESC_X: + errorcode = ERR7; + ptr--; + goto FAILED; + } + /* The second part of a range can be a single-character escape sequence (detected above), but not any of the other escapes. Perl treats a hyphen as a literal in such circumstances. However, in Perl's @@ -3318,7 +3474,7 @@ while (ptr < ptrend) if (class_range_state == RANGE_STARTED) { errorcode = ERR50; - goto CLASS_ESCAPE_FAILED; + goto FAILED; /* Not CLASS_ESCAPE_FAILED; always an error */ } /* Of the remaining escapes, only those that define characters are @@ -3328,8 +3484,8 @@ while (ptr < ptrend) switch(escape) { case ESC_N: - errorcode = ERR71; /* Not supported in a class */ - goto CLASS_ESCAPE_FAILED; + errorcode = ERR71; + goto FAILED; case ESC_H: case ESC_h: @@ -3392,14 +3548,14 @@ while (ptr < ptrend) } #else errorcode = ERR45; - goto CLASS_ESCAPE_FAILED; + goto FAILED; #endif break; /* End \P and \p */ default: /* All others are not allowed in a class */ errorcode = ERR7; ptr--; - goto CLASS_ESCAPE_FAILED; + goto FAILED; } /* Perl gives a warning unless a following hyphen is the last character @@ -3440,7 +3596,8 @@ while (ptr < ptrend) case CHAR_LEFT_PARENTHESIS: if (ptr >= ptrend) goto UNCLOSED_PARENTHESIS; - /* If ( is not followed by ? it is either a capture or a special verb. */ + /* If ( is not followed by ? it is either a capture or a special verb or an + alpha assertion. */ if (*ptr != CHAR_QUESTION_MARK) { @@ -3460,17 +3617,122 @@ while (ptr < ptrend) else *parsed_pattern++ = META_NOCAPTURE; } + /* Do nothing for (* followed by end of pattern or ) so it gives a "bad + quantifier" error rather than "(*MARK) must have an argument". */ - /* ---- Handle (*VERB) and (*VERB:NAME) ---- */ + else if (ptrend - ptr <= 1 || (c = ptr[1]) == CHAR_RIGHT_PARENTHESIS) + break; + + /* Handle "alpha assertions" such as (*pla:...). Most of these are + synonyms for the historical symbolic assertions, but the script run ones + are new. They are distinguished by starting with a lower case letter. + Checking both ends of the alphabet makes this work in all character + codes. */ + + else if (CHMAX_255(c) && (cb->ctypes[c] & ctype_lcletter) != 0) + { + uint32_t meta; + + vn = alasnames; + if (!read_name(&ptr, ptrend, utf, 0, &offset, &name, &namelen, + &errorcode, cb)) goto FAILED; + if (ptr >= ptrend || *ptr != CHAR_COLON) + { + errorcode = ERR95; /* Malformed */ + goto FAILED; + } + + /* Scan the table of alpha assertion names */ + + for (i = 0; i < alascount; i++) + { + if (namelen == alasmeta[i].len && + PRIV(strncmp_c8)(name, vn, namelen) == 0) + break; + vn += alasmeta[i].len + 1; + } + + if (i >= alascount) + { + errorcode = ERR95; /* Alpha assertion not recognized */ + goto FAILED; + } + + /* Check for expecting an assertion condition. If so, only lookaround + assertions are valid. */ + + meta = alasmeta[i].meta; + if (prev_expect_cond_assert > 0 && + (meta < META_LOOKAHEAD || meta > META_LOOKBEHINDNOT)) + { + errorcode = ERR28; /* Assertion expected */ + goto FAILED; + } + + /* The lookaround alphabetic synonyms can be almost entirely handled by + jumping to the code that handles the traditional symbolic forms. */ + + switch(meta) + { + default: + errorcode = ERR89; /* Unknown code; should never occur because */ + goto FAILED; /* the meta values come from a table above. */ + + case META_ATOMIC: + goto ATOMIC_GROUP; + + case META_LOOKAHEAD: + goto POSITIVE_LOOK_AHEAD; + + case META_LOOKAHEADNOT: + goto NEGATIVE_LOOK_AHEAD; + + case META_LOOKBEHIND: + case META_LOOKBEHINDNOT: + *parsed_pattern++ = meta; + ptr--; + goto POST_LOOKBEHIND; - /* Do nothing for (*) so it gives a "bad quantifier" error rather than - "(*MARK) must have an argument". */ + /* The script run facilities are handled here. Unicode support is + required (give an error if not, as this is a security issue). Always + record a META_SCRIPT_RUN item. Then, for the atomic version, insert + META_ATOMIC and remember that we need two META_KETs at the end. */ - else if (ptrend - ptr > 1 && ptr[1] != CHAR_RIGHT_PARENTHESIS) + case META_SCRIPT_RUN: + case META_ATOMIC_SCRIPT_RUN: +#ifdef SUPPORT_UNICODE + *parsed_pattern++ = META_SCRIPT_RUN; + nest_depth++; + ptr++; + if (meta == META_ATOMIC_SCRIPT_RUN) + { + *parsed_pattern++ = META_ATOMIC; + if (top_nest == NULL) top_nest = (nest_save *)(cb->start_workspace); + else if (++top_nest >= end_nests) + { + errorcode = ERR84; + goto FAILED; + } + top_nest->nest_depth = nest_depth; + top_nest->flags = NSF_ATOMICSR; + top_nest->options = options & PARSE_TRACKED_OPTIONS; + } + break; +#else /* SUPPORT_UNICODE */ + errorcode = ERR96; + goto FAILED; +#endif + } + } + + + /* ---- Handle (*VERB) and (*VERB:NAME) ---- */ + + else { vn = verbnames; - if (!read_name(&ptr, ptrend, 0, &offset, &name, &namelen, &errorcode, - cb)) goto FAILED; + if (!read_name(&ptr, ptrend, utf, 0, &offset, &name, &namelen, + &errorcode, cb)) goto FAILED; if (ptr >= ptrend || (*ptr != CHAR_COLON && *ptr != CHAR_RIGHT_PARENTHESIS)) { @@ -3725,7 +3987,7 @@ while (ptr < ptrend) errorcode = ERR41; goto FAILED; } - if (!read_name(&ptr, ptrend, CHAR_RIGHT_PARENTHESIS, &offset, &name, + if (!read_name(&ptr, ptrend, utf, CHAR_RIGHT_PARENTHESIS, &offset, &name, &namelen, &errorcode, cb)) goto FAILED; *parsed_pattern++ = META_BACKREF_BYNAME; *parsed_pattern++ = namelen; @@ -3785,7 +4047,7 @@ while (ptr < ptrend) case CHAR_AMPERSAND: RECURSE_BY_NAME: - if (!read_name(&ptr, ptrend, CHAR_RIGHT_PARENTHESIS, &offset, &name, + if (!read_name(&ptr, ptrend, utf, CHAR_RIGHT_PARENTHESIS, &offset, &name, &namelen, &errorcode, cb)) goto FAILED; *parsed_pattern++ = META_RECURSE_BYNAME; *parsed_pattern++ = namelen; @@ -3933,14 +4195,15 @@ while (ptr < ptrend) if (++ptr >= ptrend) goto UNCLOSED_PARENTHESIS; nest_depth++; - /* If the next character is ? there must be an assertion next (optionally - preceded by a callout). We do not check this here, but instead we set - expect_cond_assert to 2. If this is still greater than zero (callouts - decrement it) when the next assertion is read, it will be marked as a - condition that must not be repeated. A value greater than zero also - causes checking that an assertion (possibly with callout) follows. */ + /* If the next character is ? or * there must be an assertion next + (optionally preceded by a callout). We do not check this here, but + instead we set expect_cond_assert to 2. If this is still greater than + zero (callouts decrement it) when the next assertion is read, it will be + marked as a condition that must not be repeated. A value greater than + zero also causes checking that an assertion (possibly with callout) + follows. */ - if (*ptr == CHAR_QUESTION_MARK) + if (*ptr == CHAR_QUESTION_MARK || *ptr == CHAR_ASTERISK) { *parsed_pattern++ = META_COND_ASSERT; ptr--; /* Pull pointer back to the opening parenthesis. */ @@ -4032,7 +4295,7 @@ while (ptr < ptrend) terminator = CHAR_RIGHT_PARENTHESIS; ptr--; /* Point to char before name */ } - if (!read_name(&ptr, ptrend, terminator, &offset, &name, &namelen, + if (!read_name(&ptr, ptrend, utf, terminator, &offset, &name, &namelen, &errorcode, cb)) goto FAILED; /* Handle (?(R&name) */ @@ -4086,6 +4349,7 @@ while (ptr < ptrend) /* ---- Atomic group ---- */ case CHAR_GREATER_THAN_SIGN: + ATOMIC_GROUP: /* Come from (*atomic: */ *parsed_pattern++ = META_ATOMIC; nest_depth++; ptr++; @@ -4095,11 +4359,13 @@ while (ptr < ptrend) /* ---- Lookahead assertions ---- */ case CHAR_EQUALS_SIGN: + POSITIVE_LOOK_AHEAD: /* Come from (*pla: */ *parsed_pattern++ = META_LOOKAHEAD; ptr++; goto POST_ASSERTION; case CHAR_EXCLAMATION_MARK: + NEGATIVE_LOOK_AHEAD: /* Come from (*nla: */ *parsed_pattern++ = META_LOOKAHEADNOT; ptr++; goto POST_ASSERTION; @@ -4119,6 +4385,8 @@ while (ptr < ptrend) } *parsed_pattern++ = (ptr[1] == CHAR_EQUALS_SIGN)? META_LOOKBEHIND : META_LOOKBEHINDNOT; + + POST_LOOKBEHIND: /* Come from (*plb: and (*nlb: */ *has_lookbehind = TRUE; offset = (PCRE2_SIZE)(ptr - cb->start_pattern - 2); PUTOFFSET(offset, parsed_pattern); @@ -4161,7 +4429,7 @@ while (ptr < ptrend) terminator = CHAR_APOSTROPHE; /* Terminator */ DEFINE_NAME: - if (!read_name(&ptr, ptrend, terminator, &offset, &name, &namelen, + if (!read_name(&ptr, ptrend, utf, terminator, &offset, &name, &namelen, &errorcode, cb)) goto FAILED; /* We have a name for this capturing group. It is also assigned a number, @@ -4280,6 +4548,14 @@ while (ptr < ptrend) cb->bracount = top_nest->max_group; if ((top_nest->flags & NSF_CONDASSERT) != 0) okquantifier = FALSE; + + if ((top_nest->flags & NSF_ATOMICSR) != 0) + { + *parsed_pattern++ = META_KET; + } + + + if (top_nest == (nest_save *)(cb->start_workspace)) top_nest = NULL; else top_nest--; } @@ -4311,12 +4587,12 @@ parsed_pattern = manage_callouts(ptr, &previous_callout, auto_callout, /* Insert trailing items for word and line matching (features provided for the benefit of pcre2grep). */ -if ((cb->cx->extra_options & PCRE2_EXTRA_MATCH_LINE) != 0) +if ((extra_options & PCRE2_EXTRA_MATCH_LINE) != 0) { *parsed_pattern++ = META_KET; *parsed_pattern++ = META_DOLLAR; } -else if ((cb->cx->extra_options & PCRE2_EXTRA_MATCH_WORD) != 0) +else if ((extra_options & PCRE2_EXTRA_MATCH_WORD) != 0) { *parsed_pattern++ = META_KET; *parsed_pattern++ = META_ESCAPE + ESC_b; @@ -4421,6 +4697,14 @@ for (;;) code += GET(code, 1) + 1 + LINK_SIZE; break; + case OP_MARK: + case OP_COMMIT_ARG: + case OP_PRUNE_ARG: + case OP_SKIP_ARG: + case OP_THEN_ARG: + code += code[1] + PRIV(OP_lengths)[*code]; + break; + default: return code; } @@ -5516,10 +5800,10 @@ for (;; pptr++) if (range_is_literal && (cb->ctypes[c] & ctype_letter) != 0 && (cb->ctypes[d] & ctype_letter) != 0 && - (d <= CHAR_z) == (d <= CHAR_z)) + (c <= CHAR_z) == (d <= CHAR_z)) { uint32_t uc = (d <= CHAR_z)? 0 : 64; - uint32_t C = d - uc; + uint32_t C = c - uc; uint32_t D = d - uc; if (C <= CHAR_i) @@ -5664,7 +5948,10 @@ for (;; pptr++) (void)memmove(code + (32 / sizeof(PCRE2_UCHAR)), code, CU2BYTES(class_uchardata - code)); if (negate_class && !xclass_has_prop) - for (i = 0; i < 32; i++) classbits[i] = ~classbits[i]; + { + /* Using 255 ^ instead of ~ avoids clang sanitize warning. */ + for (i = 0; i < 32; i++) classbits[i] = 255 ^ classbits[i]; + } memcpy(code, classbits, 32); code = class_uchardata + (32 / sizeof(PCRE2_UCHAR)); } @@ -5687,7 +5974,10 @@ for (;; pptr++) if (lengthptr == NULL) /* Save time in the pre-compile phase */ { if (negate_class) - for (i = 0; i < 32; i++) classbits[i] = ~classbits[i]; + { + /* Using 255 ^ instead of ~ avoids clang sanitize warning. */ + for (i = 0; i < 32; i++) classbits[i] = 255 ^ classbits[i]; + } memcpy(code, classbits, 32); } code += 32 / sizeof(PCRE2_UCHAR); @@ -5901,7 +6191,7 @@ for (;; pptr++) } goto GROUP_PROCESS_NOTE_EMPTY; - /* The DEFINE condition is always false. It's internal groups may never + /* The DEFINE condition is always false. Its internal groups may never be called, so matched_char must remain false, hence the jump to GROUP_PROCESS rather than GROUP_PROCESS_NOTE_EMPTY. */ @@ -5997,6 +6287,10 @@ for (;; pptr++) bravalue = OP_ONCE; goto GROUP_PROCESS_NOTE_EMPTY; + case META_SCRIPT_RUN: + bravalue = OP_SCRIPT_RUN; + goto GROUP_PROCESS_NOTE_EMPTY; + case META_NOCAPTURE: bravalue = OP_BRA; /* Fall through */ @@ -6237,8 +6531,8 @@ for (;; pptr++) groupnumber = ng->number; /* For a recursion, that's all that is needed. We can now go to - the code above that handles numerical recursion, applying it to - the first group with the given name. */ + the code that handles numerical recursion, applying it to the first + group with the given name. */ if (meta == META_RECURSE_BYNAME) { @@ -6632,6 +6926,7 @@ for (;; pptr++) case OP_ASSERTBACK: case OP_ASSERTBACK_NOT: case OP_ONCE: + case OP_SCRIPT_RUN: case OP_BRA: case OP_CBRA: case OP_COND: @@ -6844,16 +7139,16 @@ for (;; pptr++) } /* If the maximum is unlimited, set a repeater in the final copy. For - ONCE brackets, that's all we need to do. However, possessively repeated - ONCE brackets can be converted into non-capturing brackets, as the - behaviour of (?:xx)++ is the same as (?>xx)++ and this saves having to - deal with possessive ONCEs specially. + SCRIPT_RUN and ONCE brackets, that's all we need to do. However, + possessively repeated ONCE brackets can be converted into non-capturing + brackets, as the behaviour of (?:xx)++ is the same as (?>xx)++ and this + saves having to deal with possessive ONCEs specially. Otherwise, when we are doing the actual compile phase, check to see whether this group is one that could match an empty string. If so, convert the initial operator to the S form (e.g. OP_BRA -> OP_SBRA) so that runtime checking can be done. [This check is also applied to ONCE - groups at runtime, but in a different way.] + and SCRIPT_RUN groups at runtime, but in a different way.] Then, if the quantifier was possessive and the bracket is not a conditional, we convert the BRA code to the POS form, and the KET code to @@ -6877,13 +7172,14 @@ for (;; pptr++) if (*bracode == OP_ONCE && possessive_quantifier) *bracode = OP_BRA; - /* For non-possessive ONCE brackets, all we need to do is to - set the KET. */ + /* For non-possessive ONCE and for SCRIPT_RUN brackets, all we need + to do is to set the KET. */ - if (*bracode == OP_ONCE) *ketcode = OP_KETRMAX + repeat_type; + if (*bracode == OP_ONCE || *bracode == OP_SCRIPT_RUN) + *ketcode = OP_KETRMAX + repeat_type; - /* Handle non-ONCE brackets and possessive ONCEs (which have been - converted to non-capturing above). */ + /* Handle non-SCRIPT_RUN and non-ONCE brackets and possessive ONCEs + (which have been converted to non-capturing above). */ else { @@ -7267,9 +7563,8 @@ for (;; pptr++) scanned and these numbers are replaced by offsets within the pattern. It is done like this to avoid problems with forward references and adjusting offsets when groups are duplicated and moved (as discovered in previous - implementations). Note that a recursion does not have a set first character - (relevant if it is repeated, because it will then be wrapped with ONCE - brackets). */ + implementations). Note that a recursion does not have a set first + character. */ case META_RECURSE: GETPLUSOFFSET(offset, pptr); @@ -7286,6 +7581,8 @@ for (;; pptr++) groupsetfirstcu = FALSE; cb->had_recurse = TRUE; if (firstcuflags == REQ_UNSET) firstcuflags = REQ_NONE; + zerofirstcu = firstcu; + zerofirstcuflags = firstcuflags; break; @@ -7340,9 +7637,20 @@ for (;; pptr++) { uint32_t ptype = *(++pptr) >> 16; uint32_t pdata = *pptr & 0xffff; - *code++ = (meta_arg == ESC_p)? OP_PROP : OP_NOTPROP; - *code++ = ptype; - *code++ = pdata; + + /* The special case of \p{Any} is compiled to OP_ALLANY so as to benefit + from the auto-anchoring code. */ + + if (meta_arg == ESC_p && ptype == PT_ANY) + { + *code++ = OP_ALLANY; + } + else + { + *code++ = (meta_arg == ESC_p)? OP_PROP : OP_NOTPROP; + *code++ = ptype; + *code++ = pdata; + } break; /* End META_ESCAPE */ } #endif @@ -8240,6 +8548,7 @@ do { case OP_SCBRAPOS: case OP_ASSERT: case OP_ONCE: + case OP_SCRIPT_RUN: d = find_firstassertedcu(scode, &dflags, inassert + ((op==OP_ASSERT)?1:0)); if (dflags < 0) return 0; @@ -8439,6 +8748,7 @@ for (;; pptr++) case META_LOOKBEHIND: case META_LOOKBEHINDNOT: case META_NOCAPTURE: + case META_SCRIPT_RUN: nestlevel++; break; @@ -8851,6 +9161,7 @@ for (;; pptr++) case META_ATOMIC: case META_NOCAPTURE: + case META_SCRIPT_RUN: pptr++; CHECK_GROUP: grouplength = get_grouplength(&pptr, TRUE, errcodeptr, lcptr, group, @@ -9030,6 +9341,7 @@ for (pptr = cb->parsed_pattern; *pptr != META_END; pptr++) case META_QUERY_QUERY: case META_RANGE_ESCAPED: case META_RANGE_LITERAL: + case META_SCRIPT_RUN: case META_SKIP: case META_THEN: break; diff --git a/thirdparty/pcre2/src/pcre2_context.c b/thirdparty/pcre2/src/pcre2_context.c index 2c14df0080..9c2886a6d0 100644 --- a/thirdparty/pcre2/src/pcre2_context.c +++ b/thirdparty/pcre2/src/pcre2_context.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2017 University of Cambridge + New API code Copyright (c) 2016-2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -163,11 +163,13 @@ when no context is supplied to a match function. */ const pcre2_match_context PRIV(default_match_context) = { { default_malloc, default_free, NULL }, #ifdef SUPPORT_JIT - NULL, - NULL, + NULL, /* JIT callback */ + NULL, /* JIT callback data */ #endif - NULL, - NULL, + NULL, /* Callout function */ + NULL, /* Callout data */ + NULL, /* Substitute callout function */ + NULL, /* Substitute callout data */ PCRE2_UNSET, /* Offset limit */ HEAP_LIMIT, MATCH_LIMIT, @@ -404,6 +406,16 @@ return 0; } PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION +pcre2_set_substitute_callout(pcre2_match_context *mcontext, + int (*substitute_callout)(pcre2_substitute_callout_block *, void *), + void *substitute_callout_data) +{ +mcontext->substitute_callout = substitute_callout; +mcontext->substitute_callout_data = substitute_callout_data; +return 0; +} + +PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION pcre2_set_heap_limit(pcre2_match_context *mcontext, uint32_t limit) { mcontext->heap_limit = limit; diff --git a/thirdparty/pcre2/src/pcre2_convert.c b/thirdparty/pcre2/src/pcre2_convert.c index 1dd5c337dc..d45b6fee97 100644 --- a/thirdparty/pcre2/src/pcre2_convert.c +++ b/thirdparty/pcre2/src/pcre2_convert.c @@ -276,7 +276,7 @@ while (plength > 0) break; case CHAR_BACKSLASH: - if (plength <= 0) return PCRE2_ERROR_END_BACKSLASH; + if (plength == 0) return PCRE2_ERROR_END_BACKSLASH; if (extended) nextisliteral = TRUE; else { if (*posix < 127 && strchr(posix_meta_escapes, *posix) != NULL) diff --git a/thirdparty/pcre2/src/pcre2_dfa_match.c b/thirdparty/pcre2/src/pcre2_dfa_match.c index 9b43237da7..bbf3e21064 100644 --- a/thirdparty/pcre2/src/pcre2_dfa_match.c +++ b/thirdparty/pcre2/src/pcre2_dfa_match.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2018 University of Cambridge + New API code Copyright (c) 2016-2019 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -85,7 +85,8 @@ in others, so I abandoned this code. */ #define PUBLIC_DFA_MATCH_OPTIONS \ (PCRE2_ANCHORED|PCRE2_ENDANCHORED|PCRE2_NOTBOL|PCRE2_NOTEOL|PCRE2_NOTEMPTY| \ PCRE2_NOTEMPTY_ATSTART|PCRE2_NO_UTF_CHECK|PCRE2_PARTIAL_HARD| \ - PCRE2_PARTIAL_SOFT|PCRE2_DFA_SHORTEST|PCRE2_DFA_RESTART) + PCRE2_PARTIAL_SOFT|PCRE2_DFA_SHORTEST|PCRE2_DFA_RESTART| \ + PCRE2_COPY_MATCHED_SUBJECT) /************************************************* @@ -173,6 +174,7 @@ static const uint8_t coptable[] = { 0, /* Assert behind */ 0, /* Assert behind not */ 0, /* ONCE */ + 0, /* SCRIPT_RUN */ 0, 0, 0, 0, 0, /* BRA, BRAPOS, CBRA, CBRAPOS, COND */ 0, 0, 0, 0, 0, /* SBRA, SBRAPOS, SCBRA, SCBRAPOS, SCOND */ 0, 0, /* CREF, DNCREF */ @@ -247,6 +249,7 @@ static const uint8_t poptable[] = { 0, /* Assert behind */ 0, /* Assert behind not */ 0, /* ONCE */ + 0, /* SCRIPT_RUN */ 0, 0, 0, 0, 0, /* BRA, BRAPOS, CBRA, CBRAPOS, COND */ 0, 0, 0, 0, 0, /* SBRA, SBRAPOS, SCBRA, SCBRAPOS, SCOND */ 0, 0, /* CREF, DNCREF */ @@ -316,8 +319,8 @@ finding the minimum heap requirement for a match. */ typedef struct RWS_anchor { struct RWS_anchor *next; - unsigned int size; /* Number of ints */ - unsigned int free; /* Number of ints */ + uint32_t size; /* Number of ints */ + uint32_t free; /* Number of ints */ } RWS_anchor; #define RWS_ANCHOR_SIZE (sizeof(RWS_anchor)/sizeof(int)) @@ -413,20 +416,24 @@ if (rws->next != NULL) new = rws->next; } -/* All sizes are in units of sizeof(int), except for mb->heaplimit, which is in -kibibytes. */ +/* Sizes in the RWS_anchor blocks are in units of sizeof(int), but +mb->heap_limit and mb->heap_used are in kibibytes. Play carefully, to avoid +overflow. */ else { - unsigned int newsize = rws->size * 2; - unsigned int heapleft = (unsigned int) - (((1024/sizeof(int))*mb->heap_limit - mb->heap_used)); - if (newsize > heapleft) newsize = heapleft; + uint32_t newsize = (rws->size >= UINT32_MAX/2)? UINT32_MAX/2 : rws->size * 2; + uint32_t newsizeK = newsize/(1024/sizeof(int)); + + if (newsizeK + mb->heap_used > mb->heap_limit) + newsizeK = (uint32_t)(mb->heap_limit - mb->heap_used); + newsize = newsizeK*(1024/sizeof(int)); + if (newsize < RWS_RSIZE + ovecsize + RWS_ANCHOR_SIZE) return PCRE2_ERROR_HEAPLIMIT; new = mb->memctl.malloc(newsize*sizeof(int), mb->memctl.memory_data); if (new == NULL) return PCRE2_ERROR_NOMEMORY; - mb->heap_used += newsize; + mb->heap_used += newsizeK; new->next = NULL; new->size = newsize; rws->next = new; @@ -2560,7 +2567,7 @@ for (;;) if (clen > 0) { isinclass = (c > 255)? (codevalue == OP_NCLASS) : - ((((uint8_t *)(code + 1))[c/8] & (1 << (c&7))) != 0); + ((((uint8_t *)(code + 1))[c/8] & (1u << (c&7))) != 0); } } @@ -2753,7 +2760,7 @@ for (;;) /* There is also an always-true condition */ else if (condcode == OP_TRUE) - { ADD_ACTIVE(state_offset + LINK_SIZE + 2 + IMM2_SIZE, 0); } + { ADD_ACTIVE(state_offset + LINK_SIZE + 2, 0); } /* The only supported version of OP_RREF is for the value RREF_ANY, which means "test if in any recursion". We can't test for specifically @@ -3226,6 +3233,8 @@ pcre2_dfa_match(const pcre2_code *code, PCRE2_SPTR subject, PCRE2_SIZE length, pcre2_match_context *mcontext, int *workspace, PCRE2_SIZE wscount) { int rc; +int was_zero_terminated = 0; + const pcre2_real_code *re = (const pcre2_real_code *)code; PCRE2_SPTR start_match; @@ -3265,7 +3274,11 @@ rws->free = RWS_BASE_SIZE - RWS_ANCHOR_SIZE; /* A length equal to PCRE2_ZERO_TERMINATED implies a zero-terminated subject string. */ -if (length == PCRE2_ZERO_TERMINATED) length = PRIV(strlen)(subject); +if (length == PCRE2_ZERO_TERMINATED) + { + length = PRIV(strlen)(subject); + was_zero_terminated = 1; + } /* Plausibility checks */ @@ -3518,10 +3531,20 @@ if ((re->flags & PCRE2_LASTSET) != 0) } } +/* If the match data block was previously used with PCRE2_COPY_MATCHED_SUBJECT, +free the memory that was obtained. */ + +if ((match_data->flags & PCRE2_MD_COPIED_SUBJECT) != 0) + { + match_data->memctl.free((void *)match_data->subject, + match_data->memctl.memory_data); + match_data->flags &= ~PCRE2_MD_COPIED_SUBJECT; + } + /* Fill in fields that are always returned in the match data. */ match_data->code = re; -match_data->subject = subject; +match_data->subject = NULL; /* Default for no match */ match_data->mark = NULL; match_data->matchedby = PCRE2_MATCHEDBY_DFA_INTERPRETER; @@ -3586,7 +3609,7 @@ for (;;) #if PCRE2_CODE_UNIT_WIDTH != 8 if (c > 255) c = 255; #endif - ok = (start_bits[c/8] & (1 << (c&7))) != 0; + ok = (start_bits[c/8] & (1u << (c&7))) != 0; } } if (!ok) break; @@ -3697,7 +3720,7 @@ for (;;) #if PCRE2_CODE_UNIT_WIDTH != 8 if (c > 255) c = 255; #endif - if ((start_bits[c/8] & (1 << (c&7))) != 0) break; + if ((start_bits[c/8] & (1u << (c&7))) != 0) break; start_match++; } @@ -3816,6 +3839,20 @@ for (;;) match_data->rightchar = (PCRE2_SIZE)( mb->last_used_ptr - subject); match_data->startchar = (PCRE2_SIZE)(start_match - subject); match_data->rc = rc; + + if (rc >= 0 &&(options & PCRE2_COPY_MATCHED_SUBJECT) != 0) + { + length = CU2BYTES(length + was_zero_terminated); + match_data->subject = match_data->memctl.malloc(length, + match_data->memctl.memory_data); + if (match_data->subject == NULL) return PCRE2_ERROR_NOMEMORY; + memcpy((void *)match_data->subject, subject, length); + match_data->flags |= PCRE2_MD_COPIED_SUBJECT; + } + else + { + if (rc >= 0 || rc == PCRE2_ERROR_PARTIAL) match_data->subject = subject; + } goto EXIT; } diff --git a/thirdparty/pcre2/src/pcre2_error.c b/thirdparty/pcre2/src/pcre2_error.c index 4b3b3f1bc0..1d02cf14a3 100644 --- a/thirdparty/pcre2/src/pcre2_error.c +++ b/thirdparty/pcre2/src/pcre2_error.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2018 University of Cambridge + New API code Copyright (c) 2016-2019 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -71,7 +71,7 @@ static const unsigned char compile_error_texts[] = /* 5 */ "number too big in {} quantifier\0" "missing terminating ] for character class\0" - "invalid escape sequence in character class\0" + "escape sequence is invalid in character class\0" "range out of order in character class\0" "quantifier does not follow a repeatable item\0" /* 10 */ @@ -95,7 +95,7 @@ static const unsigned char compile_error_texts[] = /* 25 */ "lookbehind assertion is not fixed length\0" "a relative value of zero is not allowed\0" - "conditional group contains more than two branches\0" + "conditional subpattern contains more than two branches\0" "assertion expected after (?( or (?(?C)\0" "digit expected after (?+ or (?-\0" /* 30 */ @@ -113,21 +113,21 @@ static const unsigned char compile_error_texts[] = /* 40 */ "invalid escape sequence in (*VERB) name\0" "unrecognized character after (?P\0" - "syntax error in subpattern name (missing terminator)\0" + "syntax error in subpattern name (missing terminator?)\0" "two named subpatterns have the same name (PCRE2_DUPNAMES not set)\0" - "group name must start with a non-digit\0" + "subpattern name must start with a non-digit\0" /* 45 */ "this version of PCRE2 does not have support for \\P, \\p, or \\X\0" "malformed \\P or \\p sequence\0" "unknown property name after \\P or \\p\0" - "subpattern name is too long (maximum " XSTRING(MAX_NAME_SIZE) " characters)\0" + "subpattern name is too long (maximum " XSTRING(MAX_NAME_SIZE) " code units)\0" "too many named subpatterns (maximum " XSTRING(MAX_NAME_COUNT) ")\0" /* 50 */ "invalid range in character class\0" "octal value is greater than \\377 in 8-bit non-UTF-8 mode\0" "internal error: overran compiling workspace\0" "internal error: previously-checked referenced subpattern not found\0" - "DEFINE group contains more than one branch\0" + "DEFINE subpattern contains more than one branch\0" /* 55 */ "missing opening brace after \\o\0" "internal error: unknown newline setting\0" @@ -137,7 +137,7 @@ static const unsigned char compile_error_texts[] = "obsolete error (should not occur)\0" /* Was the above */ /* 60 */ "(*VERB) not recognized or malformed\0" - "group number is too big\0" + "subpattern number is too big\0" "subpattern name expected\0" "internal error: parsed pattern overflow\0" "non-octal character in \\o{} (closing brace missing?)\0" @@ -181,6 +181,9 @@ static const unsigned char compile_error_texts[] = "invalid option bits with PCRE2_LITERAL\0" "\\N{U+dddd} is supported only in Unicode (UTF) mode\0" "invalid hyphen in option setting\0" + /* 95 */ + "(*alpha_assertion) not recognized\0" + "script runs require Unicode support, which this version of PCRE2 does not have\0" ; /* Match-time and UTF error texts are in the same format. */ diff --git a/thirdparty/pcre2/src/pcre2_extuni.c b/thirdparty/pcre2/src/pcre2_extuni.c index 237211abf7..5a719e9cb4 100644 --- a/thirdparty/pcre2/src/pcre2_extuni.c +++ b/thirdparty/pcre2/src/pcre2_extuni.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2018 University of Cambridge + New API code Copyright (c) 2016-2019 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -100,7 +100,7 @@ while (eptr < end_subject) int len = 1; if (!utf) c = *eptr; else { GETCHARLEN(c, eptr, len); } rgb = UCD_GRAPHBREAK(c); - if ((PRIV(ucp_gbtable)[lgb] & (1 << rgb)) == 0) break; + if ((PRIV(ucp_gbtable)[lgb] & (1u << rgb)) == 0) break; /* Not breaking between Regional Indicators is allowed only if there are an even number of preceding RIs. */ diff --git a/thirdparty/pcre2/src/pcre2_internal.h b/thirdparty/pcre2/src/pcre2_internal.h index 8750f2f174..814d91bddb 100644 --- a/thirdparty/pcre2/src/pcre2_internal.h +++ b/thirdparty/pcre2/src/pcre2_internal.h @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2018 University of Cambridge + New API code Copyright (c) 2016-2019 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -148,16 +148,7 @@ pcre2_match() because of the way it backtracks. */ /* When checking for integer overflow in pcre2_compile(), we need to handle large integers. If a 64-bit integer type is available, we can use that. Otherwise we have to cast to double, which of course requires floating point -arithmetic. Handle this by defining a macro for the appropriate type. If -stdint.h is available, include it; it may define INT64_MAX. Systems that do not -have stdint.h (e.g. Solaris) may have inttypes.h. The macro int64_t may be set -by "configure". */ - -#if defined HAVE_STDINT_H -#include <stdint.h> -#elif defined HAVE_INTTYPES_H -#include <inttypes.h> -#endif +arithmetic. Handle this by defining a macro for the appropriate type. */ #if defined INT64_MAX || defined int64_t #define INT64_OR_DOUBLE int64_t @@ -535,6 +526,10 @@ enum { PCRE2_MATCHEDBY_INTERPRETER, /* pcre2_match() */ PCRE2_MATCHEDBY_DFA_INTERPRETER, /* pcre2_dfa_match() */ PCRE2_MATCHEDBY_JIT }; /* pcre2_jit_match() */ +/* Values for the flags field in a match data block. */ + +#define PCRE2_MD_COPIED_SUBJECT 0x01u + /* Magic number to provide a small check against being handed junk. */ #define MAGIC_NUMBER 0x50435245UL /* 'PCRE' */ @@ -569,11 +564,11 @@ these tables. */ without checking pcre2_jit_compile.c, which has an assertion to ensure that ctype_word has the value 16. */ -#define ctype_space 0x01 -#define ctype_letter 0x02 -#define ctype_digit 0x04 -#define ctype_xdigit 0x08 /* not actually used any more */ -#define ctype_word 0x10 /* alphanumeric or '_' */ +#define ctype_space 0x01 +#define ctype_letter 0x02 +#define ctype_lcletter 0x04 +#define ctype_digit 0x08 +#define ctype_word 0x10 /* alphanumeric or '_' */ /* Offsets of the various tables from the base tables pointer, and total length of the tables. */ @@ -874,34 +869,48 @@ a positive value. */ #define STR_RIGHT_CURLY_BRACKET "}" #define STR_TILDE "~" -#define STRING_ACCEPT0 "ACCEPT\0" -#define STRING_COMMIT0 "COMMIT\0" -#define STRING_F0 "F\0" -#define STRING_FAIL0 "FAIL\0" -#define STRING_MARK0 "MARK\0" -#define STRING_PRUNE0 "PRUNE\0" -#define STRING_SKIP0 "SKIP\0" -#define STRING_THEN "THEN" - -#define STRING_alpha0 "alpha\0" -#define STRING_lower0 "lower\0" -#define STRING_upper0 "upper\0" -#define STRING_alnum0 "alnum\0" -#define STRING_ascii0 "ascii\0" -#define STRING_blank0 "blank\0" -#define STRING_cntrl0 "cntrl\0" -#define STRING_digit0 "digit\0" -#define STRING_graph0 "graph\0" -#define STRING_print0 "print\0" -#define STRING_punct0 "punct\0" -#define STRING_space0 "space\0" -#define STRING_word0 "word\0" -#define STRING_xdigit "xdigit" - -#define STRING_DEFINE "DEFINE" -#define STRING_VERSION "VERSION" -#define STRING_WEIRD_STARTWORD "[:<:]]" -#define STRING_WEIRD_ENDWORD "[:>:]]" +#define STRING_ACCEPT0 "ACCEPT\0" +#define STRING_COMMIT0 "COMMIT\0" +#define STRING_F0 "F\0" +#define STRING_FAIL0 "FAIL\0" +#define STRING_MARK0 "MARK\0" +#define STRING_PRUNE0 "PRUNE\0" +#define STRING_SKIP0 "SKIP\0" +#define STRING_THEN "THEN" + +#define STRING_atomic0 "atomic\0" +#define STRING_pla0 "pla\0" +#define STRING_plb0 "plb\0" +#define STRING_nla0 "nla\0" +#define STRING_nlb0 "nlb\0" +#define STRING_sr0 "sr\0" +#define STRING_asr0 "asr\0" +#define STRING_positive_lookahead0 "positive_lookahead\0" +#define STRING_positive_lookbehind0 "positive_lookbehind\0" +#define STRING_negative_lookahead0 "negative_lookahead\0" +#define STRING_negative_lookbehind0 "negative_lookbehind\0" +#define STRING_script_run0 "script_run\0" +#define STRING_atomic_script_run "atomic_script_run" + +#define STRING_alpha0 "alpha\0" +#define STRING_lower0 "lower\0" +#define STRING_upper0 "upper\0" +#define STRING_alnum0 "alnum\0" +#define STRING_ascii0 "ascii\0" +#define STRING_blank0 "blank\0" +#define STRING_cntrl0 "cntrl\0" +#define STRING_digit0 "digit\0" +#define STRING_graph0 "graph\0" +#define STRING_print0 "print\0" +#define STRING_punct0 "punct\0" +#define STRING_space0 "space\0" +#define STRING_word0 "word\0" +#define STRING_xdigit "xdigit" + +#define STRING_DEFINE "DEFINE" +#define STRING_VERSION "VERSION" +#define STRING_WEIRD_STARTWORD "[:<:]]" +#define STRING_WEIRD_ENDWORD "[:>:]]" #define STRING_CR_RIGHTPAR "CR)" #define STRING_LF_RIGHTPAR "LF)" @@ -1150,34 +1159,48 @@ only. */ #define STR_RIGHT_CURLY_BRACKET "\175" #define STR_TILDE "\176" -#define STRING_ACCEPT0 STR_A STR_C STR_C STR_E STR_P STR_T "\0" -#define STRING_COMMIT0 STR_C STR_O STR_M STR_M STR_I STR_T "\0" -#define STRING_F0 STR_F "\0" -#define STRING_FAIL0 STR_F STR_A STR_I STR_L "\0" -#define STRING_MARK0 STR_M STR_A STR_R STR_K "\0" -#define STRING_PRUNE0 STR_P STR_R STR_U STR_N STR_E "\0" -#define STRING_SKIP0 STR_S STR_K STR_I STR_P "\0" -#define STRING_THEN STR_T STR_H STR_E STR_N - -#define STRING_alpha0 STR_a STR_l STR_p STR_h STR_a "\0" -#define STRING_lower0 STR_l STR_o STR_w STR_e STR_r "\0" -#define STRING_upper0 STR_u STR_p STR_p STR_e STR_r "\0" -#define STRING_alnum0 STR_a STR_l STR_n STR_u STR_m "\0" -#define STRING_ascii0 STR_a STR_s STR_c STR_i STR_i "\0" -#define STRING_blank0 STR_b STR_l STR_a STR_n STR_k "\0" -#define STRING_cntrl0 STR_c STR_n STR_t STR_r STR_l "\0" -#define STRING_digit0 STR_d STR_i STR_g STR_i STR_t "\0" -#define STRING_graph0 STR_g STR_r STR_a STR_p STR_h "\0" -#define STRING_print0 STR_p STR_r STR_i STR_n STR_t "\0" -#define STRING_punct0 STR_p STR_u STR_n STR_c STR_t "\0" -#define STRING_space0 STR_s STR_p STR_a STR_c STR_e "\0" -#define STRING_word0 STR_w STR_o STR_r STR_d "\0" -#define STRING_xdigit STR_x STR_d STR_i STR_g STR_i STR_t - -#define STRING_DEFINE STR_D STR_E STR_F STR_I STR_N STR_E -#define STRING_VERSION STR_V STR_E STR_R STR_S STR_I STR_O STR_N -#define STRING_WEIRD_STARTWORD STR_LEFT_SQUARE_BRACKET STR_COLON STR_LESS_THAN_SIGN STR_COLON STR_RIGHT_SQUARE_BRACKET STR_RIGHT_SQUARE_BRACKET -#define STRING_WEIRD_ENDWORD STR_LEFT_SQUARE_BRACKET STR_COLON STR_GREATER_THAN_SIGN STR_COLON STR_RIGHT_SQUARE_BRACKET STR_RIGHT_SQUARE_BRACKET +#define STRING_ACCEPT0 STR_A STR_C STR_C STR_E STR_P STR_T "\0" +#define STRING_COMMIT0 STR_C STR_O STR_M STR_M STR_I STR_T "\0" +#define STRING_F0 STR_F "\0" +#define STRING_FAIL0 STR_F STR_A STR_I STR_L "\0" +#define STRING_MARK0 STR_M STR_A STR_R STR_K "\0" +#define STRING_PRUNE0 STR_P STR_R STR_U STR_N STR_E "\0" +#define STRING_SKIP0 STR_S STR_K STR_I STR_P "\0" +#define STRING_THEN STR_T STR_H STR_E STR_N + +#define STRING_atomic0 STR_a STR_t STR_o STR_m STR_i STR_c "\0" +#define STRING_pla0 STR_p STR_l STR_a "\0" +#define STRING_plb0 STR_p STR_l STR_b "\0" +#define STRING_nla0 STR_n STR_l STR_a "\0" +#define STRING_nlb0 STR_n STR_l STR_b "\0" +#define STRING_sr0 STR_s STR_r "\0" +#define STRING_asr0 STR_a STR_s STR_r "\0" +#define STRING_positive_lookahead0 STR_p STR_o STR_s STR_i STR_t STR_i STR_v STR_e STR_UNDERSCORE STR_l STR_o STR_o STR_k STR_a STR_h STR_e STR_a STR_d "\0" +#define STRING_positive_lookbehind0 STR_p STR_o STR_s STR_i STR_t STR_i STR_v STR_e STR_UNDERSCORE STR_l STR_o STR_o STR_k STR_b STR_e STR_h STR_i STR_n STR_d "\0" +#define STRING_negative_lookahead0 STR_n STR_e STR_g STR_a STR_t STR_i STR_v STR_e STR_UNDERSCORE STR_l STR_o STR_o STR_k STR_a STR_h STR_e STR_a STR_d "\0" +#define STRING_negative_lookbehind0 STR_n STR_e STR_g STR_a STR_t STR_i STR_v STR_e STR_UNDERSCORE STR_l STR_o STR_o STR_k STR_b STR_e STR_h STR_i STR_n STR_d "\0" +#define STRING_script_run0 STR_s STR_c STR_r STR_i STR_p STR_t STR_UNDERSCORE STR_r STR_u STR_n "\0" +#define STRING_atomic_script_run STR_a STR_t STR_o STR_m STR_i STR_c STR_UNDERSCORE STR_s STR_c STR_r STR_i STR_p STR_t STR_UNDERSCORE STR_r STR_u STR_n + +#define STRING_alpha0 STR_a STR_l STR_p STR_h STR_a "\0" +#define STRING_lower0 STR_l STR_o STR_w STR_e STR_r "\0" +#define STRING_upper0 STR_u STR_p STR_p STR_e STR_r "\0" +#define STRING_alnum0 STR_a STR_l STR_n STR_u STR_m "\0" +#define STRING_ascii0 STR_a STR_s STR_c STR_i STR_i "\0" +#define STRING_blank0 STR_b STR_l STR_a STR_n STR_k "\0" +#define STRING_cntrl0 STR_c STR_n STR_t STR_r STR_l "\0" +#define STRING_digit0 STR_d STR_i STR_g STR_i STR_t "\0" +#define STRING_graph0 STR_g STR_r STR_a STR_p STR_h "\0" +#define STRING_print0 STR_p STR_r STR_i STR_n STR_t "\0" +#define STRING_punct0 STR_p STR_u STR_n STR_c STR_t "\0" +#define STRING_space0 STR_s STR_p STR_a STR_c STR_e "\0" +#define STRING_word0 STR_w STR_o STR_r STR_d "\0" +#define STRING_xdigit STR_x STR_d STR_i STR_g STR_i STR_t + +#define STRING_DEFINE STR_D STR_E STR_F STR_I STR_N STR_E +#define STRING_VERSION STR_V STR_E STR_R STR_S STR_I STR_O STR_N +#define STRING_WEIRD_STARTWORD STR_LEFT_SQUARE_BRACKET STR_COLON STR_LESS_THAN_SIGN STR_COLON STR_RIGHT_SQUARE_BRACKET STR_RIGHT_SQUARE_BRACKET +#define STRING_WEIRD_ENDWORD STR_LEFT_SQUARE_BRACKET STR_COLON STR_GREATER_THAN_SIGN STR_COLON STR_RIGHT_SQUARE_BRACKET STR_RIGHT_SQUARE_BRACKET #define STRING_CR_RIGHTPAR STR_C STR_R STR_RIGHT_PARENTHESIS #define STRING_LF_RIGHTPAR STR_L STR_F STR_RIGHT_PARENTHESIS @@ -1485,70 +1508,71 @@ enum { OP_ASSERTBACK, /* 128 Positive lookbehind */ OP_ASSERTBACK_NOT, /* 129 Negative lookbehind */ - /* ONCE, BRA, BRAPOS, CBRA, CBRAPOS, and COND must come immediately after the - assertions, with ONCE first, as there's a test for >= ONCE for a subpattern - that isn't an assertion. The POS versions must immediately follow the non-POS - versions in each case. */ + /* ONCE, SCRIPT_RUN, BRA, BRAPOS, CBRA, CBRAPOS, and COND must come + immediately after the assertions, with ONCE first, as there's a test for >= + ONCE for a subpattern that isn't an assertion. The POS versions must + immediately follow the non-POS versions in each case. */ OP_ONCE, /* 130 Atomic group, contains captures */ - OP_BRA, /* 131 Start of non-capturing bracket */ - OP_BRAPOS, /* 132 Ditto, with unlimited, possessive repeat */ - OP_CBRA, /* 133 Start of capturing bracket */ - OP_CBRAPOS, /* 134 Ditto, with unlimited, possessive repeat */ - OP_COND, /* 135 Conditional group */ + OP_SCRIPT_RUN, /* 131 Non-capture, but check characters' scripts */ + OP_BRA, /* 132 Start of non-capturing bracket */ + OP_BRAPOS, /* 133 Ditto, with unlimited, possessive repeat */ + OP_CBRA, /* 134 Start of capturing bracket */ + OP_CBRAPOS, /* 135 Ditto, with unlimited, possessive repeat */ + OP_COND, /* 136 Conditional group */ /* These five must follow the previous five, in the same order. There's a check for >= SBRA to distinguish the two sets. */ - OP_SBRA, /* 136 Start of non-capturing bracket, check empty */ - OP_SBRAPOS, /* 137 Ditto, with unlimited, possessive repeat */ - OP_SCBRA, /* 138 Start of capturing bracket, check empty */ - OP_SCBRAPOS, /* 139 Ditto, with unlimited, possessive repeat */ - OP_SCOND, /* 140 Conditional group, check empty */ + OP_SBRA, /* 137 Start of non-capturing bracket, check empty */ + OP_SBRAPOS, /* 138 Ditto, with unlimited, possessive repeat */ + OP_SCBRA, /* 139 Start of capturing bracket, check empty */ + OP_SCBRAPOS, /* 140 Ditto, with unlimited, possessive repeat */ + OP_SCOND, /* 141 Conditional group, check empty */ /* The next two pairs must (respectively) be kept together. */ - OP_CREF, /* 141 Used to hold a capture number as condition */ - OP_DNCREF, /* 142 Used to point to duplicate names as a condition */ - OP_RREF, /* 143 Used to hold a recursion number as condition */ - OP_DNRREF, /* 144 Used to point to duplicate names as a condition */ - OP_FALSE, /* 145 Always false (used by DEFINE and VERSION) */ - OP_TRUE, /* 146 Always true (used by VERSION) */ + OP_CREF, /* 142 Used to hold a capture number as condition */ + OP_DNCREF, /* 143 Used to point to duplicate names as a condition */ + OP_RREF, /* 144 Used to hold a recursion number as condition */ + OP_DNRREF, /* 145 Used to point to duplicate names as a condition */ + OP_FALSE, /* 146 Always false (used by DEFINE and VERSION) */ + OP_TRUE, /* 147 Always true (used by VERSION) */ - OP_BRAZERO, /* 147 These two must remain together and in this */ - OP_BRAMINZERO, /* 148 order. */ - OP_BRAPOSZERO, /* 149 */ + OP_BRAZERO, /* 148 These two must remain together and in this */ + OP_BRAMINZERO, /* 149 order. */ + OP_BRAPOSZERO, /* 150 */ /* These are backtracking control verbs */ - OP_MARK, /* 150 always has an argument */ - OP_PRUNE, /* 151 */ - OP_PRUNE_ARG, /* 152 same, but with argument */ - OP_SKIP, /* 153 */ - OP_SKIP_ARG, /* 154 same, but with argument */ - OP_THEN, /* 155 */ - OP_THEN_ARG, /* 156 same, but with argument */ - OP_COMMIT, /* 157 */ - OP_COMMIT_ARG, /* 158 same, but with argument */ + OP_MARK, /* 151 always has an argument */ + OP_PRUNE, /* 152 */ + OP_PRUNE_ARG, /* 153 same, but with argument */ + OP_SKIP, /* 154 */ + OP_SKIP_ARG, /* 155 same, but with argument */ + OP_THEN, /* 156 */ + OP_THEN_ARG, /* 157 same, but with argument */ + OP_COMMIT, /* 158 */ + OP_COMMIT_ARG, /* 159 same, but with argument */ /* These are forced failure and success verbs. FAIL and ACCEPT do accept an argument, but these cases can be compiled as, for example, (*MARK:X)(*FAIL) without the need for a special opcode. */ - OP_FAIL, /* 159 */ - OP_ACCEPT, /* 160 */ - OP_ASSERT_ACCEPT, /* 161 Used inside assertions */ - OP_CLOSE, /* 162 Used before OP_ACCEPT to close open captures */ + OP_FAIL, /* 160 */ + OP_ACCEPT, /* 161 */ + OP_ASSERT_ACCEPT, /* 162 Used inside assertions */ + OP_CLOSE, /* 163 Used before OP_ACCEPT to close open captures */ /* This is used to skip a subpattern with a {0} quantifier */ - OP_SKIPZERO, /* 163 */ + OP_SKIPZERO, /* 164 */ /* This is used to identify a DEFINE group during compilation so that it can be checked for having only one branch. It is changed to OP_FALSE before compilation finishes. */ - OP_DEFINE, /* 164 */ + OP_DEFINE, /* 165 */ /* This is not an opcode, but is used to check that tables indexed by opcode are the correct length, in order to catch updating errors - there have been @@ -1596,6 +1620,7 @@ some cases doesn't actually use these names at all). */ "Alt", "Ket", "KetRmax", "KetRmin", "KetRpos", \ "Reverse", "Assert", "Assert not", "AssertB", "AssertB not", \ "Once", \ + "Script run", \ "Bra", "BraPos", "CBra", "CBraPos", \ "Cond", \ "SBra", "SBraPos", "SCBra", "SCBraPos", \ @@ -1679,6 +1704,7 @@ in UTF-8 mode. The code that uses this table must know about such things. */ 1+LINK_SIZE, /* Assert behind */ \ 1+LINK_SIZE, /* Assert behind not */ \ 1+LINK_SIZE, /* ONCE */ \ + 1+LINK_SIZE, /* SCRIPT_RUN */ \ 1+LINK_SIZE, /* BRA */ \ 1+LINK_SIZE, /* BRAPOS */ \ 1+LINK_SIZE+IMM2_SIZE, /* CBRA */ \ @@ -1747,6 +1773,8 @@ typedef struct { uint8_t gbprop; /* ucp_gbControl, etc. (grapheme break property) */ uint8_t caseset; /* offset to multichar other cases or zero */ int32_t other_case; /* offset to other case, or zero if none */ + int16_t scriptx; /* script extension value */ + int16_t dummy; /* spare - to round to multiple of 4 bytes */ } ucd_record; /* UCD access macros */ @@ -1769,6 +1797,7 @@ typedef struct { #define UCD_GRAPHBREAK(ch) GET_UCD(ch)->gbprop #define UCD_CASESET(ch) GET_UCD(ch)->caseset #define UCD_OTHERCASE(ch) ((uint32_t)((int)ch + (int)(GET_UCD(ch)->other_case))) +#define UCD_SCRIPTX(ch) GET_UCD(ch)->scriptx /* Header for serialized pcre2 codes. */ @@ -1826,6 +1855,8 @@ extern const uint8_t PRIV(utf8_table4)[]; #define _pcre2_hspace_list PCRE2_SUFFIX(_pcre2_hspace_list_) #define _pcre2_vspace_list PCRE2_SUFFIX(_pcre2_vspace_list_) #define _pcre2_ucd_caseless_sets PCRE2_SUFFIX(_pcre2_ucd_caseless_sets_) +#define _pcre2_ucd_digit_sets PCRE2_SUFFIX(_pcre2_ucd_digit_sets_) +#define _pcre2_ucd_script_sets PCRE2_SUFFIX(_pcre2_ucd_script_sets_) #define _pcre2_ucd_records PCRE2_SUFFIX(_pcre2_ucd_records_) #define _pcre2_ucd_stage1 PCRE2_SUFFIX(_pcre2_ucd_stage1_) #define _pcre2_ucd_stage2 PCRE2_SUFFIX(_pcre2_ucd_stage2_) @@ -1847,6 +1878,8 @@ extern const uint8_t PRIV(default_tables)[]; extern const uint32_t PRIV(hspace_list)[]; extern const uint32_t PRIV(vspace_list)[]; extern const uint32_t PRIV(ucd_caseless_sets)[]; +extern const uint32_t PRIV(ucd_digit_sets)[]; +extern const uint8_t PRIV(ucd_script_sets)[]; extern const ucd_record PRIV(ucd_records)[]; #if PCRE2_CODE_UNIT_WIDTH == 32 extern const ucd_record PRIV(dummy_ucd_record)[]; @@ -1894,6 +1927,7 @@ is available. */ #define _pcre2_jit_get_target PCRE2_SUFFIX(_pcre2_jit_get_target_) #define _pcre2_memctl_malloc PCRE2_SUFFIX(_pcre2_memctl_malloc_) #define _pcre2_ord2utf PCRE2_SUFFIX(_pcre2_ord2utf_) +#define _pcre2_script_run PCRE2_SUFFIX(_pcre2_script_run_) #define _pcre2_strcmp PCRE2_SUFFIX(_pcre2_strcmp_) #define _pcre2_strcmp_c8 PCRE2_SUFFIX(_pcre2_strcmp_c8_) #define _pcre2_strcpy_c8 PCRE2_SUFFIX(_pcre2_strcpy_c8_) @@ -1908,7 +1942,7 @@ is available. */ extern int _pcre2_auto_possessify(PCRE2_UCHAR *, BOOL, const compile_block *); extern int _pcre2_check_escape(PCRE2_SPTR *, PCRE2_SPTR, uint32_t *, - int *, uint32_t, BOOL, compile_block *); + int *, uint32_t, uint32_t, BOOL, compile_block *); extern PCRE2_SPTR _pcre2_extuni(uint32_t, PCRE2_SPTR, PCRE2_SPTR, PCRE2_SPTR, BOOL, int *); extern PCRE2_SPTR _pcre2_find_bracket(PCRE2_SPTR, BOOL, int); @@ -1920,6 +1954,7 @@ extern size_t _pcre2_jit_get_size(void *); const char * _pcre2_jit_get_target(void); extern void * _pcre2_memctl_malloc(size_t, pcre2_memctl *); extern unsigned int _pcre2_ord2utf(uint32_t, PCRE2_UCHAR *); +extern BOOL _pcre2_script_run(PCRE2_SPTR, PCRE2_SPTR, BOOL); extern int _pcre2_strcmp(PCRE2_SPTR, PCRE2_SPTR); extern int _pcre2_strcmp_c8(PCRE2_SPTR, const char *); extern PCRE2_SIZE _pcre2_strcpy_c8(PCRE2_UCHAR *, const char *); diff --git a/thirdparty/pcre2/src/pcre2_intmodedep.h b/thirdparty/pcre2/src/pcre2_intmodedep.h index 62626d0a8a..bf3a235984 100644 --- a/thirdparty/pcre2/src/pcre2_intmodedep.h +++ b/thirdparty/pcre2/src/pcre2_intmodedep.h @@ -585,6 +585,8 @@ typedef struct pcre2_real_match_context { #endif int (*callout)(pcre2_callout_block *, void *); void *callout_data; + int (*substitute_callout)(pcre2_substitute_callout_block *, void *); + void *substitute_callout_data; PCRE2_SIZE offset_limit; uint32_t heap_limit; uint32_t match_limit; @@ -656,7 +658,8 @@ typedef struct pcre2_real_match_data { PCRE2_SIZE leftchar; /* Offset to leftmost code unit */ PCRE2_SIZE rightchar; /* Offset to rightmost code unit */ PCRE2_SIZE startchar; /* Offset to starting code unit */ - uint16_t matchedby; /* Type of match (normal, JIT, DFA) */ + uint8_t matchedby; /* Type of match (normal, JIT, DFA) */ + uint8_t flags; /* Various flags */ uint16_t oveccount; /* Number of pairs */ int rc; /* The return code from the match */ PCRE2_SIZE ovector[131072]; /* Must be last in the structure */ diff --git a/thirdparty/pcre2/src/pcre2_jit_compile.c b/thirdparty/pcre2/src/pcre2_jit_compile.c index 32e985b793..1f21bfb6ad 100644 --- a/thirdparty/pcre2/src/pcre2_jit_compile.c +++ b/thirdparty/pcre2/src/pcre2_jit_compile.c @@ -477,12 +477,22 @@ typedef struct compiler_common { BOOL alt_circumflex; #ifdef SUPPORT_UNICODE BOOL utf; + BOOL invalid_utf; BOOL use_ucp; + /* Points to saving area for iref. */ + sljit_s32 iref_ptr; jump_list *getucd; + jump_list *getucdtype; #if PCRE2_CODE_UNIT_WIDTH == 8 jump_list *utfreadchar; - jump_list *utfreadchar16; jump_list *utfreadtype8; + jump_list *utfpeakcharback; +#endif +#if PCRE2_CODE_UNIT_WIDTH == 8 || PCRE2_CODE_UNIT_WIDTH == 16 + jump_list *utfreadchar_invalid; + jump_list *utfreadnewline_invalid; + jump_list *utfmoveback_invalid; + jump_list *utfpeakcharback_invalid; #endif #endif /* SUPPORT_UNICODE */ } compiler_common; @@ -616,7 +626,183 @@ the start pointers when the end of the capturing group has not yet reached. */ #define READ_CHAR_MAX 0x7fffffff -#define INVALID_UTF_CHAR 888 +#define INVALID_UTF_CHAR -1 +#define UNASSIGNED_UTF_CHAR 888 + +#if defined SUPPORT_UNICODE +#if PCRE2_CODE_UNIT_WIDTH == 8 + +#define GETCHARINC_INVALID(c, ptr, end, invalid_action) \ + { \ + if (ptr[0] <= 0x7f) \ + c = *ptr++; \ + else if (ptr + 1 < end && ptr[1] >= 0x80 && ptr[1] < 0xc0) \ + { \ + c = ptr[1] - 0x80; \ + \ + if (ptr[0] >= 0xc2 && ptr[0] <= 0xdf) \ + { \ + c |= (ptr[0] - 0xc0) << 6; \ + ptr += 2; \ + } \ + else if (ptr + 2 < end && ptr[2] >= 0x80 && ptr[2] < 0xc0) \ + { \ + c = c << 6 | (ptr[2] - 0x80); \ + \ + if (ptr[0] >= 0xe0 && ptr[0] <= 0xef) \ + { \ + c |= (ptr[0] - 0xe0) << 12; \ + ptr += 3; \ + \ + if (c < 0x800 || (c >= 0xd800 && c < 0xe000)) \ + { \ + invalid_action; \ + } \ + } \ + else if (ptr + 3 < end && ptr[3] >= 0x80 && ptr[3] < 0xc0) \ + { \ + c = c << 6 | (ptr[3] - 0x80); \ + \ + if (ptr[0] >= 0xf0 && ptr[0] <= 0xf4) \ + { \ + c |= (ptr[0] - 0xf0) << 18; \ + ptr += 4; \ + \ + if (c >= 0x110000 || c < 0x10000) \ + { \ + invalid_action; \ + } \ + } \ + else \ + { \ + invalid_action; \ + } \ + } \ + else \ + { \ + invalid_action; \ + } \ + } \ + else \ + { \ + invalid_action; \ + } \ + } \ + else \ + { \ + invalid_action; \ + } \ + } + +#define GETCHARBACK_INVALID(c, ptr, start, invalid_action) \ + { \ + if (ptr[-1] <= 0x7f) \ + c = *ptr--; \ + else if (ptr - 1 > start && ptr[-1] >= 0x80 && ptr[-1] < 0xc0) \ + { \ + c = ptr[-1] - 0x80; \ + \ + if (ptr[-2] >= 0xc2 && ptr[-2] <= 0xdf) \ + { \ + c |= (ptr[-2] - 0xc0) << 6; \ + ptr -= 2; \ + } \ + else if (ptr - 2 > start && ptr[-2] >= 0x80 && ptr[-2] < 0xc0) \ + { \ + c = c << 6 | (ptr[-2] - 0x80); \ + \ + if (ptr[-3] >= 0xe0 && ptr[-3] <= 0xef) \ + { \ + c |= (ptr[-3] - 0xe0) << 12; \ + ptr -= 3; \ + \ + if (c < 0x800 || (c >= 0xd800 && c < 0xe000)) \ + { \ + invalid_action; \ + } \ + } \ + else if (ptr - 3 > start && ptr[-3] >= 0x80 && ptr[-3] < 0xc0) \ + { \ + c = c << 6 | (ptr[-3] - 0x80); \ + \ + if (ptr[-4] >= 0xf0 && ptr[-4] <= 0xf4) \ + { \ + c |= (ptr[-4] - 0xf0) << 18; \ + ptr -= 4; \ + \ + if (c >= 0x110000 || c < 0x10000) \ + { \ + invalid_action; \ + } \ + } \ + else \ + { \ + invalid_action; \ + } \ + } \ + else \ + { \ + invalid_action; \ + } \ + } \ + else \ + { \ + invalid_action; \ + } \ + } \ + else \ + { \ + invalid_action; \ + } \ + } + +#elif PCRE2_CODE_UNIT_WIDTH == 16 + +#define GETCHARINC_INVALID(c, ptr, end, invalid_action) \ + { \ + if (ptr[0] < 0xd800 || ptr[0] >= 0xe000) \ + c = *ptr++; \ + else if (ptr[0] < 0xdc00 && ptr + 1 < end && ptr[1] >= 0xdc00 && ptr[1] < 0xe000) \ + { \ + c = (((ptr[0] - 0xd800) << 10) | (ptr[1] - 0xdc00)) + 0x10000; \ + ptr += 2; \ + } \ + else \ + { \ + invalid_action; \ + } \ + } + +#define GETCHARBACK_INVALID(c, ptr, start, invalid_action) \ + { \ + if (ptr[-1] < 0xd800 || ptr[-1] >= 0xe000) \ + c = *ptr--; \ + else if (ptr[-1] >= 0xdc00 && ptr - 1 > start && ptr[-2] >= 0xd800 && ptr[-2] < 0xdc00) \ + { \ + c = (((ptr[-2] - 0xd800) << 10) | (ptr[-1] - 0xdc00)) + 0x10000; \ + ptr -= 2; \ + } \ + else \ + { \ + invalid_action; \ + } \ + } + + +#elif PCRE2_CODE_UNIT_WIDTH == 32 + +#define GETCHARINC_INVALID(c, ptr, end, invalid_action) \ + { \ + if (ptr[0] < 0x110000) \ + c = *ptr++; \ + else \ + { \ + invalid_action; \ + } \ + } + +#endif /* PCRE2_CODE_UNIT_WIDTH == [8|16|32] */ +#endif /* SUPPORT_UNICODE */ static PCRE2_SPTR bracketend(PCRE2_SPTR cc) { @@ -716,6 +902,7 @@ switch(*cc) case OP_ASSERTBACK: case OP_ASSERTBACK_NOT: case OP_ONCE: + case OP_SCRIPT_RUN: case OP_BRA: case OP_BRAPOS: case OP_CBRA: @@ -869,8 +1056,16 @@ while (cc < ccend) cc += 1; break; - case OP_REF: case OP_REFI: +#ifdef SUPPORT_UNICODE + if (common->iref_ptr == 0) + { + common->iref_ptr = common->ovector_start; + common->ovector_start += 3 * sizeof(sljit_sw); + } +#endif /* SUPPORT_UNICODE */ + /* Fall through. */ + case OP_REF: common->optimized_cbracket[GET2(cc, 1)] = 0; cc += 1 + IMM2_SIZE; break; @@ -1375,6 +1570,7 @@ while (cc < ccend) case OP_ASSERTBACK: case OP_ASSERTBACK_NOT: case OP_ONCE: + case OP_SCRIPT_RUN: case OP_BRAPOS: case OP_SBRA: case OP_SBRAPOS: @@ -1951,6 +2147,7 @@ while (cc < ccend) case OP_ASSERTBACK: case OP_ASSERTBACK_NOT: case OP_ONCE: + case OP_SCRIPT_RUN: case OP_BRAPOS: case OP_SBRA: case OP_SBRAPOS: @@ -2174,14 +2371,14 @@ if (base_reg != TMP2) else { status.saved_tmp_regs[1] = RETURN_ADDR; - if (sljit_get_register_index (RETURN_ADDR) == -1) + if (sljit_get_register_index(RETURN_ADDR) == -1) status.tmp_regs[1] = STR_PTR; else status.tmp_regs[1] = RETURN_ADDR; } status.saved_tmp_regs[2] = TMP3; -if (sljit_get_register_index (TMP3) == -1) +if (sljit_get_register_index(TMP3) == -1) status.tmp_regs[2] = STR_END; else status.tmp_regs[2] = TMP3; @@ -2274,6 +2471,7 @@ while (cc < ccend) case OP_ASSERTBACK: case OP_ASSERTBACK_NOT: case OP_ONCE: + case OP_SCRIPT_RUN: case OP_BRAPOS: case OP_SBRA: case OP_SBRAPOS: @@ -3059,13 +3257,13 @@ return (0 << 8) | bit; #ifdef SUPPORT_UNICODE if (common->utf && c > 65535) { - if (bit >= (1 << 10)) + if (bit >= (1u << 10)) bit >>= 10; else return (bit < 256) ? ((2 << 8) | bit) : ((3 << 8) | (bit >> 8)); } #endif /* SUPPORT_UNICODE */ -return (bit < 256) ? ((0 << 8) | bit) : ((1 << 8) | (bit >> 8)); +return (bit < 256) ? ((0u << 8) | bit) : ((1u << 8) | (bit >> 8)); #endif /* PCRE2_CODE_UNIT_WIDTH == [8|16|32] */ } @@ -3159,95 +3357,152 @@ else JUMPHERE(jump); } -static void peek_char(compiler_common *common, sljit_u32 max) +static void peek_char(compiler_common *common, sljit_u32 max, sljit_s32 dst, sljit_sw dstw, jump_list **backtracks) { /* Reads the character into TMP1, keeps STR_PTR. -Does not check STR_END. TMP2 Destroyed. */ +Does not check STR_END. TMP2, dst, RETURN_ADDR Destroyed. */ DEFINE_COMPILER; #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 struct sljit_jump *jump; -#endif +#endif /* SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 */ SLJIT_UNUSED_ARG(max); +SLJIT_UNUSED_ARG(dst); +SLJIT_UNUSED_ARG(dstw); +SLJIT_UNUSED_ARG(backtracks); -OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), 0); -#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8 +OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0)); + +#ifdef SUPPORT_UNICODE +#if PCRE2_CODE_UNIT_WIDTH == 8 if (common->utf) { if (max < 128) return; - jump = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0xc0); + jump = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0x80); + OP1(SLJIT_MOV, dst, dstw, STR_PTR, 0); OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); - add_jump(compiler, &common->utfreadchar, JUMP(SLJIT_FAST_CALL)); - OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, TMP2, 0); + add_jump(compiler, common->invalid_utf ? &common->utfreadchar_invalid : &common->utfreadchar, JUMP(SLJIT_FAST_CALL)); + OP1(SLJIT_MOV, STR_PTR, 0, dst, dstw); + if (backtracks && common->invalid_utf) + add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR)); JUMPHERE(jump); } -#endif /* SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 */ - -#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 16 +#elif PCRE2_CODE_UNIT_WIDTH == 16 if (common->utf) { if (max < 0xd800) return; OP2(SLJIT_SUB, TMP2, 0, TMP1, 0, SLJIT_IMM, 0xd800); - jump = CMP(SLJIT_GREATER, TMP2, 0, SLJIT_IMM, 0xdc00 - 0xd800 - 1); - /* TMP2 contains the high surrogate. */ - OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0)); - OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x40); - OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 10); - OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x3ff); - OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0); - JUMPHERE(jump); - } -#endif -} -#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8 - -static BOOL is_char7_bitset(const sljit_u8 *bitset, BOOL nclass) -{ -/* Tells whether the character codes below 128 are enough -to determine a match. */ -const sljit_u8 value = nclass ? 0xff : 0; -const sljit_u8 *end = bitset + 32; + if (common->invalid_utf) + { + jump = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0xe000 - 0xd800); + OP1(SLJIT_MOV, dst, dstw, STR_PTR, 0); + OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + add_jump(compiler, &common->utfreadchar_invalid, JUMP(SLJIT_FAST_CALL)); + OP1(SLJIT_MOV, STR_PTR, 0, dst, dstw); + if (backtracks && common->invalid_utf) + add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR)); + } + else + { + /* TMP2 contains the high surrogate. */ + jump = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0xdc00 - 0xd800); + OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(1)); + OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 10); + OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x10000 - 0xdc00); + OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0); + } -bitset += 16; -do + JUMPHERE(jump); + } +#elif PCRE2_CODE_UNIT_WIDTH == 32 +if (common->invalid_utf) { - if (*bitset++ != value) - return FALSE; + if (backtracks != NULL) + add_jump(compiler, backtracks, CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0x110000)); + else + { + OP2(SLJIT_SUB | SLJIT_SET_GREATER_EQUAL, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x110000); + CMOV(SLJIT_GREATER_EQUAL, TMP1, SLJIT_IMM, INVALID_UTF_CHAR); + } } -while (bitset < end); -return TRUE; +#endif /* PCRE2_CODE_UNIT_WIDTH == [8|16|32] */ +#endif /* SUPPORT_UNICODE */ } -static void read_char7_type(compiler_common *common, BOOL full_read) +static void peek_char_back(compiler_common *common, sljit_u32 max, jump_list **backtracks) { -/* Reads the precise character type of a character into TMP1, if the character -is less than 128. Otherwise it returns with zero. Does not check STR_END. The -full_read argument tells whether characters above max are accepted or not. */ +/* Reads one character back without moving STR_PTR. TMP2 must +contain the start of the subject buffer. Affects TMP1, TMP2, and RETURN_ADDR. */ DEFINE_COMPILER; -struct sljit_jump *jump; -SLJIT_ASSERT(common->utf); +#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 +struct sljit_jump *jump; +#endif /* SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 */ -OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), 0); -OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); +SLJIT_UNUSED_ARG(max); +SLJIT_UNUSED_ARG(backtracks); -OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes); +OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-1)); -if (full_read) +#ifdef SUPPORT_UNICODE +#if PCRE2_CODE_UNIT_WIDTH == 8 +if (common->utf) { - jump = CMP(SLJIT_LESS, TMP2, 0, SLJIT_IMM, 0xc0); - OP1(SLJIT_MOV_U8, TMP2, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(utf8_table4) - 0xc0); - OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP2, 0); + if (max < 128) return; + + jump = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0x80); + if (common->invalid_utf) + { + add_jump(compiler, &common->utfpeakcharback_invalid, JUMP(SLJIT_FAST_CALL)); + if (backtracks != NULL) + add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR)); + } + else + add_jump(compiler, &common->utfpeakcharback, JUMP(SLJIT_FAST_CALL)); JUMPHERE(jump); } +#elif PCRE2_CODE_UNIT_WIDTH == 16 +if (common->utf) + { + if (max < 0xd800) return; + + if (common->invalid_utf) + { + jump = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0xd800); + add_jump(compiler, &common->utfpeakcharback_invalid, JUMP(SLJIT_FAST_CALL)); + if (backtracks != NULL) + add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR)); + } + else + { + OP2(SLJIT_SUB, TMP2, 0, TMP1, 0, SLJIT_IMM, 0xdc00); + jump = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0xe000 - 0xdc00); + /* TMP2 contains the low surrogate. */ + OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-2)); + OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x10000); + OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xd800); + OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 10); + OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0); + } + JUMPHERE(jump); + } +#elif PCRE2_CODE_UNIT_WIDTH == 32 + if (common->invalid_utf) + add_jump(compiler, backtracks, CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0x110000)); +#endif /* PCRE2_CODE_UNIT_WIDTH == [8|16|32] */ +#endif /* SUPPORT_UNICODE */ } -#endif /* SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8 */ +#define READ_CHAR_UPDATE_STR_PTR 0x1 +#define READ_CHAR_UTF8_NEWLINE 0x2 +#define READ_CHAR_NEWLINE (READ_CHAR_UPDATE_STR_PTR | READ_CHAR_UTF8_NEWLINE) +#define READ_CHAR_VALID_UTF 0x4 -static void read_char_range(compiler_common *common, sljit_u32 min, sljit_u32 max, BOOL update_str_ptr) +static void read_char(compiler_common *common, sljit_u32 min, sljit_u32 max, + jump_list **backtracks, sljit_u32 options) { /* Reads the precise value of a character into TMP1, if the character is between min and max (c >= min && c <= max). Otherwise it returns with a value @@ -3260,24 +3515,41 @@ struct sljit_jump *jump; struct sljit_jump *jump2; #endif -SLJIT_UNUSED_ARG(update_str_ptr); SLJIT_UNUSED_ARG(min); SLJIT_UNUSED_ARG(max); +SLJIT_UNUSED_ARG(backtracks); +SLJIT_UNUSED_ARG(options); SLJIT_ASSERT(min <= max); OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0)); OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); -#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8 +#ifdef SUPPORT_UNICODE +#if PCRE2_CODE_UNIT_WIDTH == 8 if (common->utf) { - if (max < 128 && !update_str_ptr) return; + if (max < 128 && !(options & READ_CHAR_UPDATE_STR_PTR)) return; + + if (common->invalid_utf && !(options & READ_CHAR_VALID_UTF)) + { + jump = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0x80); + + if (options & READ_CHAR_UTF8_NEWLINE) + add_jump(compiler, &common->utfreadnewline_invalid, JUMP(SLJIT_FAST_CALL)); + else + add_jump(compiler, &common->utfreadchar_invalid, JUMP(SLJIT_FAST_CALL)); + + if (backtracks != NULL) + add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR)); + JUMPHERE(jump); + return; + } jump = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0xc0); if (min >= 0x10000) { OP2(SLJIT_SUB, TMP2, 0, TMP1, 0, SLJIT_IMM, 0xf0); - if (update_str_ptr) + if (options & READ_CHAR_UPDATE_STR_PTR) OP1(SLJIT_MOV_U8, RETURN_ADDR, 0, SLJIT_MEM1(TMP1), (sljit_sw)PRIV(utf8_table4) - 0xc0); OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0)); jump2 = CMP(SLJIT_GREATER, TMP2, 0, SLJIT_IMM, 0x7); @@ -3289,19 +3561,19 @@ if (common->utf) OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x3f); OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0); OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(2)); - if (!update_str_ptr) + if (!(options & READ_CHAR_UPDATE_STR_PTR)) OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(3)); OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 6); OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x3f); OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0); JUMPHERE(jump2); - if (update_str_ptr) + if (options & READ_CHAR_UPDATE_STR_PTR) OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, RETURN_ADDR, 0); } else if (min >= 0x800 && max <= 0xffff) { OP2(SLJIT_SUB, TMP2, 0, TMP1, 0, SLJIT_IMM, 0xe0); - if (update_str_ptr) + if (options & READ_CHAR_UPDATE_STR_PTR) OP1(SLJIT_MOV_U8, RETURN_ADDR, 0, SLJIT_MEM1(TMP1), (sljit_sw)PRIV(utf8_table4) - 0xc0); OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0)); jump2 = CMP(SLJIT_GREATER, TMP2, 0, SLJIT_IMM, 0xf); @@ -3309,17 +3581,19 @@ if (common->utf) OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x3f); OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0); OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(1)); - if (!update_str_ptr) + if (!(options & READ_CHAR_UPDATE_STR_PTR)) OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(2)); OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 6); OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x3f); OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0); JUMPHERE(jump2); - if (update_str_ptr) + if (options & READ_CHAR_UPDATE_STR_PTR) OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, RETURN_ADDR, 0); } else if (max >= 0x800) - add_jump(compiler, (max < 0x10000) ? &common->utfreadchar16 : &common->utfreadchar, JUMP(SLJIT_FAST_CALL)); + { + add_jump(compiler, &common->utfreadchar, JUMP(SLJIT_FAST_CALL)); + } else if (max < 128) { OP1(SLJIT_MOV_U8, TMP2, 0, SLJIT_MEM1(TMP1), (sljit_sw)PRIV(utf8_table4) - 0xc0); @@ -3328,7 +3602,7 @@ if (common->utf) else { OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0)); - if (!update_str_ptr) + if (!(options & READ_CHAR_UPDATE_STR_PTR)) OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); else OP1(SLJIT_MOV_U8, RETURN_ADDR, 0, SLJIT_MEM1(TMP1), (sljit_sw)PRIV(utf8_table4) - 0xc0); @@ -3336,51 +3610,141 @@ if (common->utf) OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 6); OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x3f); OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0); - if (update_str_ptr) + if (options & READ_CHAR_UPDATE_STR_PTR) OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, RETURN_ADDR, 0); } JUMPHERE(jump); } -#endif - -#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 16 +#elif PCRE2_CODE_UNIT_WIDTH == 16 if (common->utf) { + if (max < 0xd800 && !(options & READ_CHAR_UPDATE_STR_PTR)) return; + + if (common->invalid_utf && !(options & READ_CHAR_VALID_UTF)) + { + OP2(SLJIT_SUB, TMP2, 0, TMP1, 0, SLJIT_IMM, 0xd800); + jump = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0xe000 - 0xd800); + + if (options & READ_CHAR_UTF8_NEWLINE) + add_jump(compiler, &common->utfreadnewline_invalid, JUMP(SLJIT_FAST_CALL)); + else + add_jump(compiler, &common->utfreadchar_invalid, JUMP(SLJIT_FAST_CALL)); + + if (backtracks != NULL) + add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR)); + JUMPHERE(jump); + return; + } + if (max >= 0x10000) { OP2(SLJIT_SUB, TMP2, 0, TMP1, 0, SLJIT_IMM, 0xd800); - jump = CMP(SLJIT_GREATER, TMP2, 0, SLJIT_IMM, 0xdc00 - 0xd800 - 1); + jump = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0xdc00 - 0xd800); /* TMP2 contains the high surrogate. */ OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0)); - OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x40); OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 10); OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); - OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x3ff); - OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0); + OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x10000 - 0xdc00); + OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0); JUMPHERE(jump); return; } - if (max < 0xd800 && !update_str_ptr) return; - /* Skip low surrogate if necessary. */ OP2(SLJIT_SUB, TMP2, 0, TMP1, 0, SLJIT_IMM, 0xd800); - jump = CMP(SLJIT_GREATER, TMP2, 0, SLJIT_IMM, 0xdc00 - 0xd800 - 1); - if (update_str_ptr) - OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); - if (max >= 0xd800) - OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 0x10000); - JUMPHERE(jump); + + if (sljit_has_cpu_feature(SLJIT_HAS_CMOV) && sljit_get_register_index(RETURN_ADDR) >= 0) + { + if (options & READ_CHAR_UPDATE_STR_PTR) + OP2(SLJIT_ADD, RETURN_ADDR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + OP2(SLJIT_SUB | SLJIT_SET_LESS, SLJIT_UNUSED, 0, TMP2, 0, SLJIT_IMM, 0x400); + if (options & READ_CHAR_UPDATE_STR_PTR) + CMOV(SLJIT_LESS, STR_PTR, RETURN_ADDR, 0); + if (max >= 0xd800) + CMOV(SLJIT_LESS, TMP1, SLJIT_IMM, 0x10000); + } + else + { + jump = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0x400); + if (options & READ_CHAR_UPDATE_STR_PTR) + OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + if (max >= 0xd800) + OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 0x10000); + JUMPHERE(jump); + } } -#endif +#elif PCRE2_CODE_UNIT_WIDTH == 32 +if (common->invalid_utf) + { + if (backtracks != NULL) + add_jump(compiler, backtracks, CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0x110000)); + else + { + OP2(SLJIT_SUB | SLJIT_SET_GREATER_EQUAL, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x110000); + CMOV(SLJIT_GREATER_EQUAL, TMP1, SLJIT_IMM, INVALID_UTF_CHAR); + } + } +#endif /* PCRE2_CODE_UNIT_WIDTH == [8|16|32] */ +#endif /* SUPPORT_UNICODE */ +} + +#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8 + +static BOOL is_char7_bitset(const sljit_u8 *bitset, BOOL nclass) +{ +/* Tells whether the character codes below 128 are enough +to determine a match. */ +const sljit_u8 value = nclass ? 0xff : 0; +const sljit_u8 *end = bitset + 32; + +bitset += 16; +do + { + if (*bitset++ != value) + return FALSE; + } +while (bitset < end); +return TRUE; } -static SLJIT_INLINE void read_char(compiler_common *common) +static void read_char7_type(compiler_common *common, jump_list **backtracks, BOOL negated) { -read_char_range(common, 0, READ_CHAR_MAX, TRUE); +/* Reads the precise character type of a character into TMP1, if the character +is less than 128. Otherwise it returns with zero. Does not check STR_END. The +full_read argument tells whether characters above max are accepted or not. */ +DEFINE_COMPILER; +struct sljit_jump *jump; + +SLJIT_ASSERT(common->utf); + +OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), 0); +OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + +/* All values > 127 are zero in ctypes. */ +OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes); + +if (negated) + { + jump = CMP(SLJIT_LESS, TMP2, 0, SLJIT_IMM, 0x80); + + if (common->invalid_utf) + { + add_jump(compiler, &common->utfreadchar_invalid, JUMP(SLJIT_FAST_CALL)); + add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR)); + OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 0); + } + else + { + OP1(SLJIT_MOV_U8, TMP2, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(utf8_table4) - 0xc0); + OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP2, 0); + } + JUMPHERE(jump); + } } -static void read_char8_type(compiler_common *common, BOOL update_str_ptr) +#endif /* SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8 */ + +static void read_char8_type(compiler_common *common, jump_list **backtracks, BOOL negated) { /* Reads the character type into TMP1, updates STR_PTR. Does not check STR_END. */ DEFINE_COMPILER; @@ -3391,7 +3755,8 @@ struct sljit_jump *jump; struct sljit_jump *jump2; #endif -SLJIT_UNUSED_ARG(update_str_ptr); +SLJIT_UNUSED_ARG(backtracks); +SLJIT_UNUSED_ARG(negated); OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), 0); OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); @@ -3399,18 +3764,38 @@ OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8 if (common->utf) { - /* This can be an extra read in some situations, but hopefully - it is needed in most cases. */ + /* The result of this read may be unused, but saves an "else" part. */ OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes); - jump = CMP(SLJIT_LESS, TMP2, 0, SLJIT_IMM, 0xc0); - if (!update_str_ptr) + jump = CMP(SLJIT_LESS, TMP2, 0, SLJIT_IMM, 0x80); + + if (!negated) { + if (common->invalid_utf) + add_jump(compiler, backtracks, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0)); + OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0)); OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); - OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x3f); + OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xc2); + if (common->invalid_utf) + add_jump(compiler, backtracks, CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0xe0 - 0xc2)); + OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 6); - OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x3f); - OP2(SLJIT_OR, TMP2, 0, TMP2, 0, TMP1, 0); + OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, TMP1, 0); + OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x80); + if (common->invalid_utf) + add_jump(compiler, backtracks, CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0x40)); + + OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 0); + jump2 = CMP(SLJIT_GREATER, TMP2, 0, SLJIT_IMM, 255); + OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes); + JUMPHERE(jump2); + } + else if (common->invalid_utf) + { + add_jump(compiler, &common->utfreadchar_invalid, JUMP(SLJIT_FAST_CALL)); + OP1(SLJIT_MOV, TMP2, 0, TMP1, 0); + add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR)); + OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 0); jump2 = CMP(SLJIT_GREATER, TMP2, 0, SLJIT_IMM, 255); OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes); @@ -3418,43 +3803,98 @@ if (common->utf) } else add_jump(compiler, &common->utfreadtype8, JUMP(SLJIT_FAST_CALL)); + JUMPHERE(jump); return; } #endif /* SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8 */ +#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 32 +if (common->invalid_utf && negated) + add_jump(compiler, backtracks, CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0x110000)); +#endif /* SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 32 */ + #if PCRE2_CODE_UNIT_WIDTH != 8 /* The ctypes array contains only 256 values. */ OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 0); jump = CMP(SLJIT_GREATER, TMP2, 0, SLJIT_IMM, 255); -#endif +#endif /* PCRE2_CODE_UNIT_WIDTH != 8 */ OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes); #if PCRE2_CODE_UNIT_WIDTH != 8 JUMPHERE(jump); -#endif +#endif /* PCRE2_CODE_UNIT_WIDTH != 8 */ #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 16 -if (common->utf && update_str_ptr) +if (common->utf && negated) { /* Skip low surrogate if necessary. */ + if (!common->invalid_utf) + { + OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xd800); + + if (sljit_has_cpu_feature(SLJIT_HAS_CMOV) && sljit_get_register_index(RETURN_ADDR) >= 0) + { + OP2(SLJIT_ADD, RETURN_ADDR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + OP2(SLJIT_SUB | SLJIT_SET_LESS, SLJIT_UNUSED, 0, TMP2, 0, SLJIT_IMM, 0x400); + CMOV(SLJIT_LESS, STR_PTR, RETURN_ADDR, 0); + } + else + { + jump = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0x400); + OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + JUMPHERE(jump); + } + return; + } + OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xd800); - jump = CMP(SLJIT_GREATER, TMP2, 0, SLJIT_IMM, 0xdc00 - 0xd800 - 1); + jump = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0xe000 - 0xd800); + add_jump(compiler, backtracks, CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0x400)); + add_jump(compiler, backtracks, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0)); + + OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0)); OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xdc00); + add_jump(compiler, backtracks, CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0x400)); + JUMPHERE(jump); + return; } #endif /* SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 16 */ } -static void skip_char_back(compiler_common *common) +static void move_back(compiler_common *common, jump_list **backtracks, BOOL must_be_valid) { -/* Goes one character back. Affects STR_PTR and TMP1. Does not check begin. */ +/* Goes one character back. TMP2 must contain the start of +the subject buffer. Affects STR_PTR and TMP1. Does not modify +STR_PTR for invalid character sequences. */ DEFINE_COMPILER; + +SLJIT_UNUSED_ARG(backtracks); +SLJIT_UNUSED_ARG(must_be_valid); + #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 +struct sljit_jump *jump; +#endif + +#ifdef SUPPORT_UNICODE #if PCRE2_CODE_UNIT_WIDTH == 8 struct sljit_label *label; if (common->utf) { + if (!must_be_valid && common->invalid_utf) + { + OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), -IN_UCHARS(1)); + OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + jump = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0x80); + add_jump(compiler, &common->utfmoveback_invalid, JUMP(SLJIT_FAST_CALL)); + if (backtracks != NULL) + add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, 0)); + JUMPHERE(jump); + return; + } + label = LABEL(); OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), -IN_UCHARS(1)); OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); @@ -3467,16 +3907,45 @@ if (common->utf) { OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), -IN_UCHARS(1)); OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + + if (!must_be_valid && common->invalid_utf) + { + OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xd800); + jump = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0xe000 - 0xd800); + add_jump(compiler, &common->utfmoveback_invalid, JUMP(SLJIT_FAST_CALL)); + if (backtracks != NULL) + add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, 0)); + JUMPHERE(jump); + return; + } + /* Skip low surrogate if necessary. */ OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xfc00); OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0xdc00); OP_FLAGS(SLJIT_MOV, TMP1, 0, SLJIT_EQUAL); - OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 1); + OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, UCHAR_SHIFT); OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, TMP1, 0); return; } -#endif /* PCRE2_CODE_UNIT_WIDTH == [8|16] */ -#endif /* SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 */ +#elif PCRE2_CODE_UNIT_WIDTH == 32 +if (common->invalid_utf && !must_be_valid) + { + OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), -IN_UCHARS(1)); + if (backtracks != NULL) + { + add_jump(compiler, backtracks, CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0x110000)); + OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + return; + } + + OP2(SLJIT_SUB | SLJIT_SET_LESS, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x110000); + OP_FLAGS(SLJIT_MOV, TMP1, 0, SLJIT_LESS); + OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, UCHAR_SHIFT); + OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, TMP1, 0); + return; + } +#endif /* PCRE2_CODE_UNIT_WIDTH == [8|16|32] */ +#endif /* SUPPORT_UNICODE */ OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); } @@ -3519,13 +3988,12 @@ else static void do_utfreadchar(compiler_common *common) { /* Fast decoding a UTF-8 character. TMP1 contains the first byte -of the character (>= 0xc0). Return char value in TMP1, length in TMP2. */ +of the character (>= 0xc0). Return char value in TMP1. */ DEFINE_COMPILER; struct sljit_jump *jump; sljit_emit_fast_enter(compiler, RETURN_ADDR, 0); OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0)); -OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x3f); OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 6); OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x3f); OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0); @@ -3534,13 +4002,12 @@ OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0); OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x800); jump = JUMP(SLJIT_NOT_ZERO); /* Two byte sequence. */ +OP2(SLJIT_XOR, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x3000); OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); -OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, IN_UCHARS(2)); sljit_emit_fast_return(compiler, RETURN_ADDR, 0); JUMPHERE(jump); OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(1)); -OP2(SLJIT_XOR, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x800); OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 6); OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x3f); OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0); @@ -3548,55 +4015,18 @@ OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0); OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x10000); jump = JUMP(SLJIT_NOT_ZERO); /* Three byte sequence. */ +OP2(SLJIT_XOR, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xe0000); OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(2)); -OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, IN_UCHARS(3)); sljit_emit_fast_return(compiler, RETURN_ADDR, 0); /* Four byte sequence. */ JUMPHERE(jump); OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(2)); -OP2(SLJIT_XOR, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x10000); -OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 6); +OP2(SLJIT_XOR, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xf0000); OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(3)); -OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x3f); -OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0); -OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, IN_UCHARS(4)); -sljit_emit_fast_return(compiler, RETURN_ADDR, 0); -} - -static void do_utfreadchar16(compiler_common *common) -{ -/* Fast decoding a UTF-8 character. TMP1 contains the first byte -of the character (>= 0xc0). Return value in TMP1. */ -DEFINE_COMPILER; -struct sljit_jump *jump; - -sljit_emit_fast_enter(compiler, RETURN_ADDR, 0); -OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0)); -OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x3f); OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 6); OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x3f); OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0); - -/* Searching for the first zero. */ -OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x800); -jump = JUMP(SLJIT_NOT_ZERO); -/* Two byte sequence. */ -OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); -sljit_emit_fast_return(compiler, RETURN_ADDR, 0); - -JUMPHERE(jump); -OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x400); -OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_NOT_ZERO); -/* This code runs only in 8 bit mode. No need to shift the value. */ -OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP2, 0); -OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(1)); -OP2(SLJIT_XOR, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x800); -OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 6); -OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x3f); -OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0); -/* Three byte sequence. */ -OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(2)); sljit_emit_fast_return(compiler, RETURN_ADDR, 0); } @@ -3636,8 +4066,644 @@ OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP2, 0); sljit_emit_fast_return(compiler, RETURN_ADDR, 0); } +static void do_utfreadchar_invalid(compiler_common *common) +{ +/* Slow decoding a UTF-8 character. TMP1 contains the first byte +of the character (>= 0xc0). Return char value in TMP1. STR_PTR is +undefined for invalid characters. */ +DEFINE_COMPILER; +sljit_s32 i; +sljit_s32 has_cmov = sljit_has_cpu_feature(SLJIT_HAS_CMOV); +struct sljit_jump *jump; +struct sljit_jump *buffer_end_close; +struct sljit_label *three_byte_entry; +struct sljit_label *exit_invalid_label; +struct sljit_jump *exit_invalid[11]; + +sljit_emit_fast_enter(compiler, RETURN_ADDR, 0); + +OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xc2); + +/* Usually more than 3 characters remained in the subject buffer. */ +OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(3)); + +/* Not a valid start of a multi-byte sequence, no more bytes read. */ +exit_invalid[0] = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0xf5 - 0xc2); + +buffer_end_close = CMP(SLJIT_GREATER, STR_PTR, 0, STR_END, 0); + +OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-3)); +OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 6); +/* If TMP2 is in 0x80-0xbf range, TMP1 is also increased by (0x2 << 6). */ +OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0); +OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x80); +exit_invalid[1] = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0x40); + +OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x800); +jump = JUMP(SLJIT_NOT_ZERO); + +OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(2)); +sljit_emit_fast_return(compiler, RETURN_ADDR, 0); + +JUMPHERE(jump); + +/* Three-byte sequence. */ +OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-2)); +OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 6); +OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x80); +OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0); +if (has_cmov) + { + OP2(SLJIT_SUB | SLJIT_SET_GREATER_EQUAL, SLJIT_UNUSED, 0, TMP2, 0, SLJIT_IMM, 0x40); + CMOV(SLJIT_GREATER_EQUAL, TMP1, SLJIT_IMM, 0x20000); + exit_invalid[2] = NULL; + } +else + exit_invalid[2] = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0x40); + +OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x10000); +jump = JUMP(SLJIT_NOT_ZERO); + +three_byte_entry = LABEL(); + +OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x2d800); +if (has_cmov) + { + OP2(SLJIT_SUB | SLJIT_SET_LESS, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x800); + CMOV(SLJIT_LESS, TMP1, SLJIT_IMM, INVALID_UTF_CHAR - 0xd800); + exit_invalid[3] = NULL; + } +else + exit_invalid[3] = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0x800); +OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xd800); +OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + +if (has_cmov) + { + OP2(SLJIT_SUB | SLJIT_SET_LESS, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x800); + CMOV(SLJIT_LESS, TMP1, SLJIT_IMM, INVALID_UTF_CHAR); + exit_invalid[4] = NULL; + } +else + exit_invalid[4] = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0x800); +sljit_emit_fast_return(compiler, RETURN_ADDR, 0); + +JUMPHERE(jump); + +/* Four-byte sequence. */ +OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-1)); +OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 6); +OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x80); +OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0); +if (has_cmov) + { + OP2(SLJIT_SUB | SLJIT_SET_GREATER_EQUAL, SLJIT_UNUSED, 0, TMP2, 0, SLJIT_IMM, 0x40); + CMOV(SLJIT_GREATER_EQUAL, TMP1, SLJIT_IMM, 0); + exit_invalid[5] = NULL; + } +else + exit_invalid[5] = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0x40); + +OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xc10000); +if (has_cmov) + { + OP2(SLJIT_SUB | SLJIT_SET_GREATER_EQUAL, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x100000); + CMOV(SLJIT_GREATER_EQUAL, TMP1, SLJIT_IMM, INVALID_UTF_CHAR - 0x10000); + exit_invalid[6] = NULL; + } +else + exit_invalid[6] = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0x100000); + +OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x10000); +sljit_emit_fast_return(compiler, RETURN_ADDR, 0); + +JUMPHERE(buffer_end_close); +OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(2)); +exit_invalid[7] = CMP(SLJIT_GREATER, STR_PTR, 0, STR_END, 0); + +/* Two-byte sequence. */ +OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-1)); +OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 6); +/* If TMP2 is in 0x80-0xbf range, TMP1 is also increased by (0x2 << 6). */ +OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0); +OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x80); +exit_invalid[8] = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0x40); + +OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x800); +jump = JUMP(SLJIT_NOT_ZERO); + +sljit_emit_fast_return(compiler, RETURN_ADDR, 0); + +/* Three-byte sequence. */ +JUMPHERE(jump); +exit_invalid[9] = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0); + +OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0)); +OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 6); +OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x80); +OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0); +if (has_cmov) + { + OP2(SLJIT_SUB | SLJIT_SET_GREATER_EQUAL, SLJIT_UNUSED, 0, TMP2, 0, SLJIT_IMM, 0x40); + CMOV(SLJIT_GREATER_EQUAL, TMP1, SLJIT_IMM, INVALID_UTF_CHAR); + exit_invalid[10] = NULL; + } +else + exit_invalid[10] = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0x40); + +/* One will be substracted from STR_PTR later. */ +OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(2)); + +/* Four byte sequences are not possible. */ +CMPTO(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0x30000, three_byte_entry); + +exit_invalid_label = LABEL(); +for (i = 0; i < 11; i++) + sljit_set_label(exit_invalid[i], exit_invalid_label); + +OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR); +sljit_emit_fast_return(compiler, RETURN_ADDR, 0); +} + +static void do_utfreadnewline_invalid(compiler_common *common) +{ +/* Slow decoding a UTF-8 character, specialized for newlines. +TMP1 contains the first byte of the character (>= 0xc0). Return +char value in TMP1. */ +DEFINE_COMPILER; +struct sljit_label *loop; +struct sljit_label *skip_start; +struct sljit_label *three_byte_exit; +struct sljit_jump *jump[5]; + +sljit_emit_fast_enter(compiler, RETURN_ADDR, 0); + +if (common->nltype != NLTYPE_ANY) + { + SLJIT_ASSERT(common->nltype != NLTYPE_FIXED || common->newline < 128); + + /* All newlines are ascii, just skip intermediate octets. */ + jump[0] = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0); + loop = LABEL(); + OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0)); + OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xc0); + CMPTO(SLJIT_EQUAL, TMP2, 0, SLJIT_IMM, 0x80, loop); + OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + + JUMPHERE(jump[0]); + + OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR); + sljit_emit_fast_return(compiler, RETURN_ADDR, 0); + return; + } + +jump[0] = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0); +OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0)); +OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + +jump[1] = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, 0xc2); +jump[2] = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, 0xe2); + +skip_start = LABEL(); +OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xc0); +jump[3] = CMP(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, 0x80); + +/* Skip intermediate octets. */ +loop = LABEL(); +jump[4] = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0); +OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0)); +OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); +OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xc0); +CMPTO(SLJIT_EQUAL, TMP2, 0, SLJIT_IMM, 0x80, loop); + +JUMPHERE(jump[3]); +OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + +three_byte_exit = LABEL(); +JUMPHERE(jump[0]); +JUMPHERE(jump[4]); + +OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR); +sljit_emit_fast_return(compiler, RETURN_ADDR, 0); + +/* Two byte long newline: 0x85. */ +JUMPHERE(jump[1]); +CMPTO(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, 0x85, skip_start); + +OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 0x85); +sljit_emit_fast_return(compiler, RETURN_ADDR, 0); + +/* Three byte long newlines: 0x2028 and 0x2029. */ +JUMPHERE(jump[2]); +CMPTO(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, 0x80, skip_start); +CMPTO(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0, three_byte_exit); + +OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0)); +OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + +OP2(SLJIT_SUB, TMP1, 0, TMP2, 0, SLJIT_IMM, 0x80); +CMPTO(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0x40, skip_start); + +OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, 0x2000); +OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0); +sljit_emit_fast_return(compiler, RETURN_ADDR, 0); +} + +static void do_utfmoveback_invalid(compiler_common *common) +{ +/* Goes one character back. */ +DEFINE_COMPILER; +sljit_s32 i; +struct sljit_jump *jump; +struct sljit_jump *buffer_start_close; +struct sljit_label *exit_ok_label; +struct sljit_label *exit_invalid_label; +struct sljit_jump *exit_invalid[7]; + +sljit_emit_fast_enter(compiler, RETURN_ADDR, 0); + +OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(3)); +exit_invalid[0] = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0xc0); + +/* Two-byte sequence. */ +buffer_start_close = CMP(SLJIT_LESS, STR_PTR, 0, TMP2, 0); + +OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(2)); + +OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xc0); +jump = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0x20); + +OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 1); +OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(2)); +sljit_emit_fast_return(compiler, RETURN_ADDR, 0); + +/* Three-byte sequence. */ +JUMPHERE(jump); +exit_invalid[1] = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, -0x40); + +OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(1)); + +OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xe0); +jump = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0x10); + +OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 1); +OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); +sljit_emit_fast_return(compiler, RETURN_ADDR, 0); + +/* Four-byte sequence. */ +JUMPHERE(jump); +OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xe0 - 0x80); +exit_invalid[2] = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0x40); + +OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0)); +OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xf0); +exit_invalid[3] = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0x05); + +exit_ok_label = LABEL(); +OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 1); +sljit_emit_fast_return(compiler, RETURN_ADDR, 0); + +/* Two-byte sequence. */ +JUMPHERE(buffer_start_close); +OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(2)); + +exit_invalid[4] = CMP(SLJIT_LESS, STR_PTR, 0, TMP2, 0); + +OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0)); + +OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xc0); +CMPTO(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0x20, exit_ok_label); + +/* Three-byte sequence. */ +OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); +exit_invalid[5] = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, -0x40); +exit_invalid[6] = CMP(SLJIT_LESS, STR_PTR, 0, TMP2, 0); + +OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0)); + +OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xe0); +CMPTO(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0x10, exit_ok_label); + +/* Four-byte sequences are not possible. */ + +exit_invalid_label = LABEL(); +sljit_set_label(exit_invalid[5], exit_invalid_label); +sljit_set_label(exit_invalid[6], exit_invalid_label); +OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 0); +OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(3)); +sljit_emit_fast_return(compiler, RETURN_ADDR, 0); + +JUMPHERE(exit_invalid[4]); +/* -2 + 4 = 2 */ +OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(2)); + +exit_invalid_label = LABEL(); +for (i = 0; i < 4; i++) + sljit_set_label(exit_invalid[i], exit_invalid_label); +OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 0); +OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(4)); +sljit_emit_fast_return(compiler, RETURN_ADDR, 0); +} + +static void do_utfpeakcharback(compiler_common *common) +{ +/* Peak a character back. */ +DEFINE_COMPILER; +struct sljit_jump *jump[2]; + +sljit_emit_fast_enter(compiler, RETURN_ADDR, 0); + +OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-2)); +OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xc0); +jump[0] = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0x20); + +OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-3)); +OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xe0); +jump[1] = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0x10); + +OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-4)); +OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xe0 - 0x80); +OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xf0); +OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 6); +OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0); + +JUMPHERE(jump[1]); +OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-2)); +OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 6); +OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x80); +OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0); + +JUMPHERE(jump[0]); +OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-1)); +OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 6); +OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x80); +OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0); + +sljit_emit_fast_return(compiler, RETURN_ADDR, 0); +} + +static void do_utfpeakcharback_invalid(compiler_common *common) +{ +/* Peak a character back. */ +DEFINE_COMPILER; +sljit_s32 i; +sljit_s32 has_cmov = sljit_has_cpu_feature(SLJIT_HAS_CMOV); +struct sljit_jump *jump[2]; +struct sljit_label *two_byte_entry; +struct sljit_label *three_byte_entry; +struct sljit_label *exit_invalid_label; +struct sljit_jump *exit_invalid[8]; + +sljit_emit_fast_enter(compiler, RETURN_ADDR, 0); + +OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, SLJIT_IMM, IN_UCHARS(3)); +exit_invalid[0] = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0xc0); +jump[0] = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, STR_PTR, 0); + +/* Two-byte sequence. */ +OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-2)); +OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xc2); +jump[1] = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0x1e); + +two_byte_entry = LABEL(); +OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 6); +/* If TMP1 is in 0x80-0xbf range, TMP1 is also increased by (0x2 << 6). */ +OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0); +sljit_emit_fast_return(compiler, RETURN_ADDR, 0); + +JUMPHERE(jump[1]); +OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xc2 - 0x80); +OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x80); +exit_invalid[1] = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0x40); +OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 6); +OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0); + +/* Three-byte sequence. */ +OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-3)); +OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xe0); +jump[1] = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0x10); + +three_byte_entry = LABEL(); +OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 12); +OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0); + +OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xd800); +if (has_cmov) + { + OP2(SLJIT_SUB | SLJIT_SET_LESS, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x800); + CMOV(SLJIT_LESS, TMP1, SLJIT_IMM, -0xd800); + exit_invalid[2] = NULL; + } +else + exit_invalid[2] = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0x800); + +OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xd800); +if (has_cmov) + { + OP2(SLJIT_SUB | SLJIT_SET_LESS, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x800); + CMOV(SLJIT_LESS, TMP1, SLJIT_IMM, INVALID_UTF_CHAR); + exit_invalid[3] = NULL; + } +else + exit_invalid[3] = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0x800); + +sljit_emit_fast_return(compiler, RETURN_ADDR, 0); + +JUMPHERE(jump[1]); +OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xe0 - 0x80); +exit_invalid[4] = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0x40); +OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 12); +OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0); + +/* Four-byte sequence. */ +OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-4)); +OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x10000); +OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xf0); +OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 18); +/* ADD is used instead of OR because of the SUB 0x10000 above. */ +OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0); + +if (has_cmov) + { + OP2(SLJIT_SUB | SLJIT_SET_GREATER_EQUAL, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x100000); + CMOV(SLJIT_GREATER_EQUAL, TMP1, SLJIT_IMM, INVALID_UTF_CHAR - 0x10000); + exit_invalid[5] = NULL; + } +else + exit_invalid[5] = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0x100000); + +OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x10000); +sljit_emit_fast_return(compiler, RETURN_ADDR, 0); + +JUMPHERE(jump[0]); +OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, IN_UCHARS(1)); +jump[0] = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, STR_PTR, 0); + +/* Two-byte sequence. */ +OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-2)); +OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xc2); +CMPTO(SLJIT_LESS, TMP2, 0, SLJIT_IMM, 0x1e, two_byte_entry); + +OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xc2 - 0x80); +OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x80); +exit_invalid[6] = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0x40); +OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 6); +OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0); + +/* Three-byte sequence. */ +OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-3)); +OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xe0); +CMPTO(SLJIT_LESS, TMP2, 0, SLJIT_IMM, 0x10, three_byte_entry); + +OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR); +sljit_emit_fast_return(compiler, RETURN_ADDR, 0); + +JUMPHERE(jump[0]); +exit_invalid[7] = CMP(SLJIT_GREATER, TMP2, 0, STR_PTR, 0); + +/* Two-byte sequence. */ +OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-2)); +OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xc2); +CMPTO(SLJIT_LESS, TMP2, 0, SLJIT_IMM, 0x1e, two_byte_entry); + +exit_invalid_label = LABEL(); +for (i = 0; i < 8; i++) + sljit_set_label(exit_invalid[i], exit_invalid_label); + +OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR); +sljit_emit_fast_return(compiler, RETURN_ADDR, 0); +} + #endif /* PCRE2_CODE_UNIT_WIDTH == 8 */ +#if PCRE2_CODE_UNIT_WIDTH == 16 + +static void do_utfreadchar_invalid(compiler_common *common) +{ +/* Slow decoding a UTF-16 character. TMP1 contains the first half +of the character (>= 0xd800). Return char value in TMP1. STR_PTR is +undefined for invalid characters. */ +DEFINE_COMPILER; +struct sljit_jump *exit_invalid[3]; + +sljit_emit_fast_enter(compiler, RETURN_ADDR, 0); + +/* TMP2 contains the high surrogate. */ +exit_invalid[0] = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0xdc00); +exit_invalid[1] = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0); + +OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0)); +OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 10); +OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + +OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xdc00); +OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x10000); +exit_invalid[2] = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0x400); + +OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0); +sljit_emit_fast_return(compiler, RETURN_ADDR, 0); + +JUMPHERE(exit_invalid[0]); +JUMPHERE(exit_invalid[1]); +JUMPHERE(exit_invalid[2]); +OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR); +sljit_emit_fast_return(compiler, RETURN_ADDR, 0); +} + +static void do_utfreadnewline_invalid(compiler_common *common) +{ +/* Slow decoding a UTF-16 character, specialized for newlines. +TMP1 contains the first half of the character (>= 0xd800). Return +char value in TMP1. */ + +DEFINE_COMPILER; +struct sljit_jump *exit_invalid[2]; + +sljit_emit_fast_enter(compiler, RETURN_ADDR, 0); + +/* TMP2 contains the high surrogate. */ +exit_invalid[0] = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0); + +OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0)); +exit_invalid[1] = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0xdc00); + +OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xdc00); +OP2(SLJIT_SUB | SLJIT_SET_LESS, SLJIT_UNUSED, 0, TMP2, 0, SLJIT_IMM, 0x400); +OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_LESS); +OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 0x10000); +OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, UCHAR_SHIFT); +OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP2, 0); + +sljit_emit_fast_return(compiler, RETURN_ADDR, 0); + +JUMPHERE(exit_invalid[0]); +JUMPHERE(exit_invalid[1]); +OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR); +sljit_emit_fast_return(compiler, RETURN_ADDR, 0); +} + +static void do_utfmoveback_invalid(compiler_common *common) +{ +/* Goes one character back. */ +DEFINE_COMPILER; +struct sljit_jump *exit_invalid[3]; + +sljit_emit_fast_enter(compiler, RETURN_ADDR, 0); + +exit_invalid[0] = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0x400); +exit_invalid[1] = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, STR_PTR, 0); + +OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-1)); +OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xd800); +exit_invalid[2] = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0x400); + +OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); +OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 1); +sljit_emit_fast_return(compiler, RETURN_ADDR, 0); + +JUMPHERE(exit_invalid[0]); +JUMPHERE(exit_invalid[1]); +JUMPHERE(exit_invalid[2]); + +OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); +OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 0); +sljit_emit_fast_return(compiler, RETURN_ADDR, 0); +} + +static void do_utfpeakcharback_invalid(compiler_common *common) +{ +/* Peak a character back. */ +DEFINE_COMPILER; +struct sljit_jump *jump; +struct sljit_jump *exit_invalid[3]; + +sljit_emit_fast_enter(compiler, RETURN_ADDR, 0); + +jump = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0xe000); +OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, SLJIT_IMM, IN_UCHARS(1)); +exit_invalid[0] = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0xdc00); +exit_invalid[1] = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, STR_PTR, 0); + +OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-2)); +OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x10000 - 0xdc00); +OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xd800); +exit_invalid[2] = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0x400); +OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 10); +OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0); + +JUMPHERE(jump); +sljit_emit_fast_return(compiler, RETURN_ADDR, 0); + +JUMPHERE(exit_invalid[0]); +JUMPHERE(exit_invalid[1]); +JUMPHERE(exit_invalid[2]); + +OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR); +sljit_emit_fast_return(compiler, RETURN_ADDR, 0); +} + +#endif /* PCRE2_CODE_UNIT_WIDTH == 16 */ + /* UCD_BLOCK_SIZE must be 128 (see the assert below). */ #define UCD_BLOCK_MASK 127 #define UCD_BLOCK_SHIFT 7 @@ -3653,12 +4719,12 @@ struct sljit_jump *jump; #if defined SLJIT_DEBUG && SLJIT_DEBUG /* dummy_ucd_record */ -const ucd_record *record = GET_UCD(INVALID_UTF_CHAR); -SLJIT_ASSERT(record->script == ucp_Common && record->chartype == ucp_Cn && record->gbprop == ucp_gbOther); +const ucd_record *record = GET_UCD(UNASSIGNED_UTF_CHAR); +SLJIT_ASSERT(record->script == ucp_Unknown && record->chartype == ucp_Cn && record->gbprop == ucp_gbOther); SLJIT_ASSERT(record->caseset == 0 && record->other_case == 0); #endif -SLJIT_ASSERT(UCD_BLOCK_SIZE == 128 && sizeof(ucd_record) == 8); +SLJIT_ASSERT(UCD_BLOCK_SIZE == 128 && sizeof(ucd_record) == 12); sljit_emit_fast_enter(compiler, RETURN_ADDR, 0); @@ -3666,7 +4732,47 @@ sljit_emit_fast_enter(compiler, RETURN_ADDR, 0); if (!common->utf) { jump = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, MAX_UTF_CODE_POINT + 1); - OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR); + OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, UNASSIGNED_UTF_CHAR); + JUMPHERE(jump); + } +#endif + +OP2(SLJIT_LSHR, TMP2, 0, TMP1, 0, SLJIT_IMM, UCD_BLOCK_SHIFT); +OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 1); +OP1(SLJIT_MOV_U16, TMP2, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_stage1)); +OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, UCD_BLOCK_MASK); +OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, UCD_BLOCK_SHIFT); +OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0); +OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, (sljit_sw)PRIV(ucd_stage2)); +OP1(SLJIT_MOV_U16, TMP2, 0, SLJIT_MEM2(TMP2, TMP1), 1); +sljit_emit_fast_return(compiler, RETURN_ADDR, 0); +} + +static void do_getucdtype(compiler_common *common) +{ +/* Search the UCD record for the character comes in TMP1. +Returns chartype in TMP1 and UCD offset in TMP2. */ +DEFINE_COMPILER; +#if PCRE2_CODE_UNIT_WIDTH == 32 +struct sljit_jump *jump; +#endif + +#if defined SLJIT_DEBUG && SLJIT_DEBUG +/* dummy_ucd_record */ +const ucd_record *record = GET_UCD(UNASSIGNED_UTF_CHAR); +SLJIT_ASSERT(record->script == ucp_Unknown && record->chartype == ucp_Cn && record->gbprop == ucp_gbOther); +SLJIT_ASSERT(record->caseset == 0 && record->other_case == 0); +#endif + +SLJIT_ASSERT(UCD_BLOCK_SIZE == 128 && sizeof(ucd_record) == 12); + +sljit_emit_fast_enter(compiler, RETURN_ADDR, 0); + +#if PCRE2_CODE_UNIT_WIDTH == 32 +if (!common->utf) + { + jump = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, MAX_UTF_CODE_POINT + 1); + OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, UNASSIGNED_UTF_CHAR); JUMPHERE(jump); } #endif @@ -3679,8 +4785,19 @@ OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, UCD_BLOCK_SHIFT); OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0); OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, (sljit_sw)PRIV(ucd_stage2)); OP1(SLJIT_MOV_U16, TMP2, 0, SLJIT_MEM2(TMP2, TMP1), 1); + +// PH hacking +//fprintf(stderr, "~~A\n"); + OP2(SLJIT_SHL, TMP1, 0, TMP2, 0, SLJIT_IMM, 2); + OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 3); + OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, TMP1, 0); + OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, chartype)); + OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, chartype)); -OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM2(TMP1, TMP2), 3); + + OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM2(TMP1, TMP2), 0); + +// OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM2(TMP1, TMP2), 3); sljit_emit_fast_return(compiler, RETURN_ADDR, 0); } @@ -3695,8 +4812,9 @@ struct sljit_jump *start; struct sljit_jump *end = NULL; struct sljit_jump *end2 = NULL; #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 -struct sljit_jump *singlechar; -#endif +struct sljit_label *loop; +struct sljit_jump *jump; +#endif /* SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 */ jump_list *newline = NULL; sljit_u32 overall_options = common->re->overall_options; BOOL hascrorlf = (common->re->flags & PCRE2_HASCRORLF) != 0; @@ -3733,7 +4851,7 @@ if ((overall_options & PCRE2_FIRSTLINE) != 0) mainloop = LABEL(); /* Continual stores does not cause data dependency. */ OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr, STR_PTR, 0); - read_char_range(common, common->nlmin, common->nlmax, TRUE); + read_char(common, common->nlmin, common->nlmax, NULL, READ_CHAR_NEWLINE); check_newlinechar(common, common->nltype, &newline, TRUE); CMPTO(SLJIT_LESS, STR_PTR, 0, STR_END, 0, mainloop); JUMPHERE(end); @@ -3753,11 +4871,9 @@ else if ((overall_options & PCRE2_USE_OFFSET_LIMIT) != 0) OP1(SLJIT_MOV, TMP2, 0, STR_END, 0); end = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, (sljit_sw) PCRE2_UNSET); OP1(SLJIT_MOV, TMP2, 0, ARGUMENTS, 0); -#if PCRE2_CODE_UNIT_WIDTH == 16 - OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 1); -#elif PCRE2_CODE_UNIT_WIDTH == 32 - OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 2); -#endif +#if PCRE2_CODE_UNIT_WIDTH == 16 || PCRE2_CODE_UNIT_WIDTH == 32 + OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, UCHAR_SHIFT); +#endif /* PCRE2_CODE_UNIT_WIDTH == [16|32] */ OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, begin)); OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, TMP1, 0); end2 = CMP(SLJIT_LESS_EQUAL, TMP2, 0, STR_END, 0); @@ -3781,7 +4897,7 @@ if (newlinecheck) OP_FLAGS(SLJIT_MOV, TMP1, 0, SLJIT_EQUAL); #if PCRE2_CODE_UNIT_WIDTH == 16 || PCRE2_CODE_UNIT_WIDTH == 32 OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, UCHAR_SHIFT); -#endif +#endif /* PCRE2_CODE_UNIT_WIDTH == [16|32] */ OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0); end2 = JUMP(SLJIT_JUMP); } @@ -3789,9 +4905,9 @@ if (newlinecheck) mainloop = LABEL(); /* Increasing the STR_PTR here requires one less jump in the most common case. */ -#ifdef SUPPORT_UNICODE -if (common->utf) readuchar = TRUE; -#endif +#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 +if (common->utf && !common->invalid_utf) readuchar = TRUE; +#endif /* SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 */ if (newlinecheck) readuchar = TRUE; if (readuchar) @@ -3803,23 +4919,55 @@ if (newlinecheck) OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 #if PCRE2_CODE_UNIT_WIDTH == 8 -if (common->utf) +if (common->invalid_utf) + { + /* Skip continuation code units. */ + loop = LABEL(); + jump = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0); + OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), 0); + OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x80); + CMPTO(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0x40, loop); + OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + JUMPHERE(jump); + } +else if (common->utf) { - singlechar = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0xc0); + jump = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0xc0); OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)PRIV(utf8_table4) - 0xc0); OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0); - JUMPHERE(singlechar); + JUMPHERE(jump); } #elif PCRE2_CODE_UNIT_WIDTH == 16 -if (common->utf) +if (common->invalid_utf) { - singlechar = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0xd800); - OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xfc00); - OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0xd800); - OP_FLAGS(SLJIT_MOV, TMP1, 0, SLJIT_EQUAL); - OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 1); - OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0); - JUMPHERE(singlechar); + /* Skip continuation code units. */ + loop = LABEL(); + jump = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0); + OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), 0); + OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xdc00); + CMPTO(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0x400, loop); + OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + JUMPHERE(jump); + } +else if (common->utf) + { + OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xd800); + + if (sljit_has_cpu_feature(SLJIT_HAS_CMOV)) + { + OP2(SLJIT_ADD, TMP2, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + OP2(SLJIT_SUB | SLJIT_SET_LESS, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x400); + CMOV(SLJIT_LESS, STR_PTR, TMP2, 0); + } + else + { + OP2(SLJIT_SUB | SLJIT_SET_LESS, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x400); + OP_FLAGS(SLJIT_MOV, TMP1, 0, SLJIT_LESS); + OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, UCHAR_SHIFT); + OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0); + } } #endif /* PCRE2_CODE_UNIT_WIDTH == [8|16] */ #endif /* SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 */ @@ -4305,16 +5453,16 @@ return CMP(SLJIT_NOT_EQUAL, reg, 0, SLJIT_IMM, 0xdc00); static sljit_s32 character_to_int32(PCRE2_UCHAR chr) { -sljit_s32 value = (sljit_s32)chr; +sljit_u32 value = chr; #if PCRE2_CODE_UNIT_WIDTH == 8 #define SSE2_COMPARE_TYPE_INDEX 0 -return (value << 24) | (value << 16) | (value << 8) | value; +return (sljit_s32)((value << 24) | (value << 16) | (value << 8) | value); #elif PCRE2_CODE_UNIT_WIDTH == 16 #define SSE2_COMPARE_TYPE_INDEX 1 -return (value << 16) | value; +return (sljit_s32)((value << 16) | value); #elif PCRE2_CODE_UNIT_WIDTH == 32 #define SSE2_COMPARE_TYPE_INDEX 2 -return value; +return (sljit_s32)(value); #else #error "Unsupported unit width" #endif @@ -5120,7 +6268,7 @@ for (i = 0; i < max; i++) } #if (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86) && !(defined SUPPORT_VALGRIND) && !(defined _WIN64) -if (check_fast_forward_char_pair_sse2(common, chars, max)) +if (sljit_has_cpu_feature(SLJIT_HAS_SSE2) && check_fast_forward_char_pair_sse2(common, chars, max)) return TRUE; #endif @@ -5356,14 +6504,15 @@ if (common->nltype == NLTYPE_FIXED && common->newline > 255) } OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0); +/* Example: match /^/ to \r\n from offset 1. */ OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, str)); firstchar = CMP(SLJIT_LESS_EQUAL, STR_PTR, 0, TMP2, 0); -skip_char_back(common); +move_back(common, NULL, FALSE); loop = LABEL(); common->ff_newline_shortcut = loop; -read_char_range(common, common->nlmin, common->nlmax, TRUE); +read_char(common, common->nlmin, common->nlmax, NULL, READ_CHAR_NEWLINE); lastchar = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0); if (common->nltype == NLTYPE_ANY || common->nltype == NLTYPE_ANYCRLF) foundcr = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, CHAR_CR); @@ -5544,7 +6693,7 @@ OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(STACK_TOP), -sizeof(sljit_sw)); jump = CMP(SLJIT_SIG_LESS_EQUAL, TMP2, 0, SLJIT_IMM, 0); OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, TMP1, 0); -if (sljit_get_register_index (TMP3) < 0) +if (sljit_get_register_index(TMP3) < 0) { OP1(SLJIT_MOV, SLJIT_MEM1(TMP2), 0, SLJIT_MEM1(STACK_TOP), -(2 * sizeof(sljit_sw))); OP1(SLJIT_MOV, SLJIT_MEM1(TMP2), sizeof(sljit_sw), SLJIT_MEM1(STACK_TOP), -(3 * sizeof(sljit_sw))); @@ -5569,7 +6718,7 @@ sljit_emit_fast_return(compiler, RETURN_ADDR, 0); JUMPHERE(jump); OP1(SLJIT_NEG, TMP2, 0, TMP2, 0); OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, TMP1, 0); -if (sljit_get_register_index (TMP3) < 0) +if (sljit_get_register_index(TMP3) < 0) { OP1(SLJIT_MOV, SLJIT_MEM1(TMP2), 0, SLJIT_MEM1(STACK_TOP), -(2 * sizeof(sljit_sw))); OP2(SLJIT_SUB, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, 2 * sizeof(sljit_sw)); @@ -5588,21 +6737,29 @@ static void check_wordboundary(compiler_common *common) DEFINE_COMPILER; struct sljit_jump *skipread; jump_list *skipread_list = NULL; +jump_list *invalid_utf = NULL; #if PCRE2_CODE_UNIT_WIDTH != 8 || defined SUPPORT_UNICODE struct sljit_jump *jump; -#endif +#endif /* PCRE2_CODE_UNIT_WIDTH != 8 || SUPPORT_UNICODE */ SLJIT_COMPILE_ASSERT(ctype_word == 0x10, ctype_word_must_be_16); sljit_emit_fast_enter(compiler, SLJIT_MEM1(SLJIT_SP), LOCALS0); -/* Get type of the previous char, and put it to LOCALS1. */ +/* Get type of the previous char, and put it to TMP3. */ OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0); -OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, begin)); -OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCALS1, SLJIT_IMM, 0); -skipread = CMP(SLJIT_LESS_EQUAL, STR_PTR, 0, TMP1, 0); -skip_char_back(common); -check_start_used_ptr(common); -read_char(common); +OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, begin)); +OP1(SLJIT_MOV, TMP3, 0, SLJIT_IMM, 0); +skipread = CMP(SLJIT_LESS_EQUAL, STR_PTR, 0, TMP2, 0); + +if (common->mode == PCRE2_JIT_COMPLETE) + peek_char_back(common, READ_CHAR_MAX, &invalid_utf); +else + { + move_back(common, &invalid_utf, FALSE); + check_start_used_ptr(common); + /* No need precise read since match fails anyway. */ + read_char(common, 0, READ_CHAR_MAX, &invalid_utf, READ_CHAR_UPDATE_STR_PTR); + } /* Testing char type. */ #ifdef SUPPORT_UNICODE @@ -5610,7 +6767,7 @@ if (common->use_ucp) { OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, 1); jump = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, CHAR_UNDERSCORE); - add_jump(compiler, &common->getucd, JUMP(SLJIT_FAST_CALL)); + add_jump(compiler, &common->getucdtype, JUMP(SLJIT_FAST_CALL)); OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, ucp_Ll); OP2(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, ucp_Lu - ucp_Ll); OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_LESS_EQUAL); @@ -5618,23 +6775,22 @@ if (common->use_ucp) OP2(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, ucp_No - ucp_Nd); OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_LESS_EQUAL); JUMPHERE(jump); - OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCALS1, TMP2, 0); + OP1(SLJIT_MOV, TMP3, 0, TMP2, 0); } else -#endif +#endif /* SUPPORT_UNICODE */ { #if PCRE2_CODE_UNIT_WIDTH != 8 jump = CMP(SLJIT_GREATER, TMP1, 0, SLJIT_IMM, 255); #elif defined SUPPORT_UNICODE - /* Here LOCALS1 has already been zeroed. */ + /* Here TMP3 has already been zeroed. */ jump = NULL; if (common->utf) jump = CMP(SLJIT_GREATER, TMP1, 0, SLJIT_IMM, 255); #endif /* PCRE2_CODE_UNIT_WIDTH == 8 */ OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP1), common->ctypes); OP2(SLJIT_LSHR, TMP1, 0, TMP1, 0, SLJIT_IMM, 4 /* ctype_word */); - OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 1); - OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCALS1, TMP1, 0); + OP2(SLJIT_AND, TMP3, 0, TMP1, 0, SLJIT_IMM, 1); #if PCRE2_CODE_UNIT_WIDTH != 8 JUMPHERE(jump); #elif defined SUPPORT_UNICODE @@ -5646,7 +6802,7 @@ JUMPHERE(skipread); OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, 0); check_str_end(common, &skipread_list); -peek_char(common, READ_CHAR_MAX); +peek_char(common, READ_CHAR_MAX, SLJIT_MEM1(SLJIT_SP), LOCALS1, &invalid_utf); /* Testing char type. This is a code duplication. */ #ifdef SUPPORT_UNICODE @@ -5654,7 +6810,7 @@ if (common->use_ucp) { OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, 1); jump = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, CHAR_UNDERSCORE); - add_jump(compiler, &common->getucd, JUMP(SLJIT_FAST_CALL)); + add_jump(compiler, &common->getucdtype, JUMP(SLJIT_FAST_CALL)); OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, ucp_Ll); OP2(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, ucp_Lu - ucp_Ll); OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_LESS_EQUAL); @@ -5664,7 +6820,7 @@ if (common->use_ucp) JUMPHERE(jump); } else -#endif +#endif /* SUPPORT_UNICODE */ { #if PCRE2_CODE_UNIT_WIDTH != 8 /* TMP2 may be destroyed by peek_char. */ @@ -5688,8 +6844,22 @@ else } set_jumps(skipread_list, LABEL()); -OP2(SLJIT_XOR | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP2, 0, SLJIT_MEM1(SLJIT_SP), LOCALS1); -sljit_emit_fast_return(compiler, SLJIT_MEM1(SLJIT_SP), LOCALS0); +OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), LOCALS0); +OP2(SLJIT_XOR | SLJIT_SET_Z, TMP2, 0, TMP2, 0, TMP3, 0); +sljit_emit_fast_return(compiler, TMP1, 0); + +#ifdef SUPPORT_UNICODE +if (common->invalid_utf) + { + SLJIT_ASSERT(invalid_utf != NULL); + + set_jumps(invalid_utf, LABEL()); + OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), LOCALS0); + OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, -1); + sljit_emit_fast_return(compiler, TMP1, 0); + return; + } +#endif /* SUPPORT_UNICODE */ } static BOOL optimize_class_ranges(compiler_common *common, const sljit_u8 *bits, BOOL nclass, BOOL invert, jump_list **backtracks) @@ -5856,9 +7026,6 @@ int i, j, k, len, c; if (!sljit_has_cpu_feature(SLJIT_HAS_CMOV)) return FALSE; -if (invert) - nclass = !nclass; - len = 0; for (i = 0; i < 32; i++) @@ -5940,6 +7107,9 @@ if (j != 0) } } +if (invert) + nclass = !nclass; + type = nclass ? SLJIT_NOT_EQUAL : SLJIT_EQUAL; add_jump(compiler, backtracks, CMP(type, TMP2, 0, SLJIT_IMM, 0)); return TRUE; @@ -6225,37 +7395,6 @@ OP1(SLJIT_MOV, char1_reg, 0, SLJIT_MEM1(SLJIT_SP), LOCALS1); sljit_emit_fast_return(compiler, TMP1, 0); } -#if defined SUPPORT_UNICODE - -static PCRE2_SPTR SLJIT_FUNC do_utf_caselesscmp(PCRE2_SPTR src1, PCRE2_SPTR src2, PCRE2_SPTR end1, PCRE2_SPTR end2) -{ -/* This function would be ineffective to do in JIT level. */ -sljit_u32 c1, c2; -const ucd_record *ur; -const sljit_u32 *pp; - -while (src1 < end1) - { - if (src2 >= end2) - return (PCRE2_SPTR)1; - GETCHARINC(c1, src1); - GETCHARINC(c2, src2); - ur = GET_UCD(c2); - if (c1 != c2 && c1 != c2 + ur->other_case) - { - pp = PRIV(ucd_caseless_sets) + ur->caseset; - for (;;) - { - if (c1 < *pp) return NULL; - if (c1 == *pp++) break; - } - } - } -return src2; -} - -#endif /* SUPPORT_UNICODE */ - static PCRE2_SPTR byte_sequence_compare(compiler_common *common, BOOL caseless, PCRE2_SPTR cc, compare_context *context, jump_list **backtracks) { @@ -6297,7 +7436,7 @@ if (context->sourcereg == -1) OP1(SLJIT_MOV_U16, TMP1, 0, SLJIT_MEM1(STR_PTR), -context->length); else #endif - OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(STR_PTR), -context->length); + OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), -context->length); #elif PCRE2_CODE_UNIT_WIDTH == 16 #if defined SLJIT_UNALIGNED && SLJIT_UNALIGNED if (context->length >= 4) @@ -6444,7 +7583,7 @@ PCRE2_SPTR ccbegin; int compares, invertcmp, numberofcmps; #if defined SUPPORT_UNICODE && (PCRE2_CODE_UNIT_WIDTH == 8 || PCRE2_CODE_UNIT_WIDTH == 16) BOOL utf = common->utf; -#endif +#endif /* SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == [8|16] */ #ifdef SUPPORT_UNICODE BOOL needstype = FALSE, needsscript = FALSE, needschar = FALSE; @@ -6452,7 +7591,7 @@ BOOL charsaved = FALSE; int typereg = TMP1; const sljit_u32 *other_cases; sljit_uw typeoffset; -#endif +#endif /* SUPPORT_UNICODE */ /* Scanning the necessary info. */ cc++; @@ -6476,7 +7615,7 @@ while (*cc != XCL_END) if (c < min) min = c; #ifdef SUPPORT_UNICODE needschar = TRUE; -#endif +#endif /* SUPPORT_UNICODE */ } else if (*cc == XCL_RANGE) { @@ -6487,7 +7626,7 @@ while (*cc != XCL_END) if (c > max) max = c; #ifdef SUPPORT_UNICODE needschar = TRUE; -#endif +#endif /* SUPPORT_UNICODE */ } #ifdef SUPPORT_UNICODE else @@ -6555,13 +7694,16 @@ while (*cc != XCL_END) } cc += 2; } -#endif +#endif /* SUPPORT_UNICODE */ } SLJIT_ASSERT(compares > 0); /* We are not necessary in utf mode even in 8 bit mode. */ cc = ccbegin; -read_char_range(common, min, max, (cc[-1] & XCL_NOT) != 0); +if ((cc[-1] & XCL_NOT) != 0) + read_char(common, min, max, backtracks, READ_CHAR_UPDATE_STR_PTR); +else + read_char(common, min, max, NULL, 0); if ((cc[-1] & XCL_HASPROP) == 0) { @@ -6594,13 +7736,13 @@ else if ((cc[-1] & XCL_MAP) != 0) OP1(SLJIT_MOV, RETURN_ADDR, 0, TMP1, 0); #ifdef SUPPORT_UNICODE charsaved = TRUE; -#endif +#endif /* SUPPORT_UNICODE */ if (!optimize_class(common, (const sljit_u8 *)cc, FALSE, TRUE, list)) { #if PCRE2_CODE_UNIT_WIDTH == 8 jump = NULL; if (common->utf) -#endif +#endif /* PCRE2_CODE_UNIT_WIDTH == 8 */ jump = CMP(SLJIT_GREATER, TMP1, 0, SLJIT_IMM, 255); OP2(SLJIT_AND, TMP2, 0, TMP1, 0, SLJIT_IMM, 0x7); @@ -6612,7 +7754,7 @@ else if ((cc[-1] & XCL_MAP) != 0) #if PCRE2_CODE_UNIT_WIDTH == 8 if (common->utf) -#endif +#endif /* PCRE2_CODE_UNIT_WIDTH == 8 */ JUMPHERE(jump); } @@ -6630,10 +7772,10 @@ if (needstype || needsscript) if (!common->utf) { jump = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, MAX_UTF_CODE_POINT + 1); - OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR); + OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, UNASSIGNED_UTF_CHAR); JUMPHERE(jump); } -#endif +#endif /* PCRE2_CODE_UNIT_WIDTH == 32 */ OP2(SLJIT_LSHR, TMP2, 0, TMP1, 0, SLJIT_IMM, UCD_BLOCK_SHIFT); OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 1); @@ -6647,8 +7789,18 @@ if (needstype || needsscript) /* Before anything else, we deal with scripts. */ if (needsscript) { +// PH hacking +//fprintf(stderr, "~~B\n"); + + OP2(SLJIT_SHL, TMP1, 0, TMP2, 0, SLJIT_IMM, 2); + OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 3); + OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, TMP1, 0); + OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, script)); - OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM2(TMP1, TMP2), 3); + + OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM2(TMP1, TMP2), 0); + + // OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM2(TMP1, TMP2), 3); ccbegin = cc; @@ -6686,33 +7838,49 @@ if (needstype || needsscript) } if (needschar) - { OP1(SLJIT_MOV, TMP1, 0, RETURN_ADDR, 0); - } if (needstype) { if (!needschar) { +// PH hacking +//fprintf(stderr, "~~C\n"); + OP2(SLJIT_SHL, TMP1, 0, TMP2, 0, SLJIT_IMM, 2); + OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 3); + OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, TMP1, 0); + OP2(SLJIT_ADD, TMP1, 0, TMP2, 0, TMP1, 0); + OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, chartype)); - OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM2(TMP1, TMP2), 3); + + OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM2(TMP1, TMP2), 0); + +// OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM2(TMP1, TMP2), 3); } else { +// PH hacking +//fprintf(stderr, "~~D\n"); + OP2(SLJIT_SHL, TMP1, 0, TMP2, 0, SLJIT_IMM, 2); + OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 3); + + OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, TMP1, 0); + OP1(SLJIT_MOV, TMP1, 0, RETURN_ADDR, 0); + OP1(SLJIT_MOV_U8, RETURN_ADDR, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, chartype)); typereg = RETURN_ADDR; } } } -#endif +#endif /* SUPPORT_UNICODE */ /* Generating code. */ charoffset = 0; numberofcmps = 0; #ifdef SUPPORT_UNICODE typeoffset = 0; -#endif +#endif /* SUPPORT_UNICODE */ while (*cc != XCL_END) { @@ -6979,7 +8147,7 @@ while (*cc != XCL_END) } cc += 2; } -#endif +#endif /* SUPPORT_UNICODE */ if (jump != NULL) add_jump(compiler, compares > 0 ? list : backtracks, jump); @@ -7020,6 +8188,15 @@ switch(type) case OP_NOT_WORD_BOUNDARY: case OP_WORD_BOUNDARY: add_jump(compiler, &common->wordboundary, JUMP(SLJIT_FAST_CALL)); +#ifdef SUPPORT_UNICODE + if (common->invalid_utf) + { + OP2(SLJIT_SUB | SLJIT_SET_Z | SLJIT_SET_SIG_LESS, SLJIT_UNUSED, 0, TMP2, 0, SLJIT_IMM, 0); + add_jump(compiler, backtracks, JUMP(SLJIT_SIG_LESS)); + add_jump(compiler, backtracks, JUMP(type == OP_NOT_WORD_BOUNDARY ? SLJIT_NOT_ZERO : SLJIT_ZERO)); + return cc; + } +#endif /* SUPPORT_UNICODE */ sljit_set_current_flags(compiler, SLJIT_SET_Z); add_jump(compiler, backtracks, JUMP(type == OP_NOT_WORD_BOUNDARY ? SLJIT_NOT_ZERO : SLJIT_ZERO)); return cc; @@ -7078,13 +8255,13 @@ switch(type) } else { - OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCALS1, STR_PTR, 0); - read_char_range(common, common->nlmin, common->nlmax, TRUE); + OP1(SLJIT_MOV, TMP3, 0, STR_PTR, 0); + read_char(common, common->nlmin, common->nlmax, backtracks, READ_CHAR_UPDATE_STR_PTR); add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, STR_PTR, 0, STR_END, 0)); add_jump(compiler, &common->anynewline, JUMP(SLJIT_FAST_CALL)); sljit_set_current_flags(compiler, SLJIT_SET_Z); add_jump(compiler, backtracks, JUMP(SLJIT_ZERO)); - OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), LOCALS1); + OP1(SLJIT_MOV, STR_PTR, 0, TMP3, 0); } JUMPHERE(jump[2]); JUMPHERE(jump[3]); @@ -7143,7 +8320,7 @@ switch(type) } else { - peek_char(common, common->nlmax); + peek_char(common, common->nlmax, TMP3, 0, NULL); check_newlinechar(common, common->nltype, backtracks, FALSE); } JUMPHERE(jump[0]); @@ -7158,10 +8335,10 @@ switch(type) return cc; case OP_CIRCM: - OP1(SLJIT_MOV, TMP2, 0, ARGUMENTS, 0); - OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, begin)); - jump[1] = CMP(SLJIT_GREATER, STR_PTR, 0, TMP1, 0); - OP2(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_UNUSED, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, options), SLJIT_IMM, PCRE2_NOTBOL); + OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0); + OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, begin)); + jump[1] = CMP(SLJIT_GREATER, STR_PTR, 0, TMP2, 0); + OP2(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_UNUSED, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, options), SLJIT_IMM, PCRE2_NOTBOL); add_jump(compiler, backtracks, JUMP(SLJIT_NOT_ZERO32)); jump[0] = JUMP(SLJIT_JUMP); JUMPHERE(jump[1]); @@ -7171,8 +8348,8 @@ switch(type) if (common->nltype == NLTYPE_FIXED && common->newline > 255) { - OP2(SLJIT_SUB, TMP2, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(2)); - add_jump(compiler, backtracks, CMP(SLJIT_LESS, TMP2, 0, TMP1, 0)); + OP2(SLJIT_SUB, TMP1, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(2)); + add_jump(compiler, backtracks, CMP(SLJIT_LESS, TMP1, 0, TMP2, 0)); OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-2)); OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-1)); add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff)); @@ -7180,8 +8357,7 @@ switch(type) } else { - skip_char_back(common); - read_char_range(common, common->nlmin, common->nlmax, TRUE); + peek_char_back(common, common->nlmax, backtracks); check_newlinechar(common, common->nltype, backtracks, FALSE); } JUMPHERE(jump[0]); @@ -7195,12 +8371,12 @@ switch(type) #ifdef SUPPORT_UNICODE if (common->utf) { - OP1(SLJIT_MOV, TMP3, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, begin)); - OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, length); + OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, begin)); + OP1(SLJIT_MOV, TMP3, 0, SLJIT_IMM, length); label = LABEL(); - add_jump(compiler, backtracks, CMP(SLJIT_LESS_EQUAL, STR_PTR, 0, TMP3, 0)); - skip_char_back(common); - OP2(SLJIT_SUB | SLJIT_SET_Z, TMP2, 0, TMP2, 0, SLJIT_IMM, 1); + add_jump(compiler, backtracks, CMP(SLJIT_LESS_EQUAL, STR_PTR, 0, TMP2, 0)); + move_back(common, backtracks, FALSE); + OP2(SLJIT_SUB | SLJIT_SET_Z, TMP3, 0, TMP3, 0, SLJIT_IMM, 1); JUMPTO(SLJIT_NOT_ZERO, label); } else @@ -7225,21 +8401,28 @@ static PCRE2_SPTR SLJIT_FUNC do_extuni_utf(jit_arguments *args, PCRE2_SPTR cc) { PCRE2_SPTR start_subject = args->begin; PCRE2_SPTR end_subject = args->end; -int lgb, rgb, len, ricount; -PCRE2_SPTR prevcc, bptr; +int lgb, rgb, ricount; +PCRE2_SPTR prevcc, startcc, bptr; +BOOL first = TRUE; uint32_t c; prevcc = cc; -GETCHARINC(c, cc); -lgb = UCD_GRAPHBREAK(c); - -while (cc < end_subject) +startcc = NULL; +do { - len = 1; - GETCHARLEN(c, cc, len); + GETCHARINC(c, cc); rgb = UCD_GRAPHBREAK(c); - if ((PRIV(ucp_gbtable)[lgb] & (1 << rgb)) == 0) break; + if (first) + { + lgb = rgb; + startcc = cc; + first = FALSE; + continue; + } + + if ((PRIV(ucp_gbtable)[lgb] & (1 << rgb)) == 0) + break; /* Not breaking between Regional Indicators is allowed only if there are an even number of preceding RIs. */ @@ -7256,7 +8439,8 @@ while (cc < end_subject) BACKCHAR(bptr); GETCHAR(c, bptr); - if (UCD_GRAPHBREAK(c) != ucp_gbRegionalIndicator) break; + if (UCD_GRAPHBREAK(c) != ucp_gbRegionalIndicator) + break; ricount++; } @@ -7271,14 +8455,80 @@ while (cc < end_subject) lgb != ucp_gbExtended_Pictographic) lgb = rgb; - prevcc = cc; - cc += len; + prevcc = startcc; + startcc = cc; } +while (cc < end_subject); -return cc; +return startcc; } -#endif +static PCRE2_SPTR SLJIT_FUNC do_extuni_utf_invalid(jit_arguments *args, PCRE2_SPTR cc) +{ +PCRE2_SPTR start_subject = args->begin; +PCRE2_SPTR end_subject = args->end; +int lgb, rgb, ricount; +PCRE2_SPTR prevcc, startcc, bptr; +BOOL first = TRUE; +uint32_t c; + +prevcc = cc; +startcc = NULL; +do + { + GETCHARINC_INVALID(c, cc, end_subject, break); + rgb = UCD_GRAPHBREAK(c); + + if (first) + { + lgb = rgb; + startcc = cc; + first = FALSE; + continue; + } + + if ((PRIV(ucp_gbtable)[lgb] & (1 << rgb)) == 0) + break; + + /* Not breaking between Regional Indicators is allowed only if there + are an even number of preceding RIs. */ + + if (lgb == ucp_gbRegionalIndicator && rgb == ucp_gbRegionalIndicator) + { + ricount = 0; + bptr = prevcc; + + /* bptr is pointing to the left-hand character */ + while (bptr > start_subject) + { + GETCHARBACK_INVALID(c, bptr, start_subject, break); + + if (UCD_GRAPHBREAK(c) != ucp_gbRegionalIndicator) + break; + + ricount++; + } + + if ((ricount & 1) != 0) + break; /* Grapheme break required */ + } + + /* If Extend or ZWJ follows Extended_Pictographic, do not update lgb; this + allows any number of them before a following Extended_Pictographic. */ + + if ((rgb != ucp_gbExtend && rgb != ucp_gbZWJ) || + lgb != ucp_gbExtended_Pictographic) + lgb = rgb; + + prevcc = startcc; + startcc = cc; + } +while (cc < end_subject); + +return startcc; +} + +#endif /* PCRE2_CODE_UNIT_WIDTH != 32 */ static PCRE2_SPTR SLJIT_FUNC do_extuni_no_utf(jit_arguments *args, PCRE2_SPTR cc) { @@ -7289,14 +8539,23 @@ PCRE2_SPTR bptr; uint32_t c; GETCHARINC(c, cc); +#if PCRE2_CODE_UNIT_WIDTH == 32 +if (c >= 0x110000) + return NULL; +#endif /* PCRE2_CODE_UNIT_WIDTH == 32 */ lgb = UCD_GRAPHBREAK(c); while (cc < end_subject) { c = *cc; +#if PCRE2_CODE_UNIT_WIDTH == 32 + if (c >= 0x110000) + break; +#endif /* PCRE2_CODE_UNIT_WIDTH == 32 */ rgb = UCD_GRAPHBREAK(c); - if ((PRIV(ucp_gbtable)[lgb] & (1 << rgb)) == 0) break; + if ((PRIV(ucp_gbtable)[lgb] & (1 << rgb)) == 0) + break; /* Not breaking between Regional Indicators is allowed only if there are an even number of preceding RIs. */ @@ -7311,13 +8570,18 @@ while (cc < end_subject) { bptr--; c = *bptr; +#if PCRE2_CODE_UNIT_WIDTH == 32 + if (c >= 0x110000) + break; +#endif /* PCRE2_CODE_UNIT_WIDTH == 32 */ if (UCD_GRAPHBREAK(c) != ucp_gbRegionalIndicator) break; ricount++; } - if ((ricount & 1) != 0) break; /* Grapheme break required */ + if ((ricount & 1) != 0) + break; /* Grapheme break required */ } /* If Extend or ZWJ follows Extended_Pictographic, do not update lgb; this @@ -7333,7 +8597,7 @@ while (cc < end_subject) return cc; } -#endif +#endif /* SUPPORT_UNICODE */ static PCRE2_SPTR compile_char1_matchingpath(compiler_common *common, PCRE2_UCHAR type, PCRE2_SPTR cc, jump_list **backtracks, BOOL check_str_ptr) { @@ -7356,10 +8620,10 @@ switch(type) detect_partial_match(common, backtracks); #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8 if (common->utf && is_char7_bitset((const sljit_u8*)common->ctypes - cbit_length + cbit_digit, FALSE)) - read_char7_type(common, type == OP_NOT_DIGIT); + read_char7_type(common, backtracks, type == OP_NOT_DIGIT); else #endif - read_char8_type(common, type == OP_NOT_DIGIT); + read_char8_type(common, backtracks, type == OP_NOT_DIGIT); /* Flip the starting bit in the negative case. */ OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, ctype_digit); add_jump(compiler, backtracks, JUMP(type == OP_DIGIT ? SLJIT_ZERO : SLJIT_NOT_ZERO)); @@ -7371,10 +8635,10 @@ switch(type) detect_partial_match(common, backtracks); #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8 if (common->utf && is_char7_bitset((const sljit_u8*)common->ctypes - cbit_length + cbit_space, FALSE)) - read_char7_type(common, type == OP_NOT_WHITESPACE); + read_char7_type(common, backtracks, type == OP_NOT_WHITESPACE); else #endif - read_char8_type(common, type == OP_NOT_WHITESPACE); + read_char8_type(common, backtracks, type == OP_NOT_WHITESPACE); OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, ctype_space); add_jump(compiler, backtracks, JUMP(type == OP_WHITESPACE ? SLJIT_ZERO : SLJIT_NOT_ZERO)); return cc; @@ -7385,10 +8649,10 @@ switch(type) detect_partial_match(common, backtracks); #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8 if (common->utf && is_char7_bitset((const sljit_u8*)common->ctypes - cbit_length + cbit_word, FALSE)) - read_char7_type(common, type == OP_NOT_WORDCHAR); + read_char7_type(common, backtracks, type == OP_NOT_WORDCHAR); else #endif - read_char8_type(common, type == OP_NOT_WORDCHAR); + read_char8_type(common, backtracks, type == OP_NOT_WORDCHAR); OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, ctype_word); add_jump(compiler, backtracks, JUMP(type == OP_WORDCHAR ? SLJIT_ZERO : SLJIT_NOT_ZERO)); return cc; @@ -7396,7 +8660,7 @@ switch(type) case OP_ANY: if (check_str_ptr) detect_partial_match(common, backtracks); - read_char_range(common, common->nlmin, common->nlmax, TRUE); + read_char(common, common->nlmin, common->nlmax, backtracks, READ_CHAR_UPDATE_STR_PTR); if (common->nltype == NLTYPE_FIXED && common->newline > 255) { jump[0] = CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff); @@ -7418,12 +8682,18 @@ switch(type) case OP_ALLANY: if (check_str_ptr) detect_partial_match(common, backtracks); -#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 +#ifdef SUPPORT_UNICODE if (common->utf) { + if (common->invalid_utf) + { + read_char(common, 0, READ_CHAR_MAX, backtracks, READ_CHAR_UPDATE_STR_PTR); + return cc; + } + +#if PCRE2_CODE_UNIT_WIDTH == 8 || PCRE2_CODE_UNIT_WIDTH == 16 OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), 0); OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); -#if PCRE2_CODE_UNIT_WIDTH == 8 || PCRE2_CODE_UNIT_WIDTH == 16 #if PCRE2_CODE_UNIT_WIDTH == 8 jump[0] = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0xc0); OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)PRIV(utf8_table4) - 0xc0); @@ -7435,12 +8705,12 @@ switch(type) OP_FLAGS(SLJIT_MOV, TMP1, 0, SLJIT_EQUAL); OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 1); OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0); -#endif +#endif /* PCRE2_CODE_UNIT_WIDTH == 8 */ JUMPHERE(jump[0]); -#endif /* PCRE2_CODE_UNIT_WIDTH == [8|16] */ return cc; +#endif /* PCRE2_CODE_UNIT_WIDTH == [8|16] */ } -#endif +#endif /* SUPPORT_UNICODE */ OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); return cc; @@ -7467,7 +8737,7 @@ switch(type) case OP_ANYNL: if (check_str_ptr) detect_partial_match(common, backtracks); - read_char_range(common, common->bsr_nlmin, common->bsr_nlmax, FALSE); + read_char(common, common->bsr_nlmin, common->bsr_nlmax, NULL, 0); jump[0] = CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, CHAR_CR); /* We don't need to handle soft partial matching case. */ end_list = NULL; @@ -7490,7 +8760,12 @@ switch(type) case OP_HSPACE: if (check_str_ptr) detect_partial_match(common, backtracks); - read_char_range(common, 0x9, 0x3000, type == OP_NOT_HSPACE); + + if (type == OP_NOT_HSPACE) + read_char(common, 0x9, 0x3000, backtracks, READ_CHAR_UPDATE_STR_PTR); + else + read_char(common, 0x9, 0x3000, NULL, 0); + add_jump(compiler, &common->hspace, JUMP(SLJIT_FAST_CALL)); sljit_set_current_flags(compiler, SLJIT_SET_Z); add_jump(compiler, backtracks, JUMP(type == OP_NOT_HSPACE ? SLJIT_NOT_ZERO : SLJIT_ZERO)); @@ -7500,7 +8775,12 @@ switch(type) case OP_VSPACE: if (check_str_ptr) detect_partial_match(common, backtracks); - read_char_range(common, 0xa, 0x2029, type == OP_NOT_VSPACE); + + if (type == OP_NOT_VSPACE) + read_char(common, 0xa, 0x2029, backtracks, READ_CHAR_UPDATE_STR_PTR); + else + read_char(common, 0xa, 0x2029, NULL, 0); + add_jump(compiler, &common->vspace, JUMP(SLJIT_FAST_CALL)); sljit_set_current_flags(compiler, SLJIT_SET_Z); add_jump(compiler, backtracks, JUMP(type == OP_NOT_VSPACE ? SLJIT_NOT_ZERO : SLJIT_ZERO)); @@ -7516,9 +8796,12 @@ switch(type) #if PCRE2_CODE_UNIT_WIDTH != 32 sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_RET(SW) | SLJIT_ARG1(SW) | SLJIT_ARG2(SW), SLJIT_IMM, - common->utf ? SLJIT_FUNC_OFFSET(do_extuni_utf) : SLJIT_FUNC_OFFSET(do_extuni_no_utf)); + common->utf ? (common->invalid_utf ? SLJIT_FUNC_OFFSET(do_extuni_utf_invalid) : SLJIT_FUNC_OFFSET(do_extuni_utf)) : SLJIT_FUNC_OFFSET(do_extuni_no_utf)); + if (common->invalid_utf) + add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, SLJIT_RETURN_REG, 0, SLJIT_IMM, 0)); #else sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_RET(SW) | SLJIT_ARG1(SW) | SLJIT_ARG2(SW), SLJIT_IMM, SLJIT_FUNC_OFFSET(do_extuni_no_utf)); + add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, SLJIT_RETURN_REG, 0, SLJIT_IMM, 0)); #endif OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_RETURN_REG, 0); @@ -7539,11 +8822,15 @@ switch(type) #ifdef SUPPORT_UNICODE if (common->utf && HAS_EXTRALEN(*cc)) length += GET_EXTRALEN(*cc); #endif - if (common->mode == PCRE2_JIT_COMPLETE && check_str_ptr - && (type == OP_CHAR || !char_has_othercase(common, cc) || char_get_othercase_bit(common, cc) != 0)) + + if (check_str_ptr && common->mode != PCRE2_JIT_COMPLETE) + detect_partial_match(common, backtracks); + + if (type == OP_CHAR || !char_has_othercase(common, cc) || char_get_othercase_bit(common, cc) != 0) { OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(length)); - add_jump(compiler, backtracks, CMP(SLJIT_GREATER, STR_PTR, 0, STR_END, 0)); + if (length > 1 || (check_str_ptr && common->mode == PCRE2_JIT_COMPLETE)) + add_jump(compiler, backtracks, CMP(SLJIT_GREATER, STR_PTR, 0, STR_END, 0)); context.length = IN_UCHARS(length); context.sourcereg = -1; @@ -7553,8 +8840,6 @@ switch(type) return byte_sequence_compare(common, type == OP_CHARI, cc, &context, backtracks); } - if (check_str_ptr) - detect_partial_match(common, backtracks); #ifdef SUPPORT_UNICODE if (common->utf) { @@ -7564,24 +8849,28 @@ switch(type) #endif c = *cc; - if (type == OP_CHAR || !char_has_othercase(common, cc)) + SLJIT_ASSERT(type == OP_CHARI && char_has_othercase(common, cc)); + + if (check_str_ptr && common->mode == PCRE2_JIT_COMPLETE) + add_jump(compiler, backtracks, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0)); + + oc = char_othercase(common, c); + read_char(common, c < oc ? c : oc, c > oc ? c : oc, NULL, 0); + + SLJIT_ASSERT(!is_powerof2(c ^ oc)); + + if (sljit_has_cpu_feature(SLJIT_HAS_CMOV)) { - read_char_range(common, c, c, FALSE); + OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, oc); + CMOV(SLJIT_EQUAL, TMP1, SLJIT_IMM, c); add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, c)); - return cc + length; } - oc = char_othercase(common, c); - read_char_range(common, c < oc ? c : oc, c > oc ? c : oc, FALSE); - bit = c ^ oc; - if (is_powerof2(bit)) + else { - OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, bit); - add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, c | bit)); - return cc + length; + jump[0] = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, c); + add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, oc)); + JUMPHERE(jump[0]); } - jump[0] = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, c); - add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, oc)); - JUMPHERE(jump[0]); return cc + length; case OP_NOT: @@ -7595,7 +8884,7 @@ switch(type) { #if PCRE2_CODE_UNIT_WIDTH == 8 c = *cc; - if (c < 128) + if (c < 128 && !common->invalid_utf) { OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(STR_PTR), 0); if (type == OP_NOT || !char_has_othercase(common, cc)) @@ -7626,13 +8915,13 @@ switch(type) if (type == OP_NOT || !char_has_othercase(common, cc)) { - read_char_range(common, c, c, TRUE); + read_char(common, c, c, backtracks, READ_CHAR_UPDATE_STR_PTR); add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, c)); } else { oc = char_othercase(common, c); - read_char_range(common, c < oc ? c : oc, c > oc ? c : oc, TRUE); + read_char(common, c < oc ? c : oc, c > oc ? c : oc, backtracks, READ_CHAR_UPDATE_STR_PTR); bit = c ^ oc; if (is_powerof2(bit)) { @@ -7654,9 +8943,15 @@ switch(type) #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8 bit = (common->utf && is_char7_bitset((const sljit_u8 *)cc, type == OP_NCLASS)) ? 127 : 255; - read_char_range(common, 0, bit, type == OP_NCLASS); + if (type == OP_NCLASS) + read_char(common, 0, bit, backtracks, READ_CHAR_UPDATE_STR_PTR); + else + read_char(common, 0, bit, NULL, 0); #else - read_char_range(common, 0, 255, type == OP_NCLASS); + if (type == OP_NCLASS) + read_char(common, 0, 255, backtracks, READ_CHAR_UPDATE_STR_PTR); + else + read_char(common, 0, 255, NULL, 0); #endif if (optimize_class(common, (const sljit_u8 *)cc, type == OP_NCLASS, FALSE, backtracks)) @@ -7843,6 +9138,14 @@ int offset = 0; struct sljit_jump *jump = NULL; struct sljit_jump *partial; struct sljit_jump *nopartial; +#if defined SUPPORT_UNICODE +struct sljit_label *loop; +struct sljit_label *caseless_loop; +jump_list *no_match = NULL; +int source_reg = COUNT_MATCH; +int source_end_reg = ARGUMENTS; +int char1_reg = STACK_LIMIT; +#endif /* SUPPORT_UNICODE */ if (ref) { @@ -7858,34 +9161,98 @@ else #if defined SUPPORT_UNICODE if (common->utf && *cc == OP_REFI) { - SLJIT_ASSERT(TMP1 == SLJIT_R0 && STR_PTR == SLJIT_R1); + SLJIT_ASSERT(common->iref_ptr != 0); + if (ref) - OP1(SLJIT_MOV, SLJIT_R2, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(offset + 1)); + OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(offset + 1)); else - OP1(SLJIT_MOV, SLJIT_R2, 0, SLJIT_MEM1(TMP2), sizeof(sljit_sw)); + OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(TMP2), sizeof(sljit_sw)); - if (withchecks) - jump = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_R2, 0); - /* No free saved registers so save data on stack. */ + if (withchecks && emptyfail) + add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP1, 0, TMP2, 0)); - OP1(SLJIT_MOV, SLJIT_R3, 0, STR_END, 0); - sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_RET(SW) | SLJIT_ARG1(SW) | SLJIT_ARG2(SW) | SLJIT_ARG3(SW) | SLJIT_ARG4(SW), SLJIT_IMM, SLJIT_FUNC_OFFSET(do_utf_caselesscmp)); - OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_RETURN_REG, 0); + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->iref_ptr, source_reg, 0); + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw), source_end_reg, 0); + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw) * 2, char1_reg, 0); + + OP1(SLJIT_MOV, source_reg, 0, TMP1, 0); + OP1(SLJIT_MOV, source_end_reg, 0, TMP2, 0); + + loop = LABEL(); + jump = CMP(SLJIT_GREATER_EQUAL, source_reg, 0, source_end_reg, 0); + partial = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0); + /* Read original character. It must be a valid UTF character. */ + OP1(SLJIT_MOV, TMP3, 0, STR_PTR, 0); + OP1(SLJIT_MOV, STR_PTR, 0, source_reg, 0); + + read_char(common, 0, READ_CHAR_MAX, NULL, READ_CHAR_UPDATE_STR_PTR | READ_CHAR_VALID_UTF); + + OP1(SLJIT_MOV, source_reg, 0, STR_PTR, 0); + OP1(SLJIT_MOV, STR_PTR, 0, TMP3, 0); + OP1(SLJIT_MOV, char1_reg, 0, TMP1, 0); + + /* Read second character. */ + read_char(common, 0, READ_CHAR_MAX, &no_match, READ_CHAR_UPDATE_STR_PTR); + + CMPTO(SLJIT_EQUAL, TMP1, 0, char1_reg, 0, loop); + +// PH hacking +//fprintf(stderr, "~~E\n"); + + OP1(SLJIT_MOV, TMP3, 0, TMP1, 0); + + add_jump(compiler, &common->getucd, JUMP(SLJIT_FAST_CALL)); + + OP2(SLJIT_SHL, TMP1, 0, TMP2, 0, SLJIT_IMM, 2); + + OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 3); + + OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, TMP1, 0); + + OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, SLJIT_IMM, (sljit_sw)PRIV(ucd_records)); + + OP1(SLJIT_MOV_S32, TMP1, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(ucd_record, other_case)); + OP1(SLJIT_MOV_U8, TMP2, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(ucd_record, caseset)); + OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP3, 0); + CMPTO(SLJIT_EQUAL, TMP1, 0, char1_reg, 0, loop); + + add_jump(compiler, &no_match, CMP(SLJIT_EQUAL, TMP2, 0, SLJIT_IMM, 0)); + OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 2); + OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, SLJIT_IMM, (sljit_sw)PRIV(ucd_caseless_sets)); + + caseless_loop = LABEL(); + OP1(SLJIT_MOV_U32, TMP1, 0, SLJIT_MEM1(TMP2), 0); + OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, SLJIT_IMM, sizeof(uint32_t)); + OP2(SLJIT_SUB | SLJIT_SET_Z | SLJIT_SET_LESS, SLJIT_UNUSED, 0, TMP1, 0, char1_reg, 0); + JUMPTO(SLJIT_EQUAL, loop); + JUMPTO(SLJIT_LESS, caseless_loop); + + set_jumps(no_match, LABEL()); if (common->mode == PCRE2_JIT_COMPLETE) - add_jump(compiler, backtracks, CMP(SLJIT_LESS_EQUAL, SLJIT_RETURN_REG, 0, SLJIT_IMM, 1)); - else - { - OP2(SLJIT_SUB | SLJIT_SET_Z | SLJIT_SET_LESS, SLJIT_UNUSED, 0, SLJIT_RETURN_REG, 0, SLJIT_IMM, 1); + JUMPHERE(partial); - add_jump(compiler, backtracks, JUMP(SLJIT_LESS)); + OP1(SLJIT_MOV, source_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr); + OP1(SLJIT_MOV, source_end_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw)); + OP1(SLJIT_MOV, char1_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw) * 2); + add_jump(compiler, backtracks, JUMP(SLJIT_JUMP)); + + if (common->mode != PCRE2_JIT_COMPLETE) + { + JUMPHERE(partial); + OP1(SLJIT_MOV, source_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr); + OP1(SLJIT_MOV, source_end_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw)); + OP1(SLJIT_MOV, char1_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw) * 2); - nopartial = JUMP(SLJIT_NOT_EQUAL); - OP1(SLJIT_MOV, STR_PTR, 0, STR_END, 0); check_partial(common, FALSE); add_jump(compiler, backtracks, JUMP(SLJIT_JUMP)); - JUMPHERE(nopartial); } + + JUMPHERE(jump); + OP1(SLJIT_MOV, source_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr); + OP1(SLJIT_MOV, source_end_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw)); + OP1(SLJIT_MOV, char1_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw) * 2); + return; } else #endif /* SUPPORT_UNICODE */ @@ -8862,6 +10229,42 @@ if (common->optimized_cbracket[offset >> 1] == 0) return stacksize; } +static PCRE2_SPTR SLJIT_FUNC do_script_run(PCRE2_SPTR ptr, PCRE2_SPTR endptr) +{ + if (PRIV(script_run)(ptr, endptr, FALSE)) + return endptr; + return NULL; +} + +#ifdef SUPPORT_UNICODE + +static PCRE2_SPTR SLJIT_FUNC do_script_run_utf(PCRE2_SPTR ptr, PCRE2_SPTR endptr) +{ + if (PRIV(script_run)(ptr, endptr, TRUE)) + return endptr; + return NULL; +} + +#endif /* SUPPORT_UNICODE */ + +static SLJIT_INLINE void match_script_run_common(compiler_common *common, int private_data_ptr, backtrack_common *parent) +{ +DEFINE_COMPILER; + +SLJIT_ASSERT(TMP1 == SLJIT_R0 && STR_PTR == SLJIT_R1); + +OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr); +#ifdef SUPPORT_UNICODE +sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_RET(SW) | SLJIT_ARG1(SW) | SLJIT_ARG2(SW), SLJIT_IMM, + common->utf ? SLJIT_FUNC_OFFSET(do_script_run_utf) : SLJIT_FUNC_OFFSET(do_script_run)); +#else +sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_RET(SW) | SLJIT_ARG1(SW) | SLJIT_ARG2(SW), SLJIT_IMM, SLJIT_FUNC_OFFSET(do_script_run)); +#endif + +OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_RETURN_REG, 0); +add_jump(compiler, parent->top != NULL ? &parent->top->nextbacktracks : &parent->topbacktracks, CMP(SLJIT_EQUAL, SLJIT_RETURN_REG, 0, SLJIT_IMM, 0)); +} + /* Handling bracketed expressions is probably the most complex part. @@ -8997,7 +10400,7 @@ if (opcode == OP_CBRA || opcode == OP_SCBRA) BACKTRACK_AS(bracket_backtrack)->private_data_ptr = private_data_ptr; matchingpath += IMM2_SIZE; } -else if (opcode == OP_ONCE || opcode == OP_SBRA || opcode == OP_SCOND) +else if (opcode == OP_ONCE || opcode == OP_SCRIPT_RUN || opcode == OP_SBRA || opcode == OP_SCOND) { /* Other brackets simply allocate the next entry. */ private_data_ptr = PRIVATE_DATA(ccbegin); @@ -9036,35 +10439,32 @@ if (bra == OP_BRAMINZERO) free_stack(common, 1); braminzero = CMP(SLJIT_EQUAL, STR_PTR, 0, SLJIT_IMM, 0); } - else + else if (opcode == OP_ONCE || opcode >= OP_SBRA) { - if (opcode == OP_ONCE || opcode >= OP_SBRA) + jump = CMP(SLJIT_NOT_EQUAL, STR_PTR, 0, SLJIT_IMM, 0); + OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(STACK_TOP), STACK(1)); + /* Nothing stored during the first run. */ + skip = JUMP(SLJIT_JUMP); + JUMPHERE(jump); + /* Checking zero-length iteration. */ + if (opcode != OP_ONCE || BACKTRACK_AS(bracket_backtrack)->u.framesize < 0) { - jump = CMP(SLJIT_NOT_EQUAL, STR_PTR, 0, SLJIT_IMM, 0); - OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(STACK_TOP), STACK(1)); - /* Nothing stored during the first run. */ - skip = JUMP(SLJIT_JUMP); - JUMPHERE(jump); - /* Checking zero-length iteration. */ - if (opcode != OP_ONCE || BACKTRACK_AS(bracket_backtrack)->u.framesize < 0) - { - /* When we come from outside, private_data_ptr contains the previous STR_PTR. */ - braminzero = CMP(SLJIT_EQUAL, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr); - } - else - { - /* Except when the whole stack frame must be saved. */ - OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr); - braminzero = CMP(SLJIT_EQUAL, STR_PTR, 0, SLJIT_MEM1(TMP1), STACK(-BACKTRACK_AS(bracket_backtrack)->u.framesize - 2)); - } - JUMPHERE(skip); + /* When we come from outside, private_data_ptr contains the previous STR_PTR. */ + braminzero = CMP(SLJIT_EQUAL, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr); } else { - jump = CMP(SLJIT_NOT_EQUAL, STR_PTR, 0, SLJIT_IMM, 0); - OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(STACK_TOP), STACK(1)); - JUMPHERE(jump); + /* Except when the whole stack frame must be saved. */ + OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr); + braminzero = CMP(SLJIT_EQUAL, STR_PTR, 0, SLJIT_MEM1(TMP1), STACK(-BACKTRACK_AS(bracket_backtrack)->u.framesize - 2)); } + JUMPHERE(skip); + } + else + { + jump = CMP(SLJIT_NOT_EQUAL, STR_PTR, 0, SLJIT_IMM, 0); + OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(STACK_TOP), STACK(1)); + JUMPHERE(jump); } } @@ -9081,7 +10481,7 @@ if (ket == OP_KETRMIN) if (ket == OP_KETRMAX) { rmax_label = LABEL(); - if (has_alternatives && opcode != OP_ONCE && opcode < OP_SBRA && repeat_type == 0) + if (has_alternatives && opcode >= OP_BRA && opcode < OP_SBRA && repeat_type == 0) BACKTRACK_AS(bracket_backtrack)->alternative_matchingpath = rmax_label; } @@ -9185,7 +10585,7 @@ else if (opcode == OP_CBRA || opcode == OP_SCBRA) OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(0), TMP2, 0); } } -else if (opcode == OP_SBRA || opcode == OP_SCOND) +else if (opcode == OP_SCRIPT_RUN || opcode == OP_SBRA || opcode == OP_SCOND) { /* Saving the previous value. */ OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr); @@ -9314,6 +10714,9 @@ if (SLJIT_UNLIKELY(sljit_get_compiler_error(compiler))) if (opcode == OP_ONCE) match_once_common(common, ket, BACKTRACK_AS(bracket_backtrack)->u.framesize, private_data_ptr, has_alternatives, needs_control_head); +if (opcode == OP_SCRIPT_RUN) + match_script_run_common(common, private_data_ptr, backtrack); + stacksize = 0; if (repeat_type == OP_MINUPTO) { @@ -9383,13 +10786,15 @@ if (ket == OP_KETRMAX) if (opcode != OP_ONCE) free_stack(common, 1); } - else if (opcode == OP_ONCE || opcode >= OP_SBRA) + else if (opcode < OP_BRA || opcode >= OP_SBRA) { if (has_alternatives) BACKTRACK_AS(bracket_backtrack)->alternative_matchingpath = LABEL(); + /* Checking zero-length iteration. */ if (opcode != OP_ONCE) { + /* This case includes opcodes such as OP_SCRIPT_RUN. */ CMPTO(SLJIT_NOT_EQUAL, SLJIT_MEM1(SLJIT_SP), private_data_ptr, STR_PTR, 0, rmax_label); /* Drop STR_PTR for greedy plus quantifier. */ if (bra != OP_BRAZERO) @@ -9456,7 +10861,7 @@ if (opcode == OP_ONCE) /* We temporarily encode the needs_control_head in the lowest bit. Note: on the target architectures of SLJIT the ((x << 1) >> 1) returns the same value for small signed numbers (including negative numbers). */ - BACKTRACK_AS(bracket_backtrack)->u.framesize = (BACKTRACK_AS(bracket_backtrack)->u.framesize << 1) | (needs_control_head ? 1 : 0); + BACKTRACK_AS(bracket_backtrack)->u.framesize = (int)((unsigned)BACKTRACK_AS(bracket_backtrack)->u.framesize << 1) | (needs_control_head ? 1 : 0); } return cc + repeat_length; } @@ -9951,7 +11356,7 @@ if (exact > 1) #ifdef SUPPORT_UNICODE && !common->utf #endif - ) + && type != OP_ANYNL && type != OP_EXTUNI) { OP2(SLJIT_ADD, TMP1, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(exact)); add_jump(compiler, &backtrack->topbacktracks, CMP(SLJIT_GREATER, TMP1, 0, STR_END, 0)); @@ -10634,6 +12039,7 @@ while (cc < ccend) break; case OP_ONCE: + case OP_SCRIPT_RUN: case OP_BRA: case OP_CBRA: case OP_COND: @@ -10787,14 +12193,14 @@ switch(opcode) if (CURRENT_AS(char_iterator_backtrack)->u.charpos.othercasebit != 0) OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, CURRENT_AS(char_iterator_backtrack)->u.charpos.othercasebit); CMPTO(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, CURRENT_AS(char_iterator_backtrack)->u.charpos.chr, CURRENT_AS(char_iterator_backtrack)->matchingpath); - skip_char_back(common); + move_back(common, NULL, TRUE); CMPTO(SLJIT_GREATER, STR_PTR, 0, TMP2, 0, label); } else { OP1(SLJIT_MOV, STR_PTR, 0, base, offset0); jump = CMP(SLJIT_LESS_EQUAL, STR_PTR, 0, base, offset1); - skip_char_back(common); + move_back(common, NULL, TRUE); OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); JUMPTO(SLJIT_JUMP, CURRENT_AS(char_iterator_backtrack)->matchingpath); } @@ -11240,6 +12646,9 @@ if (has_alternatives) compile_matchingpath(common, ccprev, cc, current); if (SLJIT_UNLIKELY(sljit_get_compiler_error(compiler))) return; + + if (opcode == OP_SCRIPT_RUN) + match_script_run_common(common, private_data_ptr, current); } /* Instructions after the current alternative is successfully matched. */ @@ -11368,7 +12777,7 @@ if (offset != 0) OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), private_data_ptr, TMP1, 0); } } -else if (opcode == OP_SBRA || opcode == OP_SCOND) +else if (opcode == OP_SCRIPT_RUN || opcode == OP_SBRA || opcode == OP_SCOND) { OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), private_data_ptr, SLJIT_MEM1(STACK_TOP), STACK(0)); free_stack(common, 1); @@ -11717,6 +13126,7 @@ while (current) break; case OP_ONCE: + case OP_SCRIPT_RUN: case OP_BRA: case OP_CBRA: case OP_COND: @@ -12016,6 +13426,9 @@ sljit_emit_fast_return(compiler, TMP2, 0); #undef COMPILE_BACKTRACKINGPATH #undef CURRENT_AS +#define PUBLIC_JIT_COMPILE_CONFIGURATION_OPTIONS \ + (PCRE2_JIT_INVALID_UTF) + static int jit_compile(pcre2_code *code, sljit_u32 mode) { pcre2_real_code *re = (pcre2_real_code *)code; @@ -12052,6 +13465,11 @@ common->re = re; common->name_table = (PCRE2_SPTR)((uint8_t *)re + sizeof(pcre2_real_code)); rootbacktrack.cc = common->name_table + re->name_count * re->name_entry_size; +#ifdef SUPPORT_UNICODE +common->invalid_utf = (mode & PCRE2_JIT_INVALID_UTF) != 0; +#endif /* SUPPORT_UNICODE */ +mode &= ~PUBLIC_JIT_COMPILE_CONFIGURATION_OPTIONS; + common->start = rootbacktrack.cc; common->read_only_data_head = NULL; common->fcc = tables + fcc_offset; @@ -12066,6 +13484,7 @@ switch(re->newline_convention) case PCRE2_NEWLINE_CRLF: common->newline = (CHAR_CR << 8) | CHAR_NL; break; case PCRE2_NEWLINE_ANY: common->newline = (CHAR_CR << 8) | CHAR_NL; common->nltype = NLTYPE_ANY; break; case PCRE2_NEWLINE_ANYCRLF: common->newline = (CHAR_CR << 8) | CHAR_NL; common->nltype = NLTYPE_ANYCRLF; break; + case PCRE2_NEWLINE_NUL: common->newline = CHAR_NUL; break; default: return PCRE2_ERROR_INTERNAL; } common->nlmax = READ_CHAR_MAX; @@ -12117,6 +13536,8 @@ if (common->utf) common->bsr_nlmax = (CHAR_CR > CHAR_NL) ? CHAR_CR : CHAR_NL; common->bsr_nlmin = (CHAR_CR < CHAR_NL) ? CHAR_CR : CHAR_NL; } +else + common->invalid_utf = FALSE; #endif /* SUPPORT_UNICODE */ ccend = bracketend(common->start); @@ -12557,22 +13978,49 @@ if (common->utfreadchar != NULL) set_jumps(common->utfreadchar, LABEL()); do_utfreadchar(common); } -if (common->utfreadchar16 != NULL) - { - set_jumps(common->utfreadchar16, LABEL()); - do_utfreadchar16(common); - } if (common->utfreadtype8 != NULL) { set_jumps(common->utfreadtype8, LABEL()); do_utfreadtype8(common); } +if (common->utfpeakcharback != NULL) + { + set_jumps(common->utfpeakcharback, LABEL()); + do_utfpeakcharback(common); + } #endif /* PCRE2_CODE_UNIT_WIDTH == 8 */ +#if PCRE2_CODE_UNIT_WIDTH == 8 || PCRE2_CODE_UNIT_WIDTH == 16 +if (common->utfreadchar_invalid != NULL) + { + set_jumps(common->utfreadchar_invalid, LABEL()); + do_utfreadchar_invalid(common); + } +if (common->utfreadnewline_invalid != NULL) + { + set_jumps(common->utfreadnewline_invalid, LABEL()); + do_utfreadnewline_invalid(common); + } +if (common->utfmoveback_invalid) + { + set_jumps(common->utfmoveback_invalid, LABEL()); + do_utfmoveback_invalid(common); + } +if (common->utfpeakcharback_invalid) + { + set_jumps(common->utfpeakcharback_invalid, LABEL()); + do_utfpeakcharback_invalid(common); + } +#endif /* PCRE2_CODE_UNIT_WIDTH == 8 || PCRE2_CODE_UNIT_WIDTH == 16 */ if (common->getucd != NULL) { set_jumps(common->getucd, LABEL()); do_getucd(common); } +if (common->getucdtype != NULL) + { + set_jumps(common->getucdtype, LABEL()); + do_getucdtype(common); + } #endif /* SUPPORT_UNICODE */ SLJIT_FREE(common->optimized_cbracket, allocator_data); @@ -12644,7 +14092,7 @@ Returns: 0: success or (*NOJIT) was used */ #define PUBLIC_JIT_COMPILE_OPTIONS \ - (PCRE2_JIT_COMPLETE|PCRE2_JIT_PARTIAL_SOFT|PCRE2_JIT_PARTIAL_HARD) + (PCRE2_JIT_COMPLETE|PCRE2_JIT_PARTIAL_SOFT|PCRE2_JIT_PARTIAL_HARD|PCRE2_JIT_INVALID_UTF) PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION pcre2_jit_compile(pcre2_code *code, uint32_t options) @@ -12659,6 +14107,7 @@ return PCRE2_ERROR_JIT_BADOPTION; pcre2_real_code *re = (pcre2_real_code *)code; executable_functions *functions; +uint32_t excluded_options; int result; if (code == NULL) @@ -12673,21 +14122,24 @@ functions = (executable_functions *)re->executable_jit; if ((options & PCRE2_JIT_COMPLETE) != 0 && (functions == NULL || functions->executable_funcs[0] == NULL)) { - result = jit_compile(code, PCRE2_JIT_COMPLETE); + excluded_options = (PCRE2_JIT_PARTIAL_SOFT | PCRE2_JIT_PARTIAL_HARD); + result = jit_compile(code, options & ~excluded_options); if (result != 0) return result; } if ((options & PCRE2_JIT_PARTIAL_SOFT) != 0 && (functions == NULL || functions->executable_funcs[1] == NULL)) { - result = jit_compile(code, PCRE2_JIT_PARTIAL_SOFT); + excluded_options = (PCRE2_JIT_COMPLETE | PCRE2_JIT_PARTIAL_HARD); + result = jit_compile(code, options & ~excluded_options); if (result != 0) return result; } if ((options & PCRE2_JIT_PARTIAL_HARD) != 0 && (functions == NULL || functions->executable_funcs[2] == NULL)) { - result = jit_compile(code, PCRE2_JIT_PARTIAL_HARD); + excluded_options = (PCRE2_JIT_COMPLETE | PCRE2_JIT_PARTIAL_SOFT); + result = jit_compile(code, options & ~excluded_options); if (result != 0) return result; } diff --git a/thirdparty/pcre2/src/pcre2_jit_match.c b/thirdparty/pcre2/src/pcre2_jit_match.c index 5a66545bae..eee038644d 100644 --- a/thirdparty/pcre2/src/pcre2_jit_match.c +++ b/thirdparty/pcre2/src/pcre2_jit_match.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016 University of Cambridge + New API code Copyright (c) 2016-2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -152,8 +152,6 @@ else jit_stack = NULL; } -/* JIT only need two offsets for each ovector entry. Hence - the last 1/3 of the ovector will never be touched. */ max_oveccount = functions->top_bracket; if (oveccount > max_oveccount) @@ -173,7 +171,7 @@ else if (rc > (int)oveccount) rc = 0; match_data->code = re; -match_data->subject = subject; +match_data->subject = (rc >= 0 || rc == PCRE2_ERROR_PARTIAL)? subject : NULL; match_data->rc = rc; match_data->startchar = arguments.startchar_ptr - subject; match_data->leftchar = 0; diff --git a/thirdparty/pcre2/src/pcre2_maketables.c b/thirdparty/pcre2/src/pcre2_maketables.c index 537edba8c3..5921e90793 100644 --- a/thirdparty/pcre2/src/pcre2_maketables.c +++ b/thirdparty/pcre2/src/pcre2_maketables.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2018 University of Cambridge + New API code Copyright (c) 2016-2019 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -114,17 +114,17 @@ test for alnum specially. */ memset(p, 0, cbit_length); for (i = 0; i < 256; i++) { - if (isdigit(i)) p[cbit_digit + i/8] |= 1 << (i&7); - if (isupper(i)) p[cbit_upper + i/8] |= 1 << (i&7); - if (islower(i)) p[cbit_lower + i/8] |= 1 << (i&7); - if (isalnum(i)) p[cbit_word + i/8] |= 1 << (i&7); - if (i == '_') p[cbit_word + i/8] |= 1 << (i&7); - if (isspace(i)) p[cbit_space + i/8] |= 1 << (i&7); - if (isxdigit(i))p[cbit_xdigit + i/8] |= 1 << (i&7); - if (isgraph(i)) p[cbit_graph + i/8] |= 1 << (i&7); - if (isprint(i)) p[cbit_print + i/8] |= 1 << (i&7); - if (ispunct(i)) p[cbit_punct + i/8] |= 1 << (i&7); - if (iscntrl(i)) p[cbit_cntrl + i/8] |= 1 << (i&7); + if (isdigit(i)) p[cbit_digit + i/8] |= 1u << (i&7); + if (isupper(i)) p[cbit_upper + i/8] |= 1u << (i&7); + if (islower(i)) p[cbit_lower + i/8] |= 1u << (i&7); + if (isalnum(i)) p[cbit_word + i/8] |= 1u << (i&7); + if (i == '_') p[cbit_word + i/8] |= 1u << (i&7); + if (isspace(i)) p[cbit_space + i/8] |= 1u << (i&7); + if (isxdigit(i))p[cbit_xdigit + i/8] |= 1u << (i&7); + if (isgraph(i)) p[cbit_graph + i/8] |= 1u << (i&7); + if (isprint(i)) p[cbit_print + i/8] |= 1u << (i&7); + if (ispunct(i)) p[cbit_punct + i/8] |= 1u << (i&7); + if (iscntrl(i)) p[cbit_cntrl + i/8] |= 1u << (i&7); } p += cbit_length; @@ -138,8 +138,8 @@ for (i = 0; i < 256; i++) int x = 0; if (isspace(i)) x += ctype_space; if (isalpha(i)) x += ctype_letter; + if (islower(i)) x += ctype_lcletter; if (isdigit(i)) x += ctype_digit; - if (isxdigit(i)) x += ctype_xdigit; if (isalnum(i) || i == '_') x += ctype_word; *p++ = x; } diff --git a/thirdparty/pcre2/src/pcre2_match.c b/thirdparty/pcre2/src/pcre2_match.c index 8741e1432d..419561fd64 100644 --- a/thirdparty/pcre2/src/pcre2_match.c +++ b/thirdparty/pcre2/src/pcre2_match.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2015-2018 University of Cambridge + New API code Copyright (c) 2015-2019 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -69,11 +69,12 @@ information, and fields within it. */ #define PUBLIC_MATCH_OPTIONS \ (PCRE2_ANCHORED|PCRE2_ENDANCHORED|PCRE2_NOTBOL|PCRE2_NOTEOL|PCRE2_NOTEMPTY| \ PCRE2_NOTEMPTY_ATSTART|PCRE2_NO_UTF_CHECK|PCRE2_PARTIAL_HARD| \ - PCRE2_PARTIAL_SOFT|PCRE2_NO_JIT) + PCRE2_PARTIAL_SOFT|PCRE2_NO_JIT|PCRE2_COPY_MATCHED_SUBJECT) #define PUBLIC_JIT_MATCH_OPTIONS \ (PCRE2_NO_UTF_CHECK|PCRE2_NOTBOL|PCRE2_NOTEOL|PCRE2_NOTEMPTY|\ - PCRE2_NOTEMPTY_ATSTART|PCRE2_PARTIAL_SOFT|PCRE2_PARTIAL_HARD) + PCRE2_NOTEMPTY_ATSTART|PCRE2_PARTIAL_SOFT|PCRE2_PARTIAL_HARD|\ + PCRE2_COPY_MATCHED_SUBJECT) /* Non-error returns from and within the match() function. Error returns are externally defined PCRE2_ERROR_xxx codes, which are all negative. */ @@ -1848,7 +1849,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode); if (Fop == OP_CLASS) RRETURN(MATCH_NOMATCH); } else - if ((Lbyte_map[fc/8] & (1 << (fc&7))) == 0) RRETURN(MATCH_NOMATCH); + if ((Lbyte_map[fc/8] & (1u << (fc&7))) == 0) RRETURN(MATCH_NOMATCH); } } else @@ -1870,7 +1871,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode); } else #endif - if ((Lbyte_map[fc/8] & (1 << (fc&7))) == 0) RRETURN(MATCH_NOMATCH); + if ((Lbyte_map[fc/8] & (1u << (fc&7))) == 0) RRETURN(MATCH_NOMATCH); } } @@ -1902,7 +1903,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode); if (Fop == OP_CLASS) RRETURN(MATCH_NOMATCH); } else - if ((Lbyte_map[fc/8] & (1 << (fc&7))) == 0) RRETURN(MATCH_NOMATCH); + if ((Lbyte_map[fc/8] & (1u << (fc&7))) == 0) RRETURN(MATCH_NOMATCH); } } else @@ -1927,7 +1928,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode); } else #endif - if ((Lbyte_map[fc/8] & (1 << (fc&7))) == 0) RRETURN(MATCH_NOMATCH); + if ((Lbyte_map[fc/8] & (1u << (fc&7))) == 0) RRETURN(MATCH_NOMATCH); } } /* Control never gets here */ @@ -1956,7 +1957,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode); if (Fop == OP_CLASS) break; } else - if ((Lbyte_map[fc/8] & (1 << (fc&7))) == 0) break; + if ((Lbyte_map[fc/8] & (1u << (fc&7))) == 0) break; Feptr += len; } @@ -1993,7 +1994,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode); } else #endif - if ((Lbyte_map[fc/8] & (1 << (fc&7))) == 0) break; + if ((Lbyte_map[fc/8] & (1u << (fc&7))) == 0) break; Feptr++; } @@ -4084,7 +4085,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode); GETCHAR(fc, fptr); } lgb = UCD_GRAPHBREAK(fc); - if ((PRIV(ucp_gbtable)[lgb] & (1 << rgb)) == 0) break; + if ((PRIV(ucp_gbtable)[lgb] & (1u << rgb)) == 0) break; Feptr = fptr; rgb = lgb; } @@ -5014,6 +5015,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode); must record a backtracking point and also set up a chained frame. */ case OP_ONCE: + case OP_SCRIPT_RUN: case OP_SBRA: Lframe_type = GF_NOCAPTURE | Fop; @@ -5526,6 +5528,14 @@ fprintf(stderr, "++ op=%d\n", *Fecode); case OP_ASSERTBACK_NOT: RRETURN(MATCH_MATCH); + /* At the end of a script run, apply the script-checking rules. This code + will never by exercised if Unicode support it not compiled, because in + that environment script runs cause an error at compile time. */ + + case OP_SCRIPT_RUN: + if (!PRIV(script_run)(P->eptr, Feptr, utf)) RRETURN(MATCH_NOMATCH); + break; + /* Whole-pattern recursion is coded as a recurse into group 0, so it won't be picked up here. Instead, we catch it when the OP_END is reached. Other recursion is handled here. */ @@ -6000,10 +6010,11 @@ pcre2_match(const pcre2_code *code, PCRE2_SPTR subject, PCRE2_SIZE length, pcre2_match_context *mcontext) { int rc; +int was_zero_terminated = 0; const uint8_t *start_bits = NULL; - const pcre2_real_code *re = (const pcre2_real_code *)code; + BOOL anchored; BOOL firstline; BOOL has_first_cu = FALSE; @@ -6043,7 +6054,11 @@ mb->stack_frames = (heapframe *)stack_frames_vector; /* A length equal to PCRE2_ZERO_TERMINATED implies a zero-terminated subject string. */ -if (length == PCRE2_ZERO_TERMINATED) length = PRIV(strlen)(subject); +if (length == PCRE2_ZERO_TERMINATED) + { + length = PRIV(strlen)(subject); + was_zero_terminated = 1; + } end_subject = subject + length; /* Plausibility checks */ @@ -6158,6 +6173,17 @@ if (mcontext != NULL && mcontext->offset_limit != PCRE2_UNSET && (re->overall_options & PCRE2_USE_OFFSET_LIMIT) == 0) return PCRE2_ERROR_BADOFFSETLIMIT; +/* If the match data block was previously used with PCRE2_COPY_MATCHED_SUBJECT, +free the memory that was obtained. Set the field to NULL for no match cases. */ + +if ((match_data->flags & PCRE2_MD_COPIED_SUBJECT) != 0) + { + match_data->memctl.free((void *)match_data->subject, + match_data->memctl.memory_data); + match_data->flags &= ~PCRE2_MD_COPIED_SUBJECT; + } +match_data->subject = NULL; + /* If the pattern was successfully studied with JIT support, run the JIT executable instead of the rest of this function. Most options must be set at compile time for the JIT code to be usable. Fallback to the normal code path if @@ -6169,7 +6195,19 @@ if (re->executable_jit != NULL && (options & ~PUBLIC_JIT_MATCH_OPTIONS) == 0) { rc = pcre2_jit_match(code, subject, length, start_offset, options, match_data, mcontext); - if (rc != PCRE2_ERROR_JIT_BADOPTION) return rc; + if (rc != PCRE2_ERROR_JIT_BADOPTION) + { + if (rc >= 0 && (options & PCRE2_COPY_MATCHED_SUBJECT) != 0) + { + length = CU2BYTES(length + was_zero_terminated); + match_data->subject = match_data->memctl.malloc(length, + match_data->memctl.memory_data); + if (match_data->subject == NULL) return PCRE2_ERROR_NOMEMORY; + memcpy((void *)match_data->subject, subject, length); + match_data->flags |= PCRE2_MD_COPIED_SUBJECT; + } + return rc; + } } #endif @@ -6421,7 +6459,7 @@ for(;;) #if PCRE2_CODE_UNIT_WIDTH != 8 if (c > 255) c = 255; #endif - ok = (start_bits[c/8] & (1 << (c&7))) != 0; + ok = (start_bits[c/8] & (1u << (c&7))) != 0; } } if (!ok) @@ -6538,7 +6576,7 @@ for(;;) #if PCRE2_CODE_UNIT_WIDTH != 8 if (c > 255) c = 255; #endif - if ((start_bits[c/8] & (1 << (c&7))) != 0) break; + if ((start_bits[c/8] & (1u << (c&7))) != 0) break; start_match++; } @@ -6809,13 +6847,13 @@ if (mb->match_frames != mb->stack_frames) /* Fill in fields that are always returned in the match data. */ match_data->code = re; -match_data->subject = subject; match_data->mark = mb->mark; match_data->matchedby = PCRE2_MATCHEDBY_INTERPRETER; /* Handle a fully successful match. Set the return code to the number of captured strings, or 0 if there were too many to fit into the ovector, and then -set the remaining returned values before returning. */ +set the remaining returned values before returning. Make a copy of the subject +string if requested. */ if (rc == MATCH_MATCH) { @@ -6825,6 +6863,16 @@ if (rc == MATCH_MATCH) match_data->leftchar = mb->start_used_ptr - subject; match_data->rightchar = ((mb->last_used_ptr > mb->end_match_ptr)? mb->last_used_ptr : mb->end_match_ptr) - subject; + if ((options & PCRE2_COPY_MATCHED_SUBJECT) != 0) + { + length = CU2BYTES(length + was_zero_terminated); + match_data->subject = match_data->memctl.malloc(length, + match_data->memctl.memory_data); + if (match_data->subject == NULL) return PCRE2_ERROR_NOMEMORY; + memcpy((void *)match_data->subject, subject, length); + match_data->flags |= PCRE2_MD_COPIED_SUBJECT; + } + else match_data->subject = subject; return match_data->rc; } @@ -6838,10 +6886,14 @@ match_data->mark = mb->nomatch_mark; if (rc != MATCH_NOMATCH && rc != PCRE2_ERROR_PARTIAL) match_data->rc = rc; -/* Handle a partial match. */ +/* Handle a partial match. If a "soft" partial match was requested, searching +for a complete match will have continued, and the value of rc at this point +will be MATCH_NOMATCH. For a "hard" partial match, it will already be +PCRE2_ERROR_PARTIAL. */ else if (match_partial != NULL) { + match_data->subject = subject; match_data->ovector[0] = match_partial - subject; match_data->ovector[1] = end_subject - subject; match_data->startchar = match_partial - subject; diff --git a/thirdparty/pcre2/src/pcre2_match_data.c b/thirdparty/pcre2/src/pcre2_match_data.c index b297f326b5..ccc5f6740e 100644 --- a/thirdparty/pcre2/src/pcre2_match_data.c +++ b/thirdparty/pcre2/src/pcre2_match_data.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2017 University of Cambridge + New API code Copyright (c) 2016-2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -63,6 +63,7 @@ yield = PRIV(memctl_malloc)( (pcre2_memctl *)gcontext); if (yield == NULL) return NULL; yield->oveccount = oveccount; +yield->flags = 0; return yield; } @@ -93,7 +94,12 @@ PCRE2_EXP_DEFN void PCRE2_CALL_CONVENTION pcre2_match_data_free(pcre2_match_data *match_data) { if (match_data != NULL) + { + if ((match_data->flags & PCRE2_MD_COPIED_SUBJECT) != 0) + match_data->memctl.free((void *)match_data->subject, + match_data->memctl.memory_data); match_data->memctl.free(match_data, match_data->memctl.memory_data); + } } diff --git a/thirdparty/pcre2/src/pcre2_script_run.c b/thirdparty/pcre2/src/pcre2_script_run.c new file mode 100644 index 0000000000..91a4833028 --- /dev/null +++ b/thirdparty/pcre2/src/pcre2_script_run.c @@ -0,0 +1,441 @@ +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +/* PCRE is a library of functions to support regular expressions whose syntax +and semantics are as close as possible to those of the Perl 5 language. + + Written by Philip Hazel + Original API code Copyright (c) 1997-2012 University of Cambridge + New API code Copyright (c) 2016-2018 University of Cambridge + +----------------------------------------------------------------------------- +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +----------------------------------------------------------------------------- +*/ + +/* This module contains the function for checking a script run. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "pcre2_internal.h" + + +/************************************************* +* Check script run * +*************************************************/ + +/* A script run is conceptually a sequence of characters all in the same +Unicode script. However, it isn't quite that simple. There are special rules +for scripts that are commonly used together, and also special rules for digits. +This function implements the appropriate checks, which is possible only when +PCRE2 is compiled with Unicode support. The function returns TRUE if there is +no Unicode support; however, it should never be called in that circumstance +because an error is given by pcre2_compile() if a script run is called for in a +version of PCRE2 compiled without Unicode support. + +Arguments: + pgr point to the first character + endptr point after the last character + utf TRUE if in UTF mode + +Returns: TRUE if this is a valid script run +*/ + +/* These dummy values must be less than the negation of the largest offset in +the PRIV(ucd_script_sets) vector, which is held in a 16-bit field in UCD +records (and is only likely to be a few hundred). */ + +#define SCRIPT_UNSET (-99999) +#define SCRIPT_HANPENDING (-99998) +#define SCRIPT_HANHIRAKATA (-99997) +#define SCRIPT_HANBOPOMOFO (-99996) +#define SCRIPT_HANHANGUL (-99995) +#define SCRIPT_LIST (-99994) + +#define INTERSECTION_LIST_SIZE 50 + +BOOL +PRIV(script_run)(PCRE2_SPTR ptr, PCRE2_SPTR endptr, BOOL utf) +{ +#ifdef SUPPORT_UNICODE +int require_script = SCRIPT_UNSET; +uint8_t intersection_list[INTERSECTION_LIST_SIZE]; +const uint8_t *require_list = NULL; +uint32_t require_digitset = 0; +uint32_t c; + +#if PCRE2_CODE_UNIT_WIDTH == 32 +(void)utf; /* Avoid compiler warning */ +#endif + +/* Any string containing fewer than 2 characters is a valid script run. */ + +if (ptr >= endptr) return TRUE; +GETCHARINCTEST(c, ptr); +if (ptr >= endptr) return TRUE; + +/* Scan strings of two or more characters, checking the Unicode characteristics +of each code point. We make use of the Script Extensions property. There is +special code for scripts that can be combined with characters from the Han +Chinese script. This may be used in conjunction with four other scripts in +these combinations: + +. Han with Hiragana and Katakana is allowed (for Japanese). +. Han with Bopomofo is allowed (for Taiwanese Mandarin). +. Han with Hangul is allowed (for Korean). + +If the first significant character's script is one of the four, the required +script type is immediately known. However, if the first significant +character's script is Han, we have to keep checking for a non-Han character. +Hence the SCRIPT_HANPENDING state. */ + +for (;;) + { + const ucd_record *ucd = GET_UCD(c); + int32_t scriptx = ucd->scriptx; + + /* If the script extension is Unknown, the string is not a valid script run. + Such characters can only form script runs of length one. */ + + if (scriptx == ucp_Unknown) return FALSE; + + /* A character whose script extension is Inherited is always accepted with + any script, and plays no further part in this testing. A character whose + script is Common is always accepted, but must still be tested for a digit + below. The scriptx value at this point is non-zero, because zero is + ucp_Unknown, tested for above. */ + + if (scriptx != ucp_Inherited) + { + if (scriptx != ucp_Common) + { + /* If the script extension value is positive, the character is not a mark + that can be used with many scripts. In the simple case we either set or + compare with the required script. However, handling the scripts that can + combine with Han are more complicated, as is the case when the previous + characters have been man-script marks. */ + + if (scriptx > 0) + { + switch(require_script) + { + /* Either the first significant character (require_script unset) or + after only Han characters. */ + + case SCRIPT_UNSET: + case SCRIPT_HANPENDING: + switch(scriptx) + { + case ucp_Han: + require_script = SCRIPT_HANPENDING; + break; + + case ucp_Hiragana: + case ucp_Katakana: + require_script = SCRIPT_HANHIRAKATA; + break; + + case ucp_Bopomofo: + require_script = SCRIPT_HANBOPOMOFO; + break; + + case ucp_Hangul: + require_script = SCRIPT_HANHANGUL; + break; + + /* Not a Han-related script. If expecting one, fail. Otherise set + the requirement to this script. */ + + default: + if (require_script == SCRIPT_HANPENDING) return FALSE; + require_script = scriptx; + break; + } + break; + + /* Previously encountered one of the "with Han" scripts. Check that + this character is appropriate. */ + + case SCRIPT_HANHIRAKATA: + if (scriptx != ucp_Han && scriptx != ucp_Hiragana && + scriptx != ucp_Katakana) + return FALSE; + break; + + case SCRIPT_HANBOPOMOFO: + if (scriptx != ucp_Han && scriptx != ucp_Bopomofo) return FALSE; + break; + + case SCRIPT_HANHANGUL: + if (scriptx != ucp_Han && scriptx != ucp_Hangul) return FALSE; + break; + + /* We have a list of scripts to check that is derived from one or + more previous characters. This is either one of the lists in + ucd_script_sets[] (for one previous character) or the intersection of + several lists for multiple characters. */ + + case SCRIPT_LIST: + { + const uint8_t *list; + for (list = require_list; *list != 0; list++) + { + if (*list == scriptx) break; + } + if (*list == 0) return FALSE; + } + + /* The rest of the string must be in this script, but we have to + allow for the Han complications. */ + + switch(scriptx) + { + case ucp_Han: + require_script = SCRIPT_HANPENDING; + break; + + case ucp_Hiragana: + case ucp_Katakana: + require_script = SCRIPT_HANHIRAKATA; + break; + + case ucp_Bopomofo: + require_script = SCRIPT_HANBOPOMOFO; + break; + + case ucp_Hangul: + require_script = SCRIPT_HANHANGUL; + break; + + default: + require_script = scriptx; + break; + } + break; + + /* This is the easy case when a single script is required. */ + + default: + if (scriptx != require_script) return FALSE; + break; + } + } /* End of handing positive scriptx */ + + /* If scriptx is negative, this character is a mark-type character that + has a list of permitted scripts. */ + + else + { + uint32_t chspecial; + const uint8_t *clist, *rlist; + const uint8_t *list = PRIV(ucd_script_sets) - scriptx; + + switch(require_script) + { + case SCRIPT_UNSET: + require_list = PRIV(ucd_script_sets) - scriptx; + require_script = SCRIPT_LIST; + break; + + /* An inspection of the Unicode 11.0.0 files shows that there are the + following types of Script Extension list that involve the Han, + Bopomofo, Hiragana, Katakana, and Hangul scripts: + + . Bopomofo + Han + . Han + Hiragana + Katakana + . Hiragana + Katakana + . Bopopmofo + Hangul + Han + Hiragana + Katakana + + The following code tries to make sense of this. */ + +#define FOUND_BOPOMOFO 1 +#define FOUND_HIRAGANA 2 +#define FOUND_KATAKANA 4 +#define FOUND_HANGUL 8 + + case SCRIPT_HANPENDING: + chspecial = 0; + for (; *list != 0; list++) + { + switch (*list) + { + case ucp_Bopomofo: chspecial |= FOUND_BOPOMOFO; break; + case ucp_Hiragana: chspecial |= FOUND_HIRAGANA; break; + case ucp_Katakana: chspecial |= FOUND_KATAKANA; break; + case ucp_Hangul: chspecial |= FOUND_HANGUL; break; + default: break; + } + } + + if (chspecial == 0) return FALSE; + + if (chspecial == FOUND_BOPOMOFO) + { + require_script = SCRIPT_HANBOPOMOFO; + } + else if (chspecial == (FOUND_HIRAGANA|FOUND_KATAKANA)) + { + require_script = SCRIPT_HANHIRAKATA; + } + + /* Otherwise it must be allowed with all of them, so remain in + the pending state. */ + + break; + + case SCRIPT_HANHIRAKATA: + for (; *list != 0; list++) + { + if (*list == ucp_Hiragana || *list == ucp_Katakana) break; + } + if (*list == 0) return FALSE; + break; + + case SCRIPT_HANBOPOMOFO: + for (; *list != 0; list++) + { + if (*list == ucp_Bopomofo) break; + } + if (*list == 0) return FALSE; + break; + + case SCRIPT_HANHANGUL: + for (; *list != 0; list++) + { + if (*list == ucp_Hangul) break; + } + if (*list == 0) return FALSE; + break; + + /* Previously encountered one or more characters that are allowed + with a list of scripts. Build the intersection of the required list + with this character's list in intersection_list[]. This code is + written so that it still works OK if the required list is already in + that vector. */ + + case SCRIPT_LIST: + { + int i = 0; + for (rlist = require_list; *rlist != 0; rlist++) + { + for (clist = list; *clist != 0; clist++) + { + if (*rlist == *clist) + { + intersection_list[i++] = *rlist; + break; + } + } + } + if (i == 0) return FALSE; /* No scripts in common */ + + /* If there's just one script in common, we can set it as the + unique required script. Otherwise, terminate the intersection list + and make it the required list. */ + + if (i == 1) + { + require_script = intersection_list[0]; + } + else + { + intersection_list[i] = 0; + require_list = intersection_list; + } + } + break; + + /* The previously set required script is a single script, not + Han-related. Check that it is in this character's list. */ + + default: + for (; *list != 0; list++) + { + if (*list == require_script) break; + } + if (*list == 0) return FALSE; + break; + } + } /* End of handling negative scriptx */ + } /* End of checking non-Common character */ + + /* The character is in an acceptable script. We must now ensure that all + decimal digits in the string come from the same set. Some scripts (e.g. + Common, Arabic) have more than one set of decimal digits. This code does + not allow mixing sets, even within the same script. The vector called + PRIV(ucd_digit_sets)[] contains, in its first element, the number of + following elements, and then, in ascending order, the code points of the + '9' characters in every set of 10 digits. Each set is identified by the + offset in the vector of its '9' character. An initial check of the first + value picks up ASCII digits quickly. Otherwise, a binary chop is used. */ + + if (ucd->chartype == ucp_Nd) + { + uint32_t digitset; + + if (c <= PRIV(ucd_digit_sets)[1]) digitset = 1; else + { + int mid; + int bot = 1; + int top = PRIV(ucd_digit_sets)[0]; + for (;;) + { + if (top <= bot + 1) /* <= rather than == is paranoia */ + { + digitset = top; + break; + } + mid = (top + bot) / 2; + if (c <= PRIV(ucd_digit_sets)[mid]) top = mid; else bot = mid; + } + } + + /* A required value of 0 means "unset". */ + + if (require_digitset == 0) require_digitset = digitset; + else if (digitset != require_digitset) return FALSE; + } /* End digit handling */ + } /* End checking non-Inherited character */ + + /* If we haven't yet got to the end, pick up the next character. */ + + if (ptr >= endptr) return TRUE; + GETCHARINCTEST(c, ptr); + } /* End checking loop */ + +#else /* NOT SUPPORT_UNICODE */ +(void)ptr; +(void)endptr; +(void)utf; +return TRUE; +#endif /* SUPPORT_UNICODE */ +} + +/* End of pcre2_script_run.c */ diff --git a/thirdparty/pcre2/src/pcre2_study.c b/thirdparty/pcre2/src/pcre2_study.c index acbf98b41b..e883c2eb4c 100644 --- a/thirdparty/pcre2/src/pcre2_study.c +++ b/thirdparty/pcre2/src/pcre2_study.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2018 University of Cambridge + New API code Copyright (c) 2016-2019 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -54,7 +54,7 @@ collecting data (e.g. minimum matching length). */ /* Set a bit in the starting code unit bit map. */ -#define SET_BIT(c) re->start_bitmap[(c)/8] |= (1 << ((c)&7)) +#define SET_BIT(c) re->start_bitmap[(c)/8] |= (1u << ((c)&7)) /* Returns from set_start_bits() */ @@ -171,6 +171,7 @@ for (;;) /* Fall through */ case OP_ONCE: + case OP_SCRIPT_RUN: case OP_SBRA: case OP_BRAPOS: case OP_SBRAPOS: @@ -842,7 +843,7 @@ for (c = 0; c < table_limit; c++) if (table_limit == 32) return; for (c = 128; c < 256; c++) { - if ((re->tables[cbits_offset + c/8] & (1 << (c&7))) != 0) + if ((re->tables[cbits_offset + c/8] & (1u << (c&7))) != 0) { PCRE2_UCHAR buff[6]; (void)PRIV(ord2utf)(c, buff); @@ -1075,6 +1076,7 @@ do case OP_CBRAPOS: case OP_SCBRAPOS: case OP_ONCE: + case OP_SCRIPT_RUN: case OP_ASSERT: rc = set_start_bits(re, tcode, utf); if (rc == SSB_FAIL || rc == SSB_UNKNOWN) return rc; @@ -1505,11 +1507,11 @@ do for (c = 0; c < 16; c++) re->start_bitmap[c] |= classmap[c]; for (c = 128; c < 256; c++) { - if ((classmap[c/8] & (1 << (c&7))) != 0) + if ((classmap[c/8] & (1u << (c&7))) != 0) { - int d = (c >> 6) | 0xc0; /* Set bit for this starter */ - re->start_bitmap[d/8] |= (1 << (d&7)); /* and then skip on to the */ - c = (c & 0xc0) + 0x40 - 1; /* next relevant character. */ + int d = (c >> 6) | 0xc0; /* Set bit for this starter */ + re->start_bitmap[d/8] |= (1u << (d&7)); /* and then skip on to the */ + c = (c & 0xc0) + 0x40 - 1; /* next relevant character. */ } } } diff --git a/thirdparty/pcre2/src/pcre2_substitute.c b/thirdparty/pcre2/src/pcre2_substitute.c index ab8d10908a..ec3dd66df9 100644 --- a/thirdparty/pcre2/src/pcre2_substitute.c +++ b/thirdparty/pcre2/src/pcre2_substitute.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2018 University of Cambridge + New API code Copyright (c) 2016-2019 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -129,7 +129,7 @@ for (; ptr < ptrend; ptr++) ptr += 1; /* Must point after \ */ erc = PRIV(check_escape)(&ptr, ptrend, &ch, &errorcode, - code->overall_options, FALSE, NULL); + code->overall_options, code->extra_options, FALSE, NULL); ptr -= 1; /* Back to last code unit of escape */ if (errorcode != 0) { @@ -239,13 +239,17 @@ PCRE2_SIZE extra_needed = 0; PCRE2_SIZE buff_offset, buff_length, lengthleft, fraglength; PCRE2_SIZE *ovector; PCRE2_SIZE ovecsave[3]; +pcre2_substitute_callout_block scb; + +/* General initialization */ buff_offset = 0; lengthleft = buff_length = *blength; *blength = PCRE2_UNSET; ovecsave[0] = ovecsave[1] = ovecsave[2] = PCRE2_UNSET; -/* Partial matching is not valid. */ +/* Partial matching is not valid. This must come after setting *blength to +PCRE2_UNSET, so as not to imply an offset in the replacement. */ if ((options & (PCRE2_PARTIAL_HARD|PCRE2_PARTIAL_SOFT)) != 0) return PCRE2_ERROR_BADOPTION; @@ -264,6 +268,13 @@ if (match_data == NULL) ovector = pcre2_get_ovector_pointer(match_data); ovector_count = pcre2_get_ovector_count(match_data); +/* Fixed things in the callout block */ + +scb.version = 0; +scb.input = subject; +scb.output = (PCRE2_SPTR)buffer; +scb.ovector = ovector; + /* Find lengths of zero-terminated strings and the end of the replacement. */ if (length == PCRE2_ZERO_TERMINATED) length = PRIV(strlen)(subject); @@ -390,7 +401,7 @@ do rc = PCRE2_ERROR_INTERNAL_DUPMATCH; goto EXIT; } - + /* Count substitutions with a paranoid check for integer overflow; surely no real call to this function would ever hit this! */ @@ -401,11 +412,14 @@ do } subs++; - /* Copy the text leading up to the match. */ + /* Copy the text leading up to the match, and remember where the insert + begins and how many ovector pairs are set. */ if (rc == 0) rc = ovector_count; fraglength = ovector[0] - start_offset; CHECKMEMCPY(subject + start_offset, fraglength); + scb.output_offsets[0] = buff_offset; + scb.oveccount = rc; /* Process the replacement string. Literal mode is set by \Q, but only in extended mode when backslashes are being interpreted. In extended mode we @@ -421,7 +435,7 @@ do if (ptr >= repend) { - if (ptrstackptr <= 0) break; /* End of replacement string */ + if (ptrstackptr == 0) break; /* End of replacement string */ repend = ptrstack[--ptrstackptr]; ptr = ptrstack[--ptrstackptr]; continue; @@ -702,7 +716,7 @@ do { if (((code->tables + cbits_offset + ((forcecase > 0)? cbit_upper:cbit_lower) - )[ch/8] & (1 << (ch%8))) == 0) + )[ch/8] & (1u << (ch%8))) == 0) ch = (code->tables + fcc_offset)[ch]; } forcecase = forcecasereset; @@ -760,7 +774,7 @@ do ptr++; /* Point after \ */ rc = PRIV(check_escape)(&ptr, repend, &ch, &errorcode, - code->overall_options, FALSE, NULL); + code->overall_options, code->extra_options, FALSE, NULL); if (errorcode != 0) goto BADESCAPE; switch(rc) @@ -804,7 +818,7 @@ do { if (((code->tables + cbits_offset + ((forcecase > 0)? cbit_upper:cbit_lower) - )[ch/8] & (1 << (ch%8))) == 0) + )[ch/8] & (1u << (ch%8))) == 0) ch = (code->tables + fcc_offset)[ch]; } forcecase = forcecasereset; @@ -821,10 +835,37 @@ do } /* End handling a literal code unit */ } /* End of loop for scanning the replacement. */ - /* The replacement has been copied to the output. Save the details of this - match. See above for how this data is used. If we matched an empty string, do - the magic for global matches. Finally, update the start offset to point to - the rest of the subject string. */ + /* The replacement has been copied to the output, or its size has been + remembered. Do the callout if there is one and we have done an actual + replacement. */ + + if (!overflowed && mcontext != NULL && mcontext->substitute_callout != NULL) + { + scb.subscount = subs; + scb.output_offsets[1] = buff_offset; + rc = mcontext->substitute_callout(&scb, mcontext->substitute_callout_data); + + /* A non-zero return means cancel this substitution. Instead, copy the + matched string fragment. */ + + if (rc != 0) + { + PCRE2_SIZE newlength = scb.output_offsets[1] - scb.output_offsets[0]; + PCRE2_SIZE oldlength = ovector[1] - ovector[0]; + + buff_offset -= newlength; + lengthleft += newlength; + CHECKMEMCPY(subject + ovector[0], oldlength); + + /* A negative return means do not do any more. */ + + if (rc < 0) suboptions &= (~PCRE2_SUBSTITUTE_GLOBAL); + } + } + + /* Save the details of this match. See above for how this data is used. If we + matched an empty string, do the magic for global matches. Finally, update the + start offset to point to the rest of the subject string. */ ovecsave[0] = ovector[0]; ovecsave[1] = ovector[1]; diff --git a/thirdparty/pcre2/src/pcre2_tables.c b/thirdparty/pcre2/src/pcre2_tables.c index 83d6f9de55..84019361fc 100644 --- a/thirdparty/pcre2/src/pcre2_tables.c +++ b/thirdparty/pcre2/src/pcre2_tables.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2018 University of Cambridge + New API code Copyright (c) 2016-2019 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -142,7 +142,7 @@ ucp_gbXX values defined in pcre2_ucp.h. These changed between Unicode versions code points. The left property selects a word from the table, and the right property selects a bit from that word like this: - PRIV(ucp_gbtable)[left-property] & (1 << right-property) + PRIV(ucp_gbtable)[left-property] & (1u << right-property) The value is non-zero if a grapheme break is NOT permitted between the relevant two code points. The breaking rules are as follows: @@ -183,25 +183,25 @@ are implementing). #define ESZ (1<<ucp_gbExtend)|(1<<ucp_gbSpacingMark)|(1<<ucp_gbZWJ) const uint32_t PRIV(ucp_gbtable)[] = { - (1<<ucp_gbLF), /* 0 CR */ - 0, /* 1 LF */ - 0, /* 2 Control */ - ESZ, /* 3 Extend */ - ESZ|(1<<ucp_gbPrepend)| /* 4 Prepend */ - (1<<ucp_gbL)|(1<<ucp_gbV)|(1<<ucp_gbT)| - (1<<ucp_gbLV)|(1<<ucp_gbLVT)|(1<<ucp_gbOther)| - (1<<ucp_gbRegionalIndicator), - ESZ, /* 5 SpacingMark */ - ESZ|(1<<ucp_gbL)|(1<<ucp_gbV)|(1<<ucp_gbLV)| /* 6 L */ - (1<<ucp_gbLVT), - ESZ|(1<<ucp_gbV)|(1<<ucp_gbT), /* 7 V */ - ESZ|(1<<ucp_gbT), /* 8 T */ - ESZ|(1<<ucp_gbV)|(1<<ucp_gbT), /* 9 LV */ - ESZ|(1<<ucp_gbT), /* 10 LVT */ - (1<<ucp_gbRegionalIndicator), /* 11 RegionalIndicator */ - ESZ, /* 12 Other */ - ESZ, /* 13 ZWJ */ - ESZ|(1<<ucp_gbExtended_Pictographic) /* 14 Extended Pictographic */ + (1u<<ucp_gbLF), /* 0 CR */ + 0, /* 1 LF */ + 0, /* 2 Control */ + ESZ, /* 3 Extend */ + ESZ|(1u<<ucp_gbPrepend)| /* 4 Prepend */ + (1u<<ucp_gbL)|(1u<<ucp_gbV)|(1u<<ucp_gbT)| + (1u<<ucp_gbLV)|(1u<<ucp_gbLVT)|(1u<<ucp_gbOther)| + (1u<<ucp_gbRegionalIndicator), + ESZ, /* 5 SpacingMark */ + ESZ|(1u<<ucp_gbL)|(1u<<ucp_gbV)|(1u<<ucp_gbLV)| /* 6 L */ + (1u<<ucp_gbLVT), + ESZ|(1u<<ucp_gbV)|(1u<<ucp_gbT), /* 7 V */ + ESZ|(1u<<ucp_gbT), /* 8 T */ + ESZ|(1u<<ucp_gbV)|(1u<<ucp_gbT), /* 9 LV */ + ESZ|(1u<<ucp_gbT), /* 10 LVT */ + (1u<<ucp_gbRegionalIndicator), /* 11 RegionalIndicator */ + ESZ, /* 12 Other */ + ESZ, /* 13 ZWJ */ + ESZ|(1u<<ucp_gbExtended_Pictographic) /* 14 Extended Pictographic */ }; #undef ESZ @@ -417,6 +417,7 @@ strings to make sure that UTF-8 support works on EBCDIC platforms. */ #define STRING_Tifinagh0 STR_T STR_i STR_f STR_i STR_n STR_a STR_g STR_h "\0" #define STRING_Tirhuta0 STR_T STR_i STR_r STR_h STR_u STR_t STR_a "\0" #define STRING_Ugaritic0 STR_U STR_g STR_a STR_r STR_i STR_t STR_i STR_c "\0" +#define STRING_Unknown0 STR_U STR_n STR_k STR_n STR_o STR_w STR_n "\0" #define STRING_Vai0 STR_V STR_a STR_i "\0" #define STRING_Warang_Citi0 STR_W STR_a STR_r STR_a STR_n STR_g STR_UNDERSCORE STR_C STR_i STR_t STR_i "\0" #define STRING_Xan0 STR_X STR_a STR_n "\0" @@ -611,6 +612,7 @@ const char PRIV(utt_names)[] = STRING_Tifinagh0 STRING_Tirhuta0 STRING_Ugaritic0 + STRING_Unknown0 STRING_Vai0 STRING_Warang_Citi0 STRING_Xan0 @@ -805,19 +807,20 @@ const ucp_type_table PRIV(utt)[] = { { 1424, PT_SC, ucp_Tifinagh }, { 1433, PT_SC, ucp_Tirhuta }, { 1441, PT_SC, ucp_Ugaritic }, - { 1450, PT_SC, ucp_Vai }, - { 1454, PT_SC, ucp_Warang_Citi }, - { 1466, PT_ALNUM, 0 }, - { 1470, PT_PXSPACE, 0 }, - { 1474, PT_SPACE, 0 }, - { 1478, PT_UCNC, 0 }, - { 1482, PT_WORD, 0 }, - { 1486, PT_SC, ucp_Yi }, - { 1489, PT_GC, ucp_Z }, - { 1491, PT_SC, ucp_Zanabazar_Square }, - { 1508, PT_PC, ucp_Zl }, - { 1511, PT_PC, ucp_Zp }, - { 1514, PT_PC, ucp_Zs } + { 1450, PT_SC, ucp_Unknown }, + { 1458, PT_SC, ucp_Vai }, + { 1462, PT_SC, ucp_Warang_Citi }, + { 1474, PT_ALNUM, 0 }, + { 1478, PT_PXSPACE, 0 }, + { 1482, PT_SPACE, 0 }, + { 1486, PT_UCNC, 0 }, + { 1490, PT_WORD, 0 }, + { 1494, PT_SC, ucp_Yi }, + { 1497, PT_GC, ucp_Z }, + { 1499, PT_SC, ucp_Zanabazar_Square }, + { 1516, PT_PC, ucp_Zl }, + { 1519, PT_PC, ucp_Zp }, + { 1522, PT_PC, ucp_Zs } }; const size_t PRIV(utt_size) = sizeof(PRIV(utt)) / sizeof(ucp_type_table); diff --git a/thirdparty/pcre2/src/pcre2_ucd.c b/thirdparty/pcre2/src/pcre2_ucd.c index 275a4be2fe..cc53c24001 100644 --- a/thirdparty/pcre2/src/pcre2_ucd.c +++ b/thirdparty/pcre2/src/pcre2_ucd.c @@ -20,7 +20,7 @@ needed. */ /* Unicode character database. */ /* This file was autogenerated by the MultiStage2.py script. */ -/* Total size: 92592 bytes, block size: 128. */ +/* Total size: 97152 bytes, block size: 128. */ /* The tables herein are needed only when UCP support is built, and in PCRE2 that happens automatically with UTF support. @@ -30,10 +30,10 @@ a comment was received about space saving - maybe the guy linked all the modules rather than using a library - so we include a condition to cut out the tables when not needed. But don't leave a totally empty module because some compilers barf at that. -Instead, just supply small dummy tables. */ +Instead, just supply some small dummy tables. */ #ifndef SUPPORT_UNICODE -const ucd_record PRIV(ucd_records)[] = {{0,0,0,0,0 }}; +const ucd_record PRIV(ucd_records)[] = {{0,0,0,0,0,0,0 }}; const uint16_t PRIV(ucd_stage1)[] = {0}; const uint16_t PRIV(ucd_stage2)[] = {0}; const uint32_t PRIV(ucd_caseless_sets)[] = {0}; @@ -47,11 +47,13 @@ special record. */ #if PCRE2_CODE_UNIT_WIDTH == 32 const ucd_record PRIV(dummy_ucd_record)[] = {{ - ucp_Common, /* script */ - ucp_Cn, /* type unassigned */ - ucp_gbOther, /* grapheme break property */ - 0, /* case set */ - 0, /* other case */ + ucp_Unknown, /* script */ + ucp_Cn, /* type unassigned */ + ucp_gbOther, /* grapheme break property */ + 0, /* case set */ + 0, /* other case */ + ucp_Unknown, /* script extension */ + 0, /* dummy filler */ }}; #endif @@ -65,9 +67,13 @@ uint8_t property_1; uint8_t property_2; uint8_t property_3; pcre_int32 property_4; +pcre_int16 property_5; +uint16_t property_6; } ucd_record; */ +/* This table contains lists of characters that are caseless sets of +more than one character. Each list is terminated by NOTACHAR. */ const uint32_t PRIV(ucd_caseless_sets)[] = { NOTACHAR, @@ -100,865 +106,1014 @@ const uint32_t PRIV(ucd_caseless_sets)[] = { 0x1c88, 0xa64a, 0xa64b, NOTACHAR, }; -/* When #included in pcre2test, we don't need this large table. */ +/* When #included in pcre2test, we don't need the table of digit +sets, nor the the large main UCD tables. */ #ifndef PCRE2_PCRE2TEST -const ucd_record PRIV(ucd_records)[] = { /* 6832 bytes, record size 8 */ - { 9, 0, 2, 0, 0, }, /* 0 */ - { 9, 0, 1, 0, 0, }, /* 1 */ - { 9, 0, 0, 0, 0, }, /* 2 */ - { 9, 29, 12, 0, 0, }, /* 3 */ - { 9, 21, 12, 0, 0, }, /* 4 */ - { 9, 23, 12, 0, 0, }, /* 5 */ - { 9, 22, 12, 0, 0, }, /* 6 */ - { 9, 18, 12, 0, 0, }, /* 7 */ - { 9, 25, 12, 0, 0, }, /* 8 */ - { 9, 17, 12, 0, 0, }, /* 9 */ - { 9, 13, 12, 0, 0, }, /* 10 */ - { 33, 9, 12, 0, 32, }, /* 11 */ - { 33, 9, 12, 100, 32, }, /* 12 */ - { 33, 9, 12, 1, 32, }, /* 13 */ - { 9, 24, 12, 0, 0, }, /* 14 */ - { 9, 16, 12, 0, 0, }, /* 15 */ - { 33, 5, 12, 0, -32, }, /* 16 */ - { 33, 5, 12, 100, -32, }, /* 17 */ - { 33, 5, 12, 1, -32, }, /* 18 */ - { 9, 26, 12, 0, 0, }, /* 19 */ - { 9, 26, 14, 0, 0, }, /* 20 */ - { 33, 7, 12, 0, 0, }, /* 21 */ - { 9, 20, 12, 0, 0, }, /* 22 */ - { 9, 1, 2, 0, 0, }, /* 23 */ - { 9, 15, 12, 0, 0, }, /* 24 */ - { 9, 5, 12, 26, 775, }, /* 25 */ - { 9, 19, 12, 0, 0, }, /* 26 */ - { 33, 9, 12, 104, 32, }, /* 27 */ - { 33, 5, 12, 0, 7615, }, /* 28 */ - { 33, 5, 12, 104, -32, }, /* 29 */ - { 33, 5, 12, 0, 121, }, /* 30 */ - { 33, 9, 12, 0, 1, }, /* 31 */ - { 33, 5, 12, 0, -1, }, /* 32 */ - { 33, 9, 12, 0, 0, }, /* 33 */ - { 33, 5, 12, 0, 0, }, /* 34 */ - { 33, 9, 12, 0, -121, }, /* 35 */ - { 33, 5, 12, 1, -268, }, /* 36 */ - { 33, 5, 12, 0, 195, }, /* 37 */ - { 33, 9, 12, 0, 210, }, /* 38 */ - { 33, 9, 12, 0, 206, }, /* 39 */ - { 33, 9, 12, 0, 205, }, /* 40 */ - { 33, 9, 12, 0, 79, }, /* 41 */ - { 33, 9, 12, 0, 202, }, /* 42 */ - { 33, 9, 12, 0, 203, }, /* 43 */ - { 33, 9, 12, 0, 207, }, /* 44 */ - { 33, 5, 12, 0, 97, }, /* 45 */ - { 33, 9, 12, 0, 211, }, /* 46 */ - { 33, 9, 12, 0, 209, }, /* 47 */ - { 33, 5, 12, 0, 163, }, /* 48 */ - { 33, 9, 12, 0, 213, }, /* 49 */ - { 33, 5, 12, 0, 130, }, /* 50 */ - { 33, 9, 12, 0, 214, }, /* 51 */ - { 33, 9, 12, 0, 218, }, /* 52 */ - { 33, 9, 12, 0, 217, }, /* 53 */ - { 33, 9, 12, 0, 219, }, /* 54 */ - { 33, 5, 12, 0, 56, }, /* 55 */ - { 33, 9, 12, 5, 2, }, /* 56 */ - { 33, 8, 12, 5, 1, }, /* 57 */ - { 33, 5, 12, 5, -2, }, /* 58 */ - { 33, 9, 12, 9, 2, }, /* 59 */ - { 33, 8, 12, 9, 1, }, /* 60 */ - { 33, 5, 12, 9, -2, }, /* 61 */ - { 33, 9, 12, 13, 2, }, /* 62 */ - { 33, 8, 12, 13, 1, }, /* 63 */ - { 33, 5, 12, 13, -2, }, /* 64 */ - { 33, 5, 12, 0, -79, }, /* 65 */ - { 33, 9, 12, 17, 2, }, /* 66 */ - { 33, 8, 12, 17, 1, }, /* 67 */ - { 33, 5, 12, 17, -2, }, /* 68 */ - { 33, 9, 12, 0, -97, }, /* 69 */ - { 33, 9, 12, 0, -56, }, /* 70 */ - { 33, 9, 12, 0, -130, }, /* 71 */ - { 33, 9, 12, 0, 10795, }, /* 72 */ - { 33, 9, 12, 0, -163, }, /* 73 */ - { 33, 9, 12, 0, 10792, }, /* 74 */ - { 33, 5, 12, 0, 10815, }, /* 75 */ - { 33, 9, 12, 0, -195, }, /* 76 */ - { 33, 9, 12, 0, 69, }, /* 77 */ - { 33, 9, 12, 0, 71, }, /* 78 */ - { 33, 5, 12, 0, 10783, }, /* 79 */ - { 33, 5, 12, 0, 10780, }, /* 80 */ - { 33, 5, 12, 0, 10782, }, /* 81 */ - { 33, 5, 12, 0, -210, }, /* 82 */ - { 33, 5, 12, 0, -206, }, /* 83 */ - { 33, 5, 12, 0, -205, }, /* 84 */ - { 33, 5, 12, 0, -202, }, /* 85 */ - { 33, 5, 12, 0, -203, }, /* 86 */ - { 33, 5, 12, 0, 42319, }, /* 87 */ - { 33, 5, 12, 0, 42315, }, /* 88 */ - { 33, 5, 12, 0, -207, }, /* 89 */ - { 33, 5, 12, 0, 42280, }, /* 90 */ - { 33, 5, 12, 0, 42308, }, /* 91 */ - { 33, 5, 12, 0, -209, }, /* 92 */ - { 33, 5, 12, 0, -211, }, /* 93 */ - { 33, 5, 12, 0, 10743, }, /* 94 */ - { 33, 5, 12, 0, 42305, }, /* 95 */ - { 33, 5, 12, 0, 10749, }, /* 96 */ - { 33, 5, 12, 0, -213, }, /* 97 */ - { 33, 5, 12, 0, -214, }, /* 98 */ - { 33, 5, 12, 0, 10727, }, /* 99 */ - { 33, 5, 12, 0, -218, }, /* 100 */ - { 33, 5, 12, 0, 42282, }, /* 101 */ - { 33, 5, 12, 0, -69, }, /* 102 */ - { 33, 5, 12, 0, -217, }, /* 103 */ - { 33, 5, 12, 0, -71, }, /* 104 */ - { 33, 5, 12, 0, -219, }, /* 105 */ - { 33, 5, 12, 0, 42261, }, /* 106 */ - { 33, 5, 12, 0, 42258, }, /* 107 */ - { 33, 6, 12, 0, 0, }, /* 108 */ - { 9, 6, 12, 0, 0, }, /* 109 */ - { 3, 24, 12, 0, 0, }, /* 110 */ - { 27, 12, 3, 0, 0, }, /* 111 */ - { 27, 12, 3, 21, 116, }, /* 112 */ - { 19, 9, 12, 0, 1, }, /* 113 */ - { 19, 5, 12, 0, -1, }, /* 114 */ - { 19, 24, 12, 0, 0, }, /* 115 */ - { 9, 2, 12, 0, 0, }, /* 116 */ - { 19, 6, 12, 0, 0, }, /* 117 */ - { 19, 5, 12, 0, 130, }, /* 118 */ - { 19, 9, 12, 0, 116, }, /* 119 */ - { 19, 9, 12, 0, 38, }, /* 120 */ - { 19, 9, 12, 0, 37, }, /* 121 */ - { 19, 9, 12, 0, 64, }, /* 122 */ - { 19, 9, 12, 0, 63, }, /* 123 */ - { 19, 5, 12, 0, 0, }, /* 124 */ - { 19, 9, 12, 0, 32, }, /* 125 */ - { 19, 9, 12, 34, 32, }, /* 126 */ - { 19, 9, 12, 59, 32, }, /* 127 */ - { 19, 9, 12, 38, 32, }, /* 128 */ - { 19, 9, 12, 21, 32, }, /* 129 */ - { 19, 9, 12, 51, 32, }, /* 130 */ - { 19, 9, 12, 26, 32, }, /* 131 */ - { 19, 9, 12, 47, 32, }, /* 132 */ - { 19, 9, 12, 55, 32, }, /* 133 */ - { 19, 9, 12, 30, 32, }, /* 134 */ - { 19, 9, 12, 43, 32, }, /* 135 */ - { 19, 9, 12, 96, 32, }, /* 136 */ - { 19, 5, 12, 0, -38, }, /* 137 */ - { 19, 5, 12, 0, -37, }, /* 138 */ - { 19, 5, 12, 0, -32, }, /* 139 */ - { 19, 5, 12, 34, -32, }, /* 140 */ - { 19, 5, 12, 59, -32, }, /* 141 */ - { 19, 5, 12, 38, -32, }, /* 142 */ - { 19, 5, 12, 21, -116, }, /* 143 */ - { 19, 5, 12, 51, -32, }, /* 144 */ - { 19, 5, 12, 26, -775, }, /* 145 */ - { 19, 5, 12, 47, -32, }, /* 146 */ - { 19, 5, 12, 55, -32, }, /* 147 */ - { 19, 5, 12, 30, 1, }, /* 148 */ - { 19, 5, 12, 30, -32, }, /* 149 */ - { 19, 5, 12, 43, -32, }, /* 150 */ - { 19, 5, 12, 96, -32, }, /* 151 */ - { 19, 5, 12, 0, -64, }, /* 152 */ - { 19, 5, 12, 0, -63, }, /* 153 */ - { 19, 9, 12, 0, 8, }, /* 154 */ - { 19, 5, 12, 34, -30, }, /* 155 */ - { 19, 5, 12, 38, -25, }, /* 156 */ - { 19, 9, 12, 0, 0, }, /* 157 */ - { 19, 5, 12, 43, -15, }, /* 158 */ - { 19, 5, 12, 47, -22, }, /* 159 */ - { 19, 5, 12, 0, -8, }, /* 160 */ - { 10, 9, 12, 0, 1, }, /* 161 */ - { 10, 5, 12, 0, -1, }, /* 162 */ - { 19, 5, 12, 51, -54, }, /* 163 */ - { 19, 5, 12, 55, -48, }, /* 164 */ - { 19, 5, 12, 0, 7, }, /* 165 */ - { 19, 5, 12, 0, -116, }, /* 166 */ - { 19, 9, 12, 38, -60, }, /* 167 */ - { 19, 5, 12, 59, -64, }, /* 168 */ - { 19, 25, 12, 0, 0, }, /* 169 */ - { 19, 9, 12, 0, -7, }, /* 170 */ - { 19, 9, 12, 0, -130, }, /* 171 */ - { 12, 9, 12, 0, 80, }, /* 172 */ - { 12, 9, 12, 0, 32, }, /* 173 */ - { 12, 9, 12, 63, 32, }, /* 174 */ - { 12, 9, 12, 67, 32, }, /* 175 */ - { 12, 9, 12, 71, 32, }, /* 176 */ - { 12, 9, 12, 75, 32, }, /* 177 */ - { 12, 9, 12, 79, 32, }, /* 178 */ - { 12, 9, 12, 84, 32, }, /* 179 */ - { 12, 5, 12, 0, -32, }, /* 180 */ - { 12, 5, 12, 63, -32, }, /* 181 */ - { 12, 5, 12, 67, -32, }, /* 182 */ - { 12, 5, 12, 71, -32, }, /* 183 */ - { 12, 5, 12, 75, -32, }, /* 184 */ - { 12, 5, 12, 79, -32, }, /* 185 */ - { 12, 5, 12, 84, -32, }, /* 186 */ - { 12, 5, 12, 0, -80, }, /* 187 */ - { 12, 9, 12, 0, 1, }, /* 188 */ - { 12, 5, 12, 0, -1, }, /* 189 */ - { 12, 9, 12, 88, 1, }, /* 190 */ - { 12, 5, 12, 88, -1, }, /* 191 */ - { 12, 26, 12, 0, 0, }, /* 192 */ - { 12, 12, 3, 0, 0, }, /* 193 */ - { 12, 11, 3, 0, 0, }, /* 194 */ - { 12, 9, 12, 0, 15, }, /* 195 */ - { 12, 5, 12, 0, -15, }, /* 196 */ - { 1, 9, 12, 0, 48, }, /* 197 */ - { 1, 6, 12, 0, 0, }, /* 198 */ - { 1, 21, 12, 0, 0, }, /* 199 */ - { 1, 5, 12, 0, 0, }, /* 200 */ - { 1, 5, 12, 0, -48, }, /* 201 */ - { 1, 17, 12, 0, 0, }, /* 202 */ - { 1, 26, 12, 0, 0, }, /* 203 */ - { 1, 23, 12, 0, 0, }, /* 204 */ - { 25, 12, 3, 0, 0, }, /* 205 */ - { 25, 17, 12, 0, 0, }, /* 206 */ - { 25, 21, 12, 0, 0, }, /* 207 */ - { 25, 7, 12, 0, 0, }, /* 208 */ - { 0, 1, 4, 0, 0, }, /* 209 */ - { 9, 1, 4, 0, 0, }, /* 210 */ - { 0, 25, 12, 0, 0, }, /* 211 */ - { 0, 21, 12, 0, 0, }, /* 212 */ - { 0, 23, 12, 0, 0, }, /* 213 */ - { 0, 26, 12, 0, 0, }, /* 214 */ - { 0, 12, 3, 0, 0, }, /* 215 */ - { 0, 1, 2, 0, 0, }, /* 216 */ - { 0, 7, 12, 0, 0, }, /* 217 */ - { 0, 13, 12, 0, 0, }, /* 218 */ - { 0, 6, 12, 0, 0, }, /* 219 */ - { 49, 21, 12, 0, 0, }, /* 220 */ - { 49, 1, 4, 0, 0, }, /* 221 */ - { 49, 7, 12, 0, 0, }, /* 222 */ - { 49, 12, 3, 0, 0, }, /* 223 */ - { 55, 7, 12, 0, 0, }, /* 224 */ - { 55, 12, 3, 0, 0, }, /* 225 */ - { 63, 13, 12, 0, 0, }, /* 226 */ - { 63, 7, 12, 0, 0, }, /* 227 */ - { 63, 12, 3, 0, 0, }, /* 228 */ - { 63, 6, 12, 0, 0, }, /* 229 */ - { 63, 26, 12, 0, 0, }, /* 230 */ - { 63, 21, 12, 0, 0, }, /* 231 */ - { 63, 23, 12, 0, 0, }, /* 232 */ - { 89, 7, 12, 0, 0, }, /* 233 */ - { 89, 12, 3, 0, 0, }, /* 234 */ - { 89, 6, 12, 0, 0, }, /* 235 */ - { 89, 21, 12, 0, 0, }, /* 236 */ - { 94, 7, 12, 0, 0, }, /* 237 */ - { 94, 12, 3, 0, 0, }, /* 238 */ - { 94, 21, 12, 0, 0, }, /* 239 */ - { 14, 12, 3, 0, 0, }, /* 240 */ - { 14, 10, 5, 0, 0, }, /* 241 */ - { 14, 7, 12, 0, 0, }, /* 242 */ - { 14, 13, 12, 0, 0, }, /* 243 */ - { 14, 21, 12, 0, 0, }, /* 244 */ - { 14, 6, 12, 0, 0, }, /* 245 */ - { 2, 7, 12, 0, 0, }, /* 246 */ - { 2, 12, 3, 0, 0, }, /* 247 */ - { 2, 10, 5, 0, 0, }, /* 248 */ - { 2, 10, 3, 0, 0, }, /* 249 */ - { 2, 13, 12, 0, 0, }, /* 250 */ - { 2, 23, 12, 0, 0, }, /* 251 */ - { 2, 15, 12, 0, 0, }, /* 252 */ - { 2, 26, 12, 0, 0, }, /* 253 */ - { 2, 21, 12, 0, 0, }, /* 254 */ - { 21, 12, 3, 0, 0, }, /* 255 */ - { 21, 10, 5, 0, 0, }, /* 256 */ - { 21, 7, 12, 0, 0, }, /* 257 */ - { 21, 13, 12, 0, 0, }, /* 258 */ - { 21, 21, 12, 0, 0, }, /* 259 */ - { 20, 12, 3, 0, 0, }, /* 260 */ - { 20, 10, 5, 0, 0, }, /* 261 */ - { 20, 7, 12, 0, 0, }, /* 262 */ - { 20, 13, 12, 0, 0, }, /* 263 */ - { 20, 21, 12, 0, 0, }, /* 264 */ - { 20, 23, 12, 0, 0, }, /* 265 */ - { 43, 12, 3, 0, 0, }, /* 266 */ - { 43, 10, 5, 0, 0, }, /* 267 */ - { 43, 7, 12, 0, 0, }, /* 268 */ - { 43, 10, 3, 0, 0, }, /* 269 */ - { 43, 13, 12, 0, 0, }, /* 270 */ - { 43, 26, 12, 0, 0, }, /* 271 */ - { 43, 15, 12, 0, 0, }, /* 272 */ - { 53, 12, 3, 0, 0, }, /* 273 */ - { 53, 7, 12, 0, 0, }, /* 274 */ - { 53, 10, 3, 0, 0, }, /* 275 */ - { 53, 10, 5, 0, 0, }, /* 276 */ - { 53, 13, 12, 0, 0, }, /* 277 */ - { 53, 15, 12, 0, 0, }, /* 278 */ - { 53, 26, 12, 0, 0, }, /* 279 */ - { 53, 23, 12, 0, 0, }, /* 280 */ - { 54, 12, 3, 0, 0, }, /* 281 */ - { 54, 10, 5, 0, 0, }, /* 282 */ - { 54, 7, 12, 0, 0, }, /* 283 */ - { 54, 13, 12, 0, 0, }, /* 284 */ - { 54, 15, 12, 0, 0, }, /* 285 */ - { 54, 26, 12, 0, 0, }, /* 286 */ - { 28, 7, 12, 0, 0, }, /* 287 */ - { 28, 12, 3, 0, 0, }, /* 288 */ - { 28, 10, 5, 0, 0, }, /* 289 */ - { 28, 21, 12, 0, 0, }, /* 290 */ - { 28, 10, 3, 0, 0, }, /* 291 */ - { 28, 13, 12, 0, 0, }, /* 292 */ - { 36, 12, 3, 0, 0, }, /* 293 */ - { 36, 10, 5, 0, 0, }, /* 294 */ - { 36, 7, 12, 0, 0, }, /* 295 */ - { 36, 10, 3, 0, 0, }, /* 296 */ - { 36, 7, 4, 0, 0, }, /* 297 */ - { 36, 26, 12, 0, 0, }, /* 298 */ - { 36, 15, 12, 0, 0, }, /* 299 */ - { 36, 13, 12, 0, 0, }, /* 300 */ - { 47, 10, 5, 0, 0, }, /* 301 */ - { 47, 7, 12, 0, 0, }, /* 302 */ - { 47, 12, 3, 0, 0, }, /* 303 */ - { 47, 10, 3, 0, 0, }, /* 304 */ - { 47, 13, 12, 0, 0, }, /* 305 */ - { 47, 21, 12, 0, 0, }, /* 306 */ - { 56, 7, 12, 0, 0, }, /* 307 */ - { 56, 12, 3, 0, 0, }, /* 308 */ - { 56, 7, 5, 0, 0, }, /* 309 */ - { 56, 6, 12, 0, 0, }, /* 310 */ - { 56, 21, 12, 0, 0, }, /* 311 */ - { 56, 13, 12, 0, 0, }, /* 312 */ - { 32, 7, 12, 0, 0, }, /* 313 */ - { 32, 12, 3, 0, 0, }, /* 314 */ - { 32, 7, 5, 0, 0, }, /* 315 */ - { 32, 6, 12, 0, 0, }, /* 316 */ - { 32, 13, 12, 0, 0, }, /* 317 */ - { 57, 7, 12, 0, 0, }, /* 318 */ - { 57, 26, 12, 0, 0, }, /* 319 */ - { 57, 21, 12, 0, 0, }, /* 320 */ - { 57, 12, 3, 0, 0, }, /* 321 */ - { 57, 13, 12, 0, 0, }, /* 322 */ - { 57, 15, 12, 0, 0, }, /* 323 */ - { 57, 22, 12, 0, 0, }, /* 324 */ - { 57, 18, 12, 0, 0, }, /* 325 */ - { 57, 10, 5, 0, 0, }, /* 326 */ - { 38, 7, 12, 0, 0, }, /* 327 */ - { 38, 10, 12, 0, 0, }, /* 328 */ - { 38, 12, 3, 0, 0, }, /* 329 */ - { 38, 10, 5, 0, 0, }, /* 330 */ - { 38, 13, 12, 0, 0, }, /* 331 */ - { 38, 21, 12, 0, 0, }, /* 332 */ - { 38, 26, 12, 0, 0, }, /* 333 */ - { 16, 9, 12, 0, 7264, }, /* 334 */ - { 16, 5, 12, 0, 3008, }, /* 335 */ - { 16, 6, 12, 0, 0, }, /* 336 */ - { 23, 7, 6, 0, 0, }, /* 337 */ - { 23, 7, 7, 0, 0, }, /* 338 */ - { 23, 7, 8, 0, 0, }, /* 339 */ - { 15, 7, 12, 0, 0, }, /* 340 */ - { 15, 12, 3, 0, 0, }, /* 341 */ - { 15, 21, 12, 0, 0, }, /* 342 */ - { 15, 15, 12, 0, 0, }, /* 343 */ - { 15, 26, 12, 0, 0, }, /* 344 */ - { 8, 9, 12, 0, 38864, }, /* 345 */ - { 8, 9, 12, 0, 8, }, /* 346 */ - { 8, 5, 12, 0, -8, }, /* 347 */ - { 7, 17, 12, 0, 0, }, /* 348 */ - { 7, 7, 12, 0, 0, }, /* 349 */ - { 7, 21, 12, 0, 0, }, /* 350 */ - { 40, 29, 12, 0, 0, }, /* 351 */ - { 40, 7, 12, 0, 0, }, /* 352 */ - { 40, 22, 12, 0, 0, }, /* 353 */ - { 40, 18, 12, 0, 0, }, /* 354 */ - { 45, 7, 12, 0, 0, }, /* 355 */ - { 45, 14, 12, 0, 0, }, /* 356 */ - { 50, 7, 12, 0, 0, }, /* 357 */ - { 50, 12, 3, 0, 0, }, /* 358 */ - { 24, 7, 12, 0, 0, }, /* 359 */ - { 24, 12, 3, 0, 0, }, /* 360 */ - { 6, 7, 12, 0, 0, }, /* 361 */ - { 6, 12, 3, 0, 0, }, /* 362 */ - { 51, 7, 12, 0, 0, }, /* 363 */ - { 51, 12, 3, 0, 0, }, /* 364 */ - { 31, 7, 12, 0, 0, }, /* 365 */ - { 31, 12, 3, 0, 0, }, /* 366 */ - { 31, 10, 5, 0, 0, }, /* 367 */ - { 31, 21, 12, 0, 0, }, /* 368 */ - { 31, 6, 12, 0, 0, }, /* 369 */ - { 31, 23, 12, 0, 0, }, /* 370 */ - { 31, 13, 12, 0, 0, }, /* 371 */ - { 31, 15, 12, 0, 0, }, /* 372 */ - { 37, 21, 12, 0, 0, }, /* 373 */ - { 37, 17, 12, 0, 0, }, /* 374 */ - { 37, 12, 3, 0, 0, }, /* 375 */ - { 37, 1, 2, 0, 0, }, /* 376 */ - { 37, 13, 12, 0, 0, }, /* 377 */ - { 37, 7, 12, 0, 0, }, /* 378 */ - { 37, 6, 12, 0, 0, }, /* 379 */ - { 34, 7, 12, 0, 0, }, /* 380 */ - { 34, 12, 3, 0, 0, }, /* 381 */ - { 34, 10, 5, 0, 0, }, /* 382 */ - { 34, 26, 12, 0, 0, }, /* 383 */ - { 34, 21, 12, 0, 0, }, /* 384 */ - { 34, 13, 12, 0, 0, }, /* 385 */ - { 52, 7, 12, 0, 0, }, /* 386 */ - { 39, 7, 12, 0, 0, }, /* 387 */ - { 39, 13, 12, 0, 0, }, /* 388 */ - { 39, 15, 12, 0, 0, }, /* 389 */ - { 39, 26, 12, 0, 0, }, /* 390 */ - { 31, 26, 12, 0, 0, }, /* 391 */ - { 5, 7, 12, 0, 0, }, /* 392 */ - { 5, 12, 3, 0, 0, }, /* 393 */ - { 5, 10, 5, 0, 0, }, /* 394 */ - { 5, 21, 12, 0, 0, }, /* 395 */ - { 90, 7, 12, 0, 0, }, /* 396 */ - { 90, 10, 5, 0, 0, }, /* 397 */ - { 90, 12, 3, 0, 0, }, /* 398 */ - { 90, 10, 12, 0, 0, }, /* 399 */ - { 90, 13, 12, 0, 0, }, /* 400 */ - { 90, 21, 12, 0, 0, }, /* 401 */ - { 90, 6, 12, 0, 0, }, /* 402 */ - { 27, 11, 3, 0, 0, }, /* 403 */ - { 61, 12, 3, 0, 0, }, /* 404 */ - { 61, 10, 5, 0, 0, }, /* 405 */ - { 61, 7, 12, 0, 0, }, /* 406 */ - { 61, 13, 12, 0, 0, }, /* 407 */ - { 61, 21, 12, 0, 0, }, /* 408 */ - { 61, 26, 12, 0, 0, }, /* 409 */ - { 75, 12, 3, 0, 0, }, /* 410 */ - { 75, 10, 5, 0, 0, }, /* 411 */ - { 75, 7, 12, 0, 0, }, /* 412 */ - { 75, 13, 12, 0, 0, }, /* 413 */ - { 92, 7, 12, 0, 0, }, /* 414 */ - { 92, 12, 3, 0, 0, }, /* 415 */ - { 92, 10, 5, 0, 0, }, /* 416 */ - { 92, 21, 12, 0, 0, }, /* 417 */ - { 69, 7, 12, 0, 0, }, /* 418 */ - { 69, 10, 5, 0, 0, }, /* 419 */ - { 69, 12, 3, 0, 0, }, /* 420 */ - { 69, 21, 12, 0, 0, }, /* 421 */ - { 69, 13, 12, 0, 0, }, /* 422 */ - { 72, 13, 12, 0, 0, }, /* 423 */ - { 72, 7, 12, 0, 0, }, /* 424 */ - { 72, 6, 12, 0, 0, }, /* 425 */ - { 72, 21, 12, 0, 0, }, /* 426 */ - { 12, 5, 12, 63, -6222, }, /* 427 */ - { 12, 5, 12, 67, -6221, }, /* 428 */ - { 12, 5, 12, 71, -6212, }, /* 429 */ - { 12, 5, 12, 75, -6210, }, /* 430 */ - { 12, 5, 12, 79, -6210, }, /* 431 */ - { 12, 5, 12, 79, -6211, }, /* 432 */ - { 12, 5, 12, 84, -6204, }, /* 433 */ - { 12, 5, 12, 88, -6180, }, /* 434 */ - { 12, 5, 12, 108, 35267, }, /* 435 */ - { 16, 9, 12, 0, -3008, }, /* 436 */ - { 75, 21, 12, 0, 0, }, /* 437 */ - { 9, 10, 5, 0, 0, }, /* 438 */ - { 9, 7, 12, 0, 0, }, /* 439 */ - { 12, 5, 12, 0, 0, }, /* 440 */ - { 12, 6, 12, 0, 0, }, /* 441 */ - { 33, 5, 12, 0, 35332, }, /* 442 */ - { 33, 5, 12, 0, 3814, }, /* 443 */ - { 33, 9, 12, 92, 1, }, /* 444 */ - { 33, 5, 12, 92, -1, }, /* 445 */ - { 33, 5, 12, 92, -58, }, /* 446 */ - { 33, 9, 12, 0, -7615, }, /* 447 */ - { 19, 5, 12, 0, 8, }, /* 448 */ - { 19, 9, 12, 0, -8, }, /* 449 */ - { 19, 5, 12, 0, 74, }, /* 450 */ - { 19, 5, 12, 0, 86, }, /* 451 */ - { 19, 5, 12, 0, 100, }, /* 452 */ - { 19, 5, 12, 0, 128, }, /* 453 */ - { 19, 5, 12, 0, 112, }, /* 454 */ - { 19, 5, 12, 0, 126, }, /* 455 */ - { 19, 8, 12, 0, -8, }, /* 456 */ - { 19, 5, 12, 0, 9, }, /* 457 */ - { 19, 9, 12, 0, -74, }, /* 458 */ - { 19, 8, 12, 0, -9, }, /* 459 */ - { 19, 5, 12, 21, -7173, }, /* 460 */ - { 19, 9, 12, 0, -86, }, /* 461 */ - { 19, 9, 12, 0, -100, }, /* 462 */ - { 19, 9, 12, 0, -112, }, /* 463 */ - { 19, 9, 12, 0, -128, }, /* 464 */ - { 19, 9, 12, 0, -126, }, /* 465 */ - { 27, 1, 3, 0, 0, }, /* 466 */ - { 27, 1, 13, 0, 0, }, /* 467 */ - { 9, 27, 2, 0, 0, }, /* 468 */ - { 9, 28, 2, 0, 0, }, /* 469 */ - { 9, 21, 14, 0, 0, }, /* 470 */ - { 9, 2, 2, 0, 0, }, /* 471 */ - { 9, 9, 12, 0, 0, }, /* 472 */ - { 9, 5, 12, 0, 0, }, /* 473 */ - { 19, 9, 12, 96, -7517, }, /* 474 */ - { 33, 9, 12, 100, -8383, }, /* 475 */ - { 33, 9, 12, 104, -8262, }, /* 476 */ - { 33, 9, 12, 0, 28, }, /* 477 */ - { 9, 5, 14, 0, 0, }, /* 478 */ - { 33, 5, 12, 0, -28, }, /* 479 */ - { 33, 14, 12, 0, 16, }, /* 480 */ - { 33, 14, 12, 0, -16, }, /* 481 */ - { 33, 14, 12, 0, 0, }, /* 482 */ - { 9, 25, 14, 0, 0, }, /* 483 */ - { 9, 26, 12, 0, 26, }, /* 484 */ - { 9, 26, 14, 0, 26, }, /* 485 */ - { 9, 26, 12, 0, -26, }, /* 486 */ - { 4, 26, 12, 0, 0, }, /* 487 */ - { 17, 9, 12, 0, 48, }, /* 488 */ - { 17, 5, 12, 0, -48, }, /* 489 */ - { 33, 9, 12, 0, -10743, }, /* 490 */ - { 33, 9, 12, 0, -3814, }, /* 491 */ - { 33, 9, 12, 0, -10727, }, /* 492 */ - { 33, 5, 12, 0, -10795, }, /* 493 */ - { 33, 5, 12, 0, -10792, }, /* 494 */ - { 33, 9, 12, 0, -10780, }, /* 495 */ - { 33, 9, 12, 0, -10749, }, /* 496 */ - { 33, 9, 12, 0, -10783, }, /* 497 */ - { 33, 9, 12, 0, -10782, }, /* 498 */ - { 33, 9, 12, 0, -10815, }, /* 499 */ - { 10, 5, 12, 0, 0, }, /* 500 */ - { 10, 26, 12, 0, 0, }, /* 501 */ - { 10, 12, 3, 0, 0, }, /* 502 */ - { 10, 21, 12, 0, 0, }, /* 503 */ - { 10, 15, 12, 0, 0, }, /* 504 */ - { 16, 5, 12, 0, -7264, }, /* 505 */ - { 58, 7, 12, 0, 0, }, /* 506 */ - { 58, 6, 12, 0, 0, }, /* 507 */ - { 58, 21, 12, 0, 0, }, /* 508 */ - { 58, 12, 3, 0, 0, }, /* 509 */ - { 22, 26, 12, 0, 0, }, /* 510 */ - { 22, 6, 12, 0, 0, }, /* 511 */ - { 22, 14, 12, 0, 0, }, /* 512 */ - { 23, 10, 3, 0, 0, }, /* 513 */ - { 9, 17, 14, 0, 0, }, /* 514 */ - { 26, 7, 12, 0, 0, }, /* 515 */ - { 26, 6, 12, 0, 0, }, /* 516 */ - { 29, 7, 12, 0, 0, }, /* 517 */ - { 29, 6, 12, 0, 0, }, /* 518 */ - { 3, 7, 12, 0, 0, }, /* 519 */ - { 23, 7, 12, 0, 0, }, /* 520 */ - { 23, 26, 12, 0, 0, }, /* 521 */ - { 29, 26, 12, 0, 0, }, /* 522 */ - { 22, 7, 12, 0, 0, }, /* 523 */ - { 60, 7, 12, 0, 0, }, /* 524 */ - { 60, 6, 12, 0, 0, }, /* 525 */ - { 60, 26, 12, 0, 0, }, /* 526 */ - { 85, 7, 12, 0, 0, }, /* 527 */ - { 85, 6, 12, 0, 0, }, /* 528 */ - { 85, 21, 12, 0, 0, }, /* 529 */ - { 76, 7, 12, 0, 0, }, /* 530 */ - { 76, 6, 12, 0, 0, }, /* 531 */ - { 76, 21, 12, 0, 0, }, /* 532 */ - { 76, 13, 12, 0, 0, }, /* 533 */ - { 12, 9, 12, 108, 1, }, /* 534 */ - { 12, 5, 12, 108, -35267, }, /* 535 */ - { 12, 7, 12, 0, 0, }, /* 536 */ - { 12, 21, 12, 0, 0, }, /* 537 */ - { 78, 7, 12, 0, 0, }, /* 538 */ - { 78, 14, 12, 0, 0, }, /* 539 */ - { 78, 12, 3, 0, 0, }, /* 540 */ - { 78, 21, 12, 0, 0, }, /* 541 */ - { 33, 9, 12, 0, -35332, }, /* 542 */ - { 33, 9, 12, 0, -42280, }, /* 543 */ - { 33, 9, 12, 0, -42308, }, /* 544 */ - { 33, 9, 12, 0, -42319, }, /* 545 */ - { 33, 9, 12, 0, -42315, }, /* 546 */ - { 33, 9, 12, 0, -42305, }, /* 547 */ - { 33, 9, 12, 0, -42258, }, /* 548 */ - { 33, 9, 12, 0, -42282, }, /* 549 */ - { 33, 9, 12, 0, -42261, }, /* 550 */ - { 33, 9, 12, 0, 928, }, /* 551 */ - { 48, 7, 12, 0, 0, }, /* 552 */ - { 48, 12, 3, 0, 0, }, /* 553 */ - { 48, 10, 5, 0, 0, }, /* 554 */ - { 48, 26, 12, 0, 0, }, /* 555 */ - { 64, 7, 12, 0, 0, }, /* 556 */ - { 64, 21, 12, 0, 0, }, /* 557 */ - { 74, 10, 5, 0, 0, }, /* 558 */ - { 74, 7, 12, 0, 0, }, /* 559 */ - { 74, 12, 3, 0, 0, }, /* 560 */ - { 74, 21, 12, 0, 0, }, /* 561 */ - { 74, 13, 12, 0, 0, }, /* 562 */ - { 68, 13, 12, 0, 0, }, /* 563 */ - { 68, 7, 12, 0, 0, }, /* 564 */ - { 68, 12, 3, 0, 0, }, /* 565 */ - { 68, 21, 12, 0, 0, }, /* 566 */ - { 73, 7, 12, 0, 0, }, /* 567 */ - { 73, 12, 3, 0, 0, }, /* 568 */ - { 73, 10, 5, 0, 0, }, /* 569 */ - { 73, 21, 12, 0, 0, }, /* 570 */ - { 83, 12, 3, 0, 0, }, /* 571 */ - { 83, 10, 5, 0, 0, }, /* 572 */ - { 83, 7, 12, 0, 0, }, /* 573 */ - { 83, 21, 12, 0, 0, }, /* 574 */ - { 83, 13, 12, 0, 0, }, /* 575 */ - { 38, 6, 12, 0, 0, }, /* 576 */ - { 67, 7, 12, 0, 0, }, /* 577 */ - { 67, 12, 3, 0, 0, }, /* 578 */ - { 67, 10, 5, 0, 0, }, /* 579 */ - { 67, 13, 12, 0, 0, }, /* 580 */ - { 67, 21, 12, 0, 0, }, /* 581 */ - { 91, 7, 12, 0, 0, }, /* 582 */ - { 91, 12, 3, 0, 0, }, /* 583 */ - { 91, 6, 12, 0, 0, }, /* 584 */ - { 91, 21, 12, 0, 0, }, /* 585 */ - { 86, 7, 12, 0, 0, }, /* 586 */ - { 86, 10, 5, 0, 0, }, /* 587 */ - { 86, 12, 3, 0, 0, }, /* 588 */ - { 86, 21, 12, 0, 0, }, /* 589 */ - { 86, 6, 12, 0, 0, }, /* 590 */ - { 33, 5, 12, 0, -928, }, /* 591 */ - { 8, 5, 12, 0, -38864, }, /* 592 */ - { 86, 13, 12, 0, 0, }, /* 593 */ - { 23, 7, 9, 0, 0, }, /* 594 */ - { 23, 7, 10, 0, 0, }, /* 595 */ - { 9, 4, 2, 0, 0, }, /* 596 */ - { 9, 3, 12, 0, 0, }, /* 597 */ - { 25, 25, 12, 0, 0, }, /* 598 */ - { 0, 24, 12, 0, 0, }, /* 599 */ - { 9, 6, 3, 0, 0, }, /* 600 */ - { 35, 7, 12, 0, 0, }, /* 601 */ - { 19, 14, 12, 0, 0, }, /* 602 */ - { 19, 15, 12, 0, 0, }, /* 603 */ - { 19, 26, 12, 0, 0, }, /* 604 */ - { 70, 7, 12, 0, 0, }, /* 605 */ - { 66, 7, 12, 0, 0, }, /* 606 */ - { 41, 7, 12, 0, 0, }, /* 607 */ - { 41, 15, 12, 0, 0, }, /* 608 */ - { 18, 7, 12, 0, 0, }, /* 609 */ - { 18, 14, 12, 0, 0, }, /* 610 */ - { 117, 7, 12, 0, 0, }, /* 611 */ - { 117, 12, 3, 0, 0, }, /* 612 */ - { 59, 7, 12, 0, 0, }, /* 613 */ - { 59, 21, 12, 0, 0, }, /* 614 */ - { 42, 7, 12, 0, 0, }, /* 615 */ - { 42, 21, 12, 0, 0, }, /* 616 */ - { 42, 14, 12, 0, 0, }, /* 617 */ - { 13, 9, 12, 0, 40, }, /* 618 */ - { 13, 5, 12, 0, -40, }, /* 619 */ - { 46, 7, 12, 0, 0, }, /* 620 */ - { 44, 7, 12, 0, 0, }, /* 621 */ - { 44, 13, 12, 0, 0, }, /* 622 */ - { 135, 9, 12, 0, 40, }, /* 623 */ - { 135, 5, 12, 0, -40, }, /* 624 */ - { 105, 7, 12, 0, 0, }, /* 625 */ - { 103, 7, 12, 0, 0, }, /* 626 */ - { 103, 21, 12, 0, 0, }, /* 627 */ - { 109, 7, 12, 0, 0, }, /* 628 */ - { 11, 7, 12, 0, 0, }, /* 629 */ - { 80, 7, 12, 0, 0, }, /* 630 */ - { 80, 21, 12, 0, 0, }, /* 631 */ - { 80, 15, 12, 0, 0, }, /* 632 */ - { 119, 7, 12, 0, 0, }, /* 633 */ - { 119, 26, 12, 0, 0, }, /* 634 */ - { 119, 15, 12, 0, 0, }, /* 635 */ - { 115, 7, 12, 0, 0, }, /* 636 */ - { 115, 15, 12, 0, 0, }, /* 637 */ - { 127, 7, 12, 0, 0, }, /* 638 */ - { 127, 15, 12, 0, 0, }, /* 639 */ - { 65, 7, 12, 0, 0, }, /* 640 */ - { 65, 15, 12, 0, 0, }, /* 641 */ - { 65, 21, 12, 0, 0, }, /* 642 */ - { 71, 7, 12, 0, 0, }, /* 643 */ - { 71, 21, 12, 0, 0, }, /* 644 */ - { 97, 7, 12, 0, 0, }, /* 645 */ - { 96, 7, 12, 0, 0, }, /* 646 */ - { 96, 15, 12, 0, 0, }, /* 647 */ - { 30, 7, 12, 0, 0, }, /* 648 */ - { 30, 12, 3, 0, 0, }, /* 649 */ - { 30, 15, 12, 0, 0, }, /* 650 */ - { 30, 21, 12, 0, 0, }, /* 651 */ - { 87, 7, 12, 0, 0, }, /* 652 */ - { 87, 15, 12, 0, 0, }, /* 653 */ - { 87, 21, 12, 0, 0, }, /* 654 */ - { 116, 7, 12, 0, 0, }, /* 655 */ - { 116, 15, 12, 0, 0, }, /* 656 */ - { 111, 7, 12, 0, 0, }, /* 657 */ - { 111, 26, 12, 0, 0, }, /* 658 */ - { 111, 12, 3, 0, 0, }, /* 659 */ - { 111, 15, 12, 0, 0, }, /* 660 */ - { 111, 21, 12, 0, 0, }, /* 661 */ - { 77, 7, 12, 0, 0, }, /* 662 */ - { 77, 21, 12, 0, 0, }, /* 663 */ - { 82, 7, 12, 0, 0, }, /* 664 */ - { 82, 15, 12, 0, 0, }, /* 665 */ - { 81, 7, 12, 0, 0, }, /* 666 */ - { 81, 15, 12, 0, 0, }, /* 667 */ - { 120, 7, 12, 0, 0, }, /* 668 */ - { 120, 21, 12, 0, 0, }, /* 669 */ - { 120, 15, 12, 0, 0, }, /* 670 */ - { 88, 7, 12, 0, 0, }, /* 671 */ - { 129, 9, 12, 0, 64, }, /* 672 */ - { 129, 5, 12, 0, -64, }, /* 673 */ - { 129, 15, 12, 0, 0, }, /* 674 */ - { 143, 7, 12, 0, 0, }, /* 675 */ - { 143, 12, 3, 0, 0, }, /* 676 */ - { 143, 13, 12, 0, 0, }, /* 677 */ - { 0, 15, 12, 0, 0, }, /* 678 */ - { 146, 7, 12, 0, 0, }, /* 679 */ - { 146, 15, 12, 0, 0, }, /* 680 */ - { 147, 7, 12, 0, 0, }, /* 681 */ - { 147, 12, 3, 0, 0, }, /* 682 */ - { 147, 15, 12, 0, 0, }, /* 683 */ - { 147, 21, 12, 0, 0, }, /* 684 */ - { 93, 10, 5, 0, 0, }, /* 685 */ - { 93, 12, 3, 0, 0, }, /* 686 */ - { 93, 7, 12, 0, 0, }, /* 687 */ - { 93, 21, 12, 0, 0, }, /* 688 */ - { 93, 15, 12, 0, 0, }, /* 689 */ - { 93, 13, 12, 0, 0, }, /* 690 */ - { 84, 12, 3, 0, 0, }, /* 691 */ - { 84, 10, 5, 0, 0, }, /* 692 */ - { 84, 7, 12, 0, 0, }, /* 693 */ - { 84, 21, 12, 0, 0, }, /* 694 */ - { 84, 1, 4, 0, 0, }, /* 695 */ - { 100, 7, 12, 0, 0, }, /* 696 */ - { 100, 13, 12, 0, 0, }, /* 697 */ - { 95, 12, 3, 0, 0, }, /* 698 */ - { 95, 7, 12, 0, 0, }, /* 699 */ - { 95, 10, 5, 0, 0, }, /* 700 */ - { 95, 13, 12, 0, 0, }, /* 701 */ - { 95, 21, 12, 0, 0, }, /* 702 */ - { 110, 7, 12, 0, 0, }, /* 703 */ - { 110, 12, 3, 0, 0, }, /* 704 */ - { 110, 21, 12, 0, 0, }, /* 705 */ - { 99, 12, 3, 0, 0, }, /* 706 */ - { 99, 10, 5, 0, 0, }, /* 707 */ - { 99, 7, 12, 0, 0, }, /* 708 */ - { 99, 7, 4, 0, 0, }, /* 709 */ - { 99, 21, 12, 0, 0, }, /* 710 */ - { 99, 13, 12, 0, 0, }, /* 711 */ - { 47, 15, 12, 0, 0, }, /* 712 */ - { 107, 7, 12, 0, 0, }, /* 713 */ - { 107, 10, 5, 0, 0, }, /* 714 */ - { 107, 12, 3, 0, 0, }, /* 715 */ - { 107, 21, 12, 0, 0, }, /* 716 */ - { 128, 7, 12, 0, 0, }, /* 717 */ - { 128, 21, 12, 0, 0, }, /* 718 */ - { 108, 7, 12, 0, 0, }, /* 719 */ - { 108, 12, 3, 0, 0, }, /* 720 */ - { 108, 10, 5, 0, 0, }, /* 721 */ - { 108, 13, 12, 0, 0, }, /* 722 */ - { 106, 12, 3, 0, 0, }, /* 723 */ - { 106, 10, 5, 0, 0, }, /* 724 */ - { 106, 7, 12, 0, 0, }, /* 725 */ - { 106, 10, 3, 0, 0, }, /* 726 */ - { 134, 7, 12, 0, 0, }, /* 727 */ - { 134, 10, 5, 0, 0, }, /* 728 */ - { 134, 12, 3, 0, 0, }, /* 729 */ - { 134, 21, 12, 0, 0, }, /* 730 */ - { 134, 13, 12, 0, 0, }, /* 731 */ - { 123, 7, 12, 0, 0, }, /* 732 */ - { 123, 10, 3, 0, 0, }, /* 733 */ - { 123, 10, 5, 0, 0, }, /* 734 */ - { 123, 12, 3, 0, 0, }, /* 735 */ - { 123, 21, 12, 0, 0, }, /* 736 */ - { 123, 13, 12, 0, 0, }, /* 737 */ - { 122, 7, 12, 0, 0, }, /* 738 */ - { 122, 10, 3, 0, 0, }, /* 739 */ - { 122, 10, 5, 0, 0, }, /* 740 */ - { 122, 12, 3, 0, 0, }, /* 741 */ - { 122, 21, 12, 0, 0, }, /* 742 */ - { 113, 7, 12, 0, 0, }, /* 743 */ - { 113, 10, 5, 0, 0, }, /* 744 */ - { 113, 12, 3, 0, 0, }, /* 745 */ - { 113, 21, 12, 0, 0, }, /* 746 */ - { 113, 13, 12, 0, 0, }, /* 747 */ - { 101, 7, 12, 0, 0, }, /* 748 */ - { 101, 12, 3, 0, 0, }, /* 749 */ - { 101, 10, 5, 0, 0, }, /* 750 */ - { 101, 13, 12, 0, 0, }, /* 751 */ - { 125, 7, 12, 0, 0, }, /* 752 */ - { 125, 12, 3, 0, 0, }, /* 753 */ - { 125, 10, 5, 0, 0, }, /* 754 */ - { 125, 13, 12, 0, 0, }, /* 755 */ - { 125, 15, 12, 0, 0, }, /* 756 */ - { 125, 21, 12, 0, 0, }, /* 757 */ - { 125, 26, 12, 0, 0, }, /* 758 */ - { 141, 7, 12, 0, 0, }, /* 759 */ - { 141, 10, 5, 0, 0, }, /* 760 */ - { 141, 12, 3, 0, 0, }, /* 761 */ - { 141, 21, 12, 0, 0, }, /* 762 */ - { 124, 9, 12, 0, 32, }, /* 763 */ - { 124, 5, 12, 0, -32, }, /* 764 */ - { 124, 13, 12, 0, 0, }, /* 765 */ - { 124, 15, 12, 0, 0, }, /* 766 */ - { 124, 7, 12, 0, 0, }, /* 767 */ - { 140, 7, 12, 0, 0, }, /* 768 */ - { 140, 12, 3, 0, 0, }, /* 769 */ - { 140, 10, 5, 0, 0, }, /* 770 */ - { 140, 7, 4, 0, 0, }, /* 771 */ - { 140, 21, 12, 0, 0, }, /* 772 */ - { 139, 7, 12, 0, 0, }, /* 773 */ - { 139, 12, 3, 0, 0, }, /* 774 */ - { 139, 10, 5, 0, 0, }, /* 775 */ - { 139, 7, 4, 0, 0, }, /* 776 */ - { 139, 21, 12, 0, 0, }, /* 777 */ - { 121, 7, 12, 0, 0, }, /* 778 */ - { 132, 7, 12, 0, 0, }, /* 779 */ - { 132, 10, 5, 0, 0, }, /* 780 */ - { 132, 12, 3, 0, 0, }, /* 781 */ - { 132, 21, 12, 0, 0, }, /* 782 */ - { 132, 13, 12, 0, 0, }, /* 783 */ - { 132, 15, 12, 0, 0, }, /* 784 */ - { 133, 21, 12, 0, 0, }, /* 785 */ - { 133, 7, 12, 0, 0, }, /* 786 */ - { 133, 12, 3, 0, 0, }, /* 787 */ - { 133, 10, 5, 0, 0, }, /* 788 */ - { 137, 7, 12, 0, 0, }, /* 789 */ - { 137, 12, 3, 0, 0, }, /* 790 */ - { 137, 7, 4, 0, 0, }, /* 791 */ - { 137, 13, 12, 0, 0, }, /* 792 */ - { 142, 7, 12, 0, 0, }, /* 793 */ - { 142, 10, 5, 0, 0, }, /* 794 */ - { 142, 12, 3, 0, 0, }, /* 795 */ - { 142, 13, 12, 0, 0, }, /* 796 */ - { 144, 7, 12, 0, 0, }, /* 797 */ - { 144, 12, 3, 0, 0, }, /* 798 */ - { 144, 10, 5, 0, 0, }, /* 799 */ - { 144, 21, 12, 0, 0, }, /* 800 */ - { 62, 7, 12, 0, 0, }, /* 801 */ - { 62, 14, 12, 0, 0, }, /* 802 */ - { 62, 21, 12, 0, 0, }, /* 803 */ - { 79, 7, 12, 0, 0, }, /* 804 */ - { 126, 7, 12, 0, 0, }, /* 805 */ - { 114, 7, 12, 0, 0, }, /* 806 */ - { 114, 13, 12, 0, 0, }, /* 807 */ - { 114, 21, 12, 0, 0, }, /* 808 */ - { 102, 7, 12, 0, 0, }, /* 809 */ - { 102, 12, 3, 0, 0, }, /* 810 */ - { 102, 21, 12, 0, 0, }, /* 811 */ - { 118, 7, 12, 0, 0, }, /* 812 */ - { 118, 12, 3, 0, 0, }, /* 813 */ - { 118, 21, 12, 0, 0, }, /* 814 */ - { 118, 26, 12, 0, 0, }, /* 815 */ - { 118, 6, 12, 0, 0, }, /* 816 */ - { 118, 13, 12, 0, 0, }, /* 817 */ - { 118, 15, 12, 0, 0, }, /* 818 */ - { 145, 9, 12, 0, 32, }, /* 819 */ - { 145, 5, 12, 0, -32, }, /* 820 */ - { 145, 15, 12, 0, 0, }, /* 821 */ - { 145, 21, 12, 0, 0, }, /* 822 */ - { 98, 7, 12, 0, 0, }, /* 823 */ - { 98, 10, 5, 0, 0, }, /* 824 */ - { 98, 12, 3, 0, 0, }, /* 825 */ - { 98, 6, 12, 0, 0, }, /* 826 */ - { 136, 6, 12, 0, 0, }, /* 827 */ - { 138, 6, 12, 0, 0, }, /* 828 */ - { 136, 7, 12, 0, 0, }, /* 829 */ - { 138, 7, 12, 0, 0, }, /* 830 */ - { 104, 7, 12, 0, 0, }, /* 831 */ - { 104, 26, 12, 0, 0, }, /* 832 */ - { 104, 12, 3, 0, 0, }, /* 833 */ - { 104, 21, 12, 0, 0, }, /* 834 */ - { 9, 10, 3, 0, 0, }, /* 835 */ - { 19, 12, 3, 0, 0, }, /* 836 */ - { 130, 26, 12, 0, 0, }, /* 837 */ - { 130, 12, 3, 0, 0, }, /* 838 */ - { 130, 21, 12, 0, 0, }, /* 839 */ - { 17, 12, 3, 0, 0, }, /* 840 */ - { 112, 7, 12, 0, 0, }, /* 841 */ - { 112, 15, 12, 0, 0, }, /* 842 */ - { 112, 12, 3, 0, 0, }, /* 843 */ - { 131, 9, 12, 0, 34, }, /* 844 */ - { 131, 5, 12, 0, -34, }, /* 845 */ - { 131, 12, 3, 0, 0, }, /* 846 */ - { 131, 13, 12, 0, 0, }, /* 847 */ - { 131, 21, 12, 0, 0, }, /* 848 */ - { 9, 2, 14, 0, 0, }, /* 849 */ - { 9, 26, 11, 0, 0, }, /* 850 */ - { 26, 26, 12, 0, 0, }, /* 851 */ - { 9, 24, 3, 0, 0, }, /* 852 */ - { 9, 1, 3, 0, 0, }, /* 853 */ +/* This table lists the code points for the '9' characters in each +set of decimal digits. It is used to ensure that all the digits in +a script run come from the same set. */ + +const uint32_t PRIV(ucd_digit_sets)[] = { + 61, /* Number of subsequent values */ + 0x00039, 0x00669, 0x006f9, 0x007c9, 0x0096f, 0x009ef, 0x00a6f, 0x00aef, + 0x00b6f, 0x00bef, 0x00c6f, 0x00cef, 0x00d6f, 0x00def, 0x00e59, 0x00ed9, + 0x00f29, 0x01049, 0x01099, 0x017e9, 0x01819, 0x0194f, 0x019d9, 0x01a89, + 0x01a99, 0x01b59, 0x01bb9, 0x01c49, 0x01c59, 0x0a629, 0x0a8d9, 0x0a909, + 0x0a9d9, 0x0a9f9, 0x0aa59, 0x0abf9, 0x0ff19, 0x104a9, 0x10d39, 0x1106f, + 0x110f9, 0x1113f, 0x111d9, 0x112f9, 0x11459, 0x114d9, 0x11659, 0x116c9, + 0x11739, 0x118e9, 0x11c59, 0x11d59, 0x11da9, 0x16a69, 0x16b59, 0x1d7d7, + 0x1d7e1, 0x1d7eb, 0x1d7f5, 0x1d7ff, 0x1e959, +}; + +/* This vector is a list of lists of scripts for the Script Extension +property. Each sublist is zero-terminated. */ + +const uint8_t PRIV(ucd_script_sets)[] = { + /* 0 */ 0, + /* 1 */ 1, 11, 0, + /* 4 */ 1, 144, 0, + /* 7 */ 1, 50, 0, + /* 10 */ 1, 56, 0, + /* 13 */ 2, 17, 0, + /* 16 */ 3, 15, 0, + /* 19 */ 4, 23, 0, + /* 22 */ 6, 84, 0, + /* 25 */ 12, 36, 0, + /* 28 */ 13, 18, 0, + /* 31 */ 13, 34, 0, + /* 34 */ 13, 118, 0, + /* 37 */ 15, 107, 0, + /* 40 */ 15, 100, 0, + /* 43 */ 15, 54, 0, + /* 46 */ 17, 34, 0, + /* 49 */ 107, 54, 0, + /* 52 */ 21, 108, 0, + /* 55 */ 22, 129, 0, + /* 58 */ 27, 30, 0, + /* 61 */ 38, 65, 0, + /* 64 */ 1, 50, 56, 0, + /* 68 */ 3, 96, 49, 0, + /* 72 */ 96, 39, 53, 0, + /* 76 */ 12, 110, 36, 0, + /* 80 */ 15, 107, 29, 0, + /* 84 */ 15, 107, 34, 0, + /* 88 */ 23, 27, 30, 0, + /* 92 */ 69, 34, 39, 0, + /* 96 */ 1, 144, 50, 56, 0, + /* 101 */ 3, 15, 107, 29, 0, + /* 106 */ 7, 25, 52, 51, 0, + /* 111 */ 15, 142, 85, 111, 0, + /* 116 */ 4, 24, 23, 27, 30, 0, + /* 122 */ 4, 24, 23, 27, 30, 61, 0, + /* 129 */ 15, 29, 37, 44, 54, 55, 0, + /* 136 */ 132, 1, 95, 112, 121, 144, 148, 50, 0, + /* 145 */ 15, 142, 21, 22, 108, 85, 111, 114, 109, 102, 124, 0, + /* 157 */ 3, 15, 107, 21, 22, 29, 34, 37, 44, 54, 55, 124, 0, + /* 170 */ 15, 142, 21, 22, 108, 29, 85, 111, 114, 109, 102, 124, 0, + /* 183 */ 3, 15, 107, 21, 22, 29, 34, 37, 44, 100, 54, 55, 124, 0, + /* 197 */ 15, 142, 21, 22, 108, 29, 85, 111, 37, 114, 109, 102, 124, 0, + /* 211 */ 3, 15, 142, 143, 107, 21, 22, 29, 111, 37, 44, 109, 48, 49, 102, 54, 55, 124, 0, + /* 230 */ 3, 15, 142, 143, 107, 21, 22, 29, 35, 111, 37, 44, 109, 48, 49, 102, 54, 55, 124, 0, + /* 250 */ +}; + +/* These are the main two-stage UCD tables. The fields in each record are: +script (8 bits), character type (8 bits), grapheme break property (8 bits), +offset to multichar other cases or zero (8 bits), offset to other case +or zero (32 bits, signed), script extension (16 bits, signed), and a dummy +16-bit field to make the whole thing a multiple of 4 bytes. */ + +const ucd_record PRIV(ucd_records)[] = { /* 11136 bytes, record size 12 */ + { 10, 0, 2, 0, 0, 10, 256, }, /* 0 */ + { 10, 0, 2, 0, 0, 10, 0, }, /* 1 */ + { 10, 0, 1, 0, 0, 10, 0, }, /* 2 */ + { 10, 0, 0, 0, 0, 10, 0, }, /* 3 */ + { 10, 29, 12, 0, 0, 10, 0, }, /* 4 */ + { 10, 21, 12, 0, 0, 10, 0, }, /* 5 */ + { 10, 23, 12, 0, 0, 10, 0, }, /* 6 */ + { 10, 22, 12, 0, 0, 10, 0, }, /* 7 */ + { 10, 18, 12, 0, 0, 10, 0, }, /* 8 */ + { 10, 25, 12, 0, 0, 10, 0, }, /* 9 */ + { 10, 17, 12, 0, 0, 10, 0, }, /* 10 */ + { 10, 13, 12, 0, 0, 10, 0, }, /* 11 */ + { 34, 9, 12, 0, 32, 34, 0, }, /* 12 */ + { 34, 9, 12, 100, 32, 34, 0, }, /* 13 */ + { 34, 9, 12, 1, 32, 34, 0, }, /* 14 */ + { 10, 24, 12, 0, 0, 10, 0, }, /* 15 */ + { 10, 16, 12, 0, 0, 10, 0, }, /* 16 */ + { 34, 5, 12, 0, -32, 34, 0, }, /* 17 */ + { 34, 5, 12, 100, -32, 34, 0, }, /* 18 */ + { 34, 5, 12, 1, -32, 34, 0, }, /* 19 */ + { 10, 26, 12, 0, 0, 10, 0, }, /* 20 */ + { 10, 26, 14, 0, 0, 10, 0, }, /* 21 */ + { 34, 7, 12, 0, 0, 34, 0, }, /* 22 */ + { 10, 20, 12, 0, 0, 10, 0, }, /* 23 */ + { 10, 1, 2, 0, 0, 10, 0, }, /* 24 */ + { 10, 15, 12, 0, 0, 10, 0, }, /* 25 */ + { 10, 5, 12, 26, 775, 10, 0, }, /* 26 */ + { 10, 19, 12, 0, 0, 10, 0, }, /* 27 */ + { 34, 9, 12, 104, 32, 34, 0, }, /* 28 */ + { 34, 5, 12, 0, 7615, 34, 0, }, /* 29 */ + { 34, 5, 12, 104, -32, 34, 0, }, /* 30 */ + { 34, 5, 12, 0, 121, 34, 0, }, /* 31 */ + { 34, 9, 12, 0, 1, 34, 0, }, /* 32 */ + { 34, 5, 12, 0, -1, 34, 0, }, /* 33 */ + { 34, 9, 12, 0, 0, 34, 0, }, /* 34 */ + { 34, 5, 12, 0, 0, 34, 0, }, /* 35 */ + { 34, 9, 12, 0, -121, 34, 0, }, /* 36 */ + { 34, 5, 12, 1, -268, 34, 0, }, /* 37 */ + { 34, 5, 12, 0, 195, 34, 0, }, /* 38 */ + { 34, 9, 12, 0, 210, 34, 0, }, /* 39 */ + { 34, 9, 12, 0, 206, 34, 0, }, /* 40 */ + { 34, 9, 12, 0, 205, 34, 0, }, /* 41 */ + { 34, 9, 12, 0, 79, 34, 0, }, /* 42 */ + { 34, 9, 12, 0, 202, 34, 0, }, /* 43 */ + { 34, 9, 12, 0, 203, 34, 0, }, /* 44 */ + { 34, 9, 12, 0, 207, 34, 0, }, /* 45 */ + { 34, 5, 12, 0, 97, 34, 0, }, /* 46 */ + { 34, 9, 12, 0, 211, 34, 0, }, /* 47 */ + { 34, 9, 12, 0, 209, 34, 0, }, /* 48 */ + { 34, 5, 12, 0, 163, 34, 0, }, /* 49 */ + { 34, 9, 12, 0, 213, 34, 0, }, /* 50 */ + { 34, 5, 12, 0, 130, 34, 0, }, /* 51 */ + { 34, 9, 12, 0, 214, 34, 0, }, /* 52 */ + { 34, 9, 12, 0, 218, 34, 0, }, /* 53 */ + { 34, 9, 12, 0, 217, 34, 0, }, /* 54 */ + { 34, 9, 12, 0, 219, 34, 0, }, /* 55 */ + { 34, 5, 12, 0, 56, 34, 0, }, /* 56 */ + { 34, 9, 12, 5, 2, 34, 0, }, /* 57 */ + { 34, 8, 12, 5, 1, 34, 0, }, /* 58 */ + { 34, 5, 12, 5, -2, 34, 0, }, /* 59 */ + { 34, 9, 12, 9, 2, 34, 0, }, /* 60 */ + { 34, 8, 12, 9, 1, 34, 0, }, /* 61 */ + { 34, 5, 12, 9, -2, 34, 0, }, /* 62 */ + { 34, 9, 12, 13, 2, 34, 0, }, /* 63 */ + { 34, 8, 12, 13, 1, 34, 0, }, /* 64 */ + { 34, 5, 12, 13, -2, 34, 0, }, /* 65 */ + { 34, 5, 12, 0, -79, 34, 0, }, /* 66 */ + { 34, 9, 12, 17, 2, 34, 0, }, /* 67 */ + { 34, 8, 12, 17, 1, 34, 0, }, /* 68 */ + { 34, 5, 12, 17, -2, 34, 0, }, /* 69 */ + { 34, 9, 12, 0, -97, 34, 0, }, /* 70 */ + { 34, 9, 12, 0, -56, 34, 0, }, /* 71 */ + { 34, 9, 12, 0, -130, 34, 0, }, /* 72 */ + { 34, 9, 12, 0, 10795, 34, 0, }, /* 73 */ + { 34, 9, 12, 0, -163, 34, 0, }, /* 74 */ + { 34, 9, 12, 0, 10792, 34, 0, }, /* 75 */ + { 34, 5, 12, 0, 10815, 34, 0, }, /* 76 */ + { 34, 9, 12, 0, -195, 34, 0, }, /* 77 */ + { 34, 9, 12, 0, 69, 34, 0, }, /* 78 */ + { 34, 9, 12, 0, 71, 34, 0, }, /* 79 */ + { 34, 5, 12, 0, 10783, 34, 0, }, /* 80 */ + { 34, 5, 12, 0, 10780, 34, 0, }, /* 81 */ + { 34, 5, 12, 0, 10782, 34, 0, }, /* 82 */ + { 34, 5, 12, 0, -210, 34, 0, }, /* 83 */ + { 34, 5, 12, 0, -206, 34, 0, }, /* 84 */ + { 34, 5, 12, 0, -205, 34, 0, }, /* 85 */ + { 34, 5, 12, 0, -202, 34, 0, }, /* 86 */ + { 34, 5, 12, 0, -203, 34, 0, }, /* 87 */ + { 34, 5, 12, 0, 42319, 34, 0, }, /* 88 */ + { 34, 5, 12, 0, 42315, 34, 0, }, /* 89 */ + { 34, 5, 12, 0, -207, 34, 0, }, /* 90 */ + { 34, 5, 12, 0, 42280, 34, 0, }, /* 91 */ + { 34, 5, 12, 0, 42308, 34, 0, }, /* 92 */ + { 34, 5, 12, 0, -209, 34, 0, }, /* 93 */ + { 34, 5, 12, 0, -211, 34, 0, }, /* 94 */ + { 34, 5, 12, 0, 10743, 34, 0, }, /* 95 */ + { 34, 5, 12, 0, 42305, 34, 0, }, /* 96 */ + { 34, 5, 12, 0, 10749, 34, 0, }, /* 97 */ + { 34, 5, 12, 0, -213, 34, 0, }, /* 98 */ + { 34, 5, 12, 0, -214, 34, 0, }, /* 99 */ + { 34, 5, 12, 0, 10727, 34, 0, }, /* 100 */ + { 34, 5, 12, 0, -218, 34, 0, }, /* 101 */ + { 34, 5, 12, 0, 42282, 34, 0, }, /* 102 */ + { 34, 5, 12, 0, -69, 34, 0, }, /* 103 */ + { 34, 5, 12, 0, -217, 34, 0, }, /* 104 */ + { 34, 5, 12, 0, -71, 34, 0, }, /* 105 */ + { 34, 5, 12, 0, -219, 34, 0, }, /* 106 */ + { 34, 5, 12, 0, 42261, 34, 0, }, /* 107 */ + { 34, 5, 12, 0, 42258, 34, 0, }, /* 108 */ + { 34, 6, 12, 0, 0, 34, 0, }, /* 109 */ + { 10, 6, 12, 0, 0, 10, 0, }, /* 110 */ + { 4, 24, 12, 0, 0, 4, 0, }, /* 111 */ + { 28, 12, 3, 0, 0, 28, 0, }, /* 112 */ + { 28, 12, 3, 0, 0, 20, 0, }, /* 113 */ + { 28, 12, 3, 21, 116, 20, 0, }, /* 114 */ + { 28, 12, 3, 0, 0, 34, 0, }, /* 115 */ + { 20, 9, 12, 0, 1, 20, 0, }, /* 116 */ + { 20, 5, 12, 0, -1, 20, 0, }, /* 117 */ + { 20, 24, 12, 0, 0, 20, 0, }, /* 118 */ + { 0, 2, 12, 0, 0, 0, 0, }, /* 119 */ + { 20, 6, 12, 0, 0, 20, 0, }, /* 120 */ + { 20, 5, 12, 0, 130, 20, 0, }, /* 121 */ + { 20, 9, 12, 0, 116, 20, 0, }, /* 122 */ + { 20, 9, 12, 0, 38, 20, 0, }, /* 123 */ + { 20, 9, 12, 0, 37, 20, 0, }, /* 124 */ + { 20, 9, 12, 0, 64, 20, 0, }, /* 125 */ + { 20, 9, 12, 0, 63, 20, 0, }, /* 126 */ + { 20, 5, 12, 0, 0, 20, 0, }, /* 127 */ + { 20, 9, 12, 0, 32, 20, 0, }, /* 128 */ + { 20, 9, 12, 34, 32, 20, 0, }, /* 129 */ + { 20, 9, 12, 59, 32, 20, 0, }, /* 130 */ + { 20, 9, 12, 38, 32, 20, 0, }, /* 131 */ + { 20, 9, 12, 21, 32, 20, 0, }, /* 132 */ + { 20, 9, 12, 51, 32, 20, 0, }, /* 133 */ + { 20, 9, 12, 26, 32, 20, 0, }, /* 134 */ + { 20, 9, 12, 47, 32, 20, 0, }, /* 135 */ + { 20, 9, 12, 55, 32, 20, 0, }, /* 136 */ + { 20, 9, 12, 30, 32, 20, 0, }, /* 137 */ + { 20, 9, 12, 43, 32, 20, 0, }, /* 138 */ + { 20, 9, 12, 96, 32, 20, 0, }, /* 139 */ + { 20, 5, 12, 0, -38, 20, 0, }, /* 140 */ + { 20, 5, 12, 0, -37, 20, 0, }, /* 141 */ + { 20, 5, 12, 0, -32, 20, 0, }, /* 142 */ + { 20, 5, 12, 34, -32, 20, 0, }, /* 143 */ + { 20, 5, 12, 59, -32, 20, 0, }, /* 144 */ + { 20, 5, 12, 38, -32, 20, 0, }, /* 145 */ + { 20, 5, 12, 21, -116, 20, 0, }, /* 146 */ + { 20, 5, 12, 51, -32, 20, 0, }, /* 147 */ + { 20, 5, 12, 26, -775, 20, 0, }, /* 148 */ + { 20, 5, 12, 47, -32, 20, 0, }, /* 149 */ + { 20, 5, 12, 55, -32, 20, 0, }, /* 150 */ + { 20, 5, 12, 30, 1, 20, 0, }, /* 151 */ + { 20, 5, 12, 30, -32, 20, 0, }, /* 152 */ + { 20, 5, 12, 43, -32, 20, 0, }, /* 153 */ + { 20, 5, 12, 96, -32, 20, 0, }, /* 154 */ + { 20, 5, 12, 0, -64, 20, 0, }, /* 155 */ + { 20, 5, 12, 0, -63, 20, 0, }, /* 156 */ + { 20, 9, 12, 0, 8, 20, 0, }, /* 157 */ + { 20, 5, 12, 34, -30, 20, 0, }, /* 158 */ + { 20, 5, 12, 38, -25, 20, 0, }, /* 159 */ + { 20, 9, 12, 0, 0, 20, 0, }, /* 160 */ + { 20, 5, 12, 43, -15, 20, 0, }, /* 161 */ + { 20, 5, 12, 47, -22, 20, 0, }, /* 162 */ + { 20, 5, 12, 0, -8, 20, 0, }, /* 163 */ + { 11, 9, 12, 0, 1, 11, 0, }, /* 164 */ + { 11, 5, 12, 0, -1, 11, 0, }, /* 165 */ + { 20, 5, 12, 51, -54, 20, 0, }, /* 166 */ + { 20, 5, 12, 55, -48, 20, 0, }, /* 167 */ + { 20, 5, 12, 0, 7, 20, 0, }, /* 168 */ + { 20, 5, 12, 0, -116, 20, 0, }, /* 169 */ + { 20, 9, 12, 38, -60, 20, 0, }, /* 170 */ + { 20, 5, 12, 59, -64, 20, 0, }, /* 171 */ + { 20, 25, 12, 0, 0, 20, 0, }, /* 172 */ + { 20, 9, 12, 0, -7, 20, 0, }, /* 173 */ + { 20, 9, 12, 0, -130, 20, 0, }, /* 174 */ + { 13, 9, 12, 0, 80, 13, 0, }, /* 175 */ + { 13, 9, 12, 0, 32, 13, 0, }, /* 176 */ + { 13, 9, 12, 63, 32, 13, 0, }, /* 177 */ + { 13, 9, 12, 67, 32, 13, 0, }, /* 178 */ + { 13, 9, 12, 71, 32, 13, 0, }, /* 179 */ + { 13, 9, 12, 75, 32, 13, 0, }, /* 180 */ + { 13, 9, 12, 79, 32, 13, 0, }, /* 181 */ + { 13, 9, 12, 84, 32, 13, 0, }, /* 182 */ + { 13, 5, 12, 0, -32, 13, 0, }, /* 183 */ + { 13, 5, 12, 63, -32, 13, 0, }, /* 184 */ + { 13, 5, 12, 67, -32, 13, 0, }, /* 185 */ + { 13, 5, 12, 71, -32, 13, 0, }, /* 186 */ + { 13, 5, 12, 75, -32, 13, 0, }, /* 187 */ + { 13, 5, 12, 79, -32, 13, 0, }, /* 188 */ + { 13, 5, 12, 84, -32, 13, 0, }, /* 189 */ + { 13, 5, 12, 0, -80, 13, 0, }, /* 190 */ + { 13, 9, 12, 0, 1, 13, 0, }, /* 191 */ + { 13, 5, 12, 0, -1, 13, 0, }, /* 192 */ + { 13, 9, 12, 88, 1, 13, 0, }, /* 193 */ + { 13, 5, 12, 88, -1, 13, 0, }, /* 194 */ + { 13, 26, 12, 0, 0, 13, 0, }, /* 195 */ + { 13, 12, 3, 0, 0, -34, 0, }, /* 196 */ + { 13, 12, 3, 0, 0, -28, 0, }, /* 197 */ + { 28, 12, 3, 0, 0, -31, 0, }, /* 198 */ + { 13, 11, 3, 0, 0, 13, 0, }, /* 199 */ + { 13, 9, 12, 0, 15, 13, 0, }, /* 200 */ + { 13, 5, 12, 0, -15, 13, 0, }, /* 201 */ + { 2, 9, 12, 0, 48, 2, 0, }, /* 202 */ + { 2, 6, 12, 0, 0, 2, 0, }, /* 203 */ + { 2, 21, 12, 0, 0, 2, 0, }, /* 204 */ + { 2, 5, 12, 0, 0, 2, 0, }, /* 205 */ + { 2, 5, 12, 0, -48, 2, 0, }, /* 206 */ + { 10, 21, 12, 0, 0, -13, 0, }, /* 207 */ + { 2, 17, 12, 0, 0, 2, 0, }, /* 208 */ + { 2, 26, 12, 0, 0, 2, 0, }, /* 209 */ + { 2, 23, 12, 0, 0, 2, 0, }, /* 210 */ + { 26, 12, 3, 0, 0, 26, 0, }, /* 211 */ + { 26, 17, 12, 0, 0, 26, 0, }, /* 212 */ + { 26, 21, 12, 0, 0, 26, 0, }, /* 213 */ + { 26, 7, 12, 0, 0, 26, 0, }, /* 214 */ + { 1, 1, 4, 0, 0, 1, 0, }, /* 215 */ + { 10, 1, 4, 0, 0, 10, 0, }, /* 216 */ + { 1, 25, 12, 0, 0, 1, 0, }, /* 217 */ + { 1, 21, 12, 0, 0, 1, 0, }, /* 218 */ + { 1, 23, 12, 0, 0, 1, 0, }, /* 219 */ + { 10, 21, 12, 0, 0, -96, 0, }, /* 220 */ + { 1, 26, 12, 0, 0, 1, 0, }, /* 221 */ + { 1, 12, 3, 0, 0, 1, 0, }, /* 222 */ + { 1, 1, 2, 0, 0, -64, 0, }, /* 223 */ + { 1, 7, 12, 0, 0, 1, 0, }, /* 224 */ + { 10, 6, 12, 0, 0, -136, 0, }, /* 225 */ + { 28, 12, 3, 0, 0, -7, 0, }, /* 226 */ + { 1, 13, 12, 0, 0, -10, 0, }, /* 227 */ + { 1, 21, 12, 0, 0, -4, 0, }, /* 228 */ + { 1, 6, 12, 0, 0, 1, 0, }, /* 229 */ + { 1, 13, 12, 0, 0, 1, 0, }, /* 230 */ + { 50, 21, 12, 0, 0, 50, 0, }, /* 231 */ + { 50, 1, 4, 0, 0, 50, 0, }, /* 232 */ + { 50, 7, 12, 0, 0, 50, 0, }, /* 233 */ + { 50, 12, 3, 0, 0, 50, 0, }, /* 234 */ + { 56, 7, 12, 0, 0, 56, 0, }, /* 235 */ + { 56, 12, 3, 0, 0, 56, 0, }, /* 236 */ + { 64, 13, 12, 0, 0, 64, 0, }, /* 237 */ + { 64, 7, 12, 0, 0, 64, 0, }, /* 238 */ + { 64, 12, 3, 0, 0, 64, 0, }, /* 239 */ + { 64, 6, 12, 0, 0, 64, 0, }, /* 240 */ + { 64, 26, 12, 0, 0, 64, 0, }, /* 241 */ + { 64, 21, 12, 0, 0, 64, 0, }, /* 242 */ + { 64, 23, 12, 0, 0, 64, 0, }, /* 243 */ + { 90, 7, 12, 0, 0, 90, 0, }, /* 244 */ + { 90, 12, 3, 0, 0, 90, 0, }, /* 245 */ + { 90, 6, 12, 0, 0, 90, 0, }, /* 246 */ + { 90, 21, 12, 0, 0, 90, 0, }, /* 247 */ + { 95, 7, 12, 0, 0, 95, 0, }, /* 248 */ + { 95, 12, 3, 0, 0, 95, 0, }, /* 249 */ + { 95, 21, 12, 0, 0, 95, 0, }, /* 250 */ + { 15, 12, 3, 0, 0, 15, 0, }, /* 251 */ + { 15, 10, 5, 0, 0, 15, 0, }, /* 252 */ + { 15, 7, 12, 0, 0, 15, 0, }, /* 253 */ + { 28, 12, 3, 0, 0, -183, 0, }, /* 254 */ + { 28, 12, 3, 0, 0, -157, 0, }, /* 255 */ + { 10, 21, 12, 0, 0, -211, 0, }, /* 256 */ + { 10, 21, 12, 0, 0, -230, 0, }, /* 257 */ + { 15, 13, 12, 0, 0, -111, 0, }, /* 258 */ + { 15, 21, 12, 0, 0, 15, 0, }, /* 259 */ + { 15, 6, 12, 0, 0, 15, 0, }, /* 260 */ + { 3, 7, 12, 0, 0, 3, 0, }, /* 261 */ + { 3, 12, 3, 0, 0, 3, 0, }, /* 262 */ + { 3, 10, 5, 0, 0, 3, 0, }, /* 263 */ + { 3, 10, 3, 0, 0, 3, 0, }, /* 264 */ + { 3, 13, 12, 0, 0, -68, 0, }, /* 265 */ + { 3, 23, 12, 0, 0, 3, 0, }, /* 266 */ + { 3, 15, 12, 0, 0, 3, 0, }, /* 267 */ + { 3, 26, 12, 0, 0, 3, 0, }, /* 268 */ + { 3, 21, 12, 0, 0, 3, 0, }, /* 269 */ + { 22, 12, 3, 0, 0, 22, 0, }, /* 270 */ + { 22, 10, 5, 0, 0, 22, 0, }, /* 271 */ + { 22, 7, 12, 0, 0, 22, 0, }, /* 272 */ + { 22, 13, 12, 0, 0, -55, 0, }, /* 273 */ + { 22, 21, 12, 0, 0, 22, 0, }, /* 274 */ + { 21, 12, 3, 0, 0, 21, 0, }, /* 275 */ + { 21, 10, 5, 0, 0, 21, 0, }, /* 276 */ + { 21, 7, 12, 0, 0, 21, 0, }, /* 277 */ + { 21, 13, 12, 0, 0, -52, 0, }, /* 278 */ + { 21, 21, 12, 0, 0, 21, 0, }, /* 279 */ + { 21, 23, 12, 0, 0, 21, 0, }, /* 280 */ + { 44, 12, 3, 0, 0, 44, 0, }, /* 281 */ + { 44, 10, 5, 0, 0, 44, 0, }, /* 282 */ + { 44, 7, 12, 0, 0, 44, 0, }, /* 283 */ + { 44, 10, 3, 0, 0, 44, 0, }, /* 284 */ + { 44, 13, 12, 0, 0, 44, 0, }, /* 285 */ + { 44, 26, 12, 0, 0, 44, 0, }, /* 286 */ + { 44, 15, 12, 0, 0, 44, 0, }, /* 287 */ + { 54, 12, 3, 0, 0, 54, 0, }, /* 288 */ + { 54, 7, 12, 0, 0, 54, 0, }, /* 289 */ + { 54, 10, 3, 0, 0, 54, 0, }, /* 290 */ + { 54, 10, 5, 0, 0, 54, 0, }, /* 291 */ + { 54, 13, 12, 0, 0, -49, 0, }, /* 292 */ + { 54, 15, 12, 0, 0, -49, 0, }, /* 293 */ + { 54, 26, 12, 0, 0, -49, 0, }, /* 294 */ + { 54, 26, 12, 0, 0, 54, 0, }, /* 295 */ + { 54, 23, 12, 0, 0, 54, 0, }, /* 296 */ + { 55, 12, 3, 0, 0, 55, 0, }, /* 297 */ + { 55, 10, 5, 0, 0, 55, 0, }, /* 298 */ + { 55, 7, 12, 0, 0, 55, 0, }, /* 299 */ + { 55, 13, 12, 0, 0, 55, 0, }, /* 300 */ + { 55, 15, 12, 0, 0, 55, 0, }, /* 301 */ + { 55, 26, 12, 0, 0, 55, 0, }, /* 302 */ + { 29, 7, 12, 0, 0, 29, 0, }, /* 303 */ + { 29, 12, 3, 0, 0, 29, 0, }, /* 304 */ + { 29, 10, 5, 0, 0, 29, 0, }, /* 305 */ + { 29, 21, 12, 0, 0, 29, 0, }, /* 306 */ + { 29, 10, 3, 0, 0, 29, 0, }, /* 307 */ + { 29, 13, 12, 0, 0, 29, 0, }, /* 308 */ + { 37, 12, 3, 0, 0, 37, 0, }, /* 309 */ + { 37, 10, 5, 0, 0, 37, 0, }, /* 310 */ + { 37, 7, 12, 0, 0, 37, 0, }, /* 311 */ + { 37, 10, 3, 0, 0, 37, 0, }, /* 312 */ + { 37, 7, 4, 0, 0, 37, 0, }, /* 313 */ + { 37, 26, 12, 0, 0, 37, 0, }, /* 314 */ + { 37, 15, 12, 0, 0, 37, 0, }, /* 315 */ + { 37, 13, 12, 0, 0, 37, 0, }, /* 316 */ + { 48, 10, 5, 0, 0, 48, 0, }, /* 317 */ + { 48, 7, 12, 0, 0, 48, 0, }, /* 318 */ + { 48, 12, 3, 0, 0, 48, 0, }, /* 319 */ + { 48, 10, 3, 0, 0, 48, 0, }, /* 320 */ + { 48, 13, 12, 0, 0, 48, 0, }, /* 321 */ + { 48, 21, 12, 0, 0, 48, 0, }, /* 322 */ + { 57, 7, 12, 0, 0, 57, 0, }, /* 323 */ + { 57, 12, 3, 0, 0, 57, 0, }, /* 324 */ + { 57, 7, 5, 0, 0, 57, 0, }, /* 325 */ + { 57, 6, 12, 0, 0, 57, 0, }, /* 326 */ + { 57, 21, 12, 0, 0, 57, 0, }, /* 327 */ + { 57, 13, 12, 0, 0, 57, 0, }, /* 328 */ + { 33, 7, 12, 0, 0, 33, 0, }, /* 329 */ + { 33, 12, 3, 0, 0, 33, 0, }, /* 330 */ + { 33, 7, 5, 0, 0, 33, 0, }, /* 331 */ + { 33, 6, 12, 0, 0, 33, 0, }, /* 332 */ + { 33, 13, 12, 0, 0, 33, 0, }, /* 333 */ + { 58, 7, 12, 0, 0, 58, 0, }, /* 334 */ + { 58, 26, 12, 0, 0, 58, 0, }, /* 335 */ + { 58, 21, 12, 0, 0, 58, 0, }, /* 336 */ + { 58, 12, 3, 0, 0, 58, 0, }, /* 337 */ + { 58, 13, 12, 0, 0, 58, 0, }, /* 338 */ + { 58, 15, 12, 0, 0, 58, 0, }, /* 339 */ + { 58, 22, 12, 0, 0, 58, 0, }, /* 340 */ + { 58, 18, 12, 0, 0, 58, 0, }, /* 341 */ + { 58, 10, 5, 0, 0, 58, 0, }, /* 342 */ + { 39, 7, 12, 0, 0, 39, 0, }, /* 343 */ + { 39, 10, 12, 0, 0, 39, 0, }, /* 344 */ + { 39, 12, 3, 0, 0, 39, 0, }, /* 345 */ + { 39, 10, 5, 0, 0, 39, 0, }, /* 346 */ + { 39, 13, 12, 0, 0, -72, 0, }, /* 347 */ + { 39, 21, 12, 0, 0, 39, 0, }, /* 348 */ + { 39, 13, 12, 0, 0, 39, 0, }, /* 349 */ + { 39, 26, 12, 0, 0, 39, 0, }, /* 350 */ + { 17, 9, 12, 0, 7264, 17, 0, }, /* 351 */ + { 17, 5, 12, 0, 3008, 17, 0, }, /* 352 */ + { 10, 21, 12, 0, 0, -46, 0, }, /* 353 */ + { 17, 6, 12, 0, 0, 17, 0, }, /* 354 */ + { 24, 7, 6, 0, 0, 24, 0, }, /* 355 */ + { 24, 7, 7, 0, 0, 24, 0, }, /* 356 */ + { 24, 7, 8, 0, 0, 24, 0, }, /* 357 */ + { 16, 7, 12, 0, 0, 16, 0, }, /* 358 */ + { 16, 12, 3, 0, 0, 16, 0, }, /* 359 */ + { 16, 21, 12, 0, 0, 16, 0, }, /* 360 */ + { 16, 15, 12, 0, 0, 16, 0, }, /* 361 */ + { 16, 26, 12, 0, 0, 16, 0, }, /* 362 */ + { 9, 9, 12, 0, 38864, 9, 0, }, /* 363 */ + { 9, 9, 12, 0, 8, 9, 0, }, /* 364 */ + { 9, 5, 12, 0, -8, 9, 0, }, /* 365 */ + { 8, 17, 12, 0, 0, 8, 0, }, /* 366 */ + { 8, 7, 12, 0, 0, 8, 0, }, /* 367 */ + { 8, 21, 12, 0, 0, 8, 0, }, /* 368 */ + { 41, 29, 12, 0, 0, 41, 0, }, /* 369 */ + { 41, 7, 12, 0, 0, 41, 0, }, /* 370 */ + { 41, 22, 12, 0, 0, 41, 0, }, /* 371 */ + { 41, 18, 12, 0, 0, 41, 0, }, /* 372 */ + { 46, 7, 12, 0, 0, 46, 0, }, /* 373 */ + { 46, 14, 12, 0, 0, 46, 0, }, /* 374 */ + { 51, 7, 12, 0, 0, 51, 0, }, /* 375 */ + { 51, 12, 3, 0, 0, 51, 0, }, /* 376 */ + { 25, 7, 12, 0, 0, 25, 0, }, /* 377 */ + { 25, 12, 3, 0, 0, 25, 0, }, /* 378 */ + { 10, 21, 12, 0, 0, -106, 0, }, /* 379 */ + { 7, 7, 12, 0, 0, 7, 0, }, /* 380 */ + { 7, 12, 3, 0, 0, 7, 0, }, /* 381 */ + { 52, 7, 12, 0, 0, 52, 0, }, /* 382 */ + { 52, 12, 3, 0, 0, 52, 0, }, /* 383 */ + { 32, 7, 12, 0, 0, 32, 0, }, /* 384 */ + { 32, 12, 3, 0, 0, 32, 0, }, /* 385 */ + { 32, 10, 5, 0, 0, 32, 0, }, /* 386 */ + { 32, 21, 12, 0, 0, 32, 0, }, /* 387 */ + { 32, 6, 12, 0, 0, 32, 0, }, /* 388 */ + { 32, 23, 12, 0, 0, 32, 0, }, /* 389 */ + { 32, 13, 12, 0, 0, 32, 0, }, /* 390 */ + { 32, 15, 12, 0, 0, 32, 0, }, /* 391 */ + { 38, 21, 12, 0, 0, 38, 0, }, /* 392 */ + { 10, 21, 12, 0, 0, -61, 0, }, /* 393 */ + { 38, 17, 12, 0, 0, 38, 0, }, /* 394 */ + { 38, 12, 3, 0, 0, 38, 0, }, /* 395 */ + { 38, 1, 2, 0, 0, 38, 0, }, /* 396 */ + { 38, 13, 12, 0, 0, 38, 0, }, /* 397 */ + { 38, 7, 12, 0, 0, 38, 0, }, /* 398 */ + { 38, 6, 12, 0, 0, 38, 0, }, /* 399 */ + { 35, 7, 12, 0, 0, 35, 0, }, /* 400 */ + { 35, 12, 3, 0, 0, 35, 0, }, /* 401 */ + { 35, 10, 5, 0, 0, 35, 0, }, /* 402 */ + { 35, 26, 12, 0, 0, 35, 0, }, /* 403 */ + { 35, 21, 12, 0, 0, 35, 0, }, /* 404 */ + { 35, 13, 12, 0, 0, 35, 0, }, /* 405 */ + { 53, 7, 12, 0, 0, 53, 0, }, /* 406 */ + { 40, 7, 12, 0, 0, 40, 0, }, /* 407 */ + { 40, 13, 12, 0, 0, 40, 0, }, /* 408 */ + { 40, 15, 12, 0, 0, 40, 0, }, /* 409 */ + { 40, 26, 12, 0, 0, 40, 0, }, /* 410 */ + { 32, 26, 12, 0, 0, 32, 0, }, /* 411 */ + { 6, 7, 12, 0, 0, 6, 0, }, /* 412 */ + { 6, 12, 3, 0, 0, 6, 0, }, /* 413 */ + { 6, 10, 5, 0, 0, 6, 0, }, /* 414 */ + { 6, 21, 12, 0, 0, 6, 0, }, /* 415 */ + { 91, 7, 12, 0, 0, 91, 0, }, /* 416 */ + { 91, 10, 5, 0, 0, 91, 0, }, /* 417 */ + { 91, 12, 3, 0, 0, 91, 0, }, /* 418 */ + { 91, 10, 12, 0, 0, 91, 0, }, /* 419 */ + { 91, 13, 12, 0, 0, 91, 0, }, /* 420 */ + { 91, 21, 12, 0, 0, 91, 0, }, /* 421 */ + { 91, 6, 12, 0, 0, 91, 0, }, /* 422 */ + { 28, 11, 3, 0, 0, 28, 0, }, /* 423 */ + { 62, 12, 3, 0, 0, 62, 0, }, /* 424 */ + { 62, 10, 5, 0, 0, 62, 0, }, /* 425 */ + { 62, 7, 12, 0, 0, 62, 0, }, /* 426 */ + { 62, 13, 12, 0, 0, 62, 0, }, /* 427 */ + { 62, 21, 12, 0, 0, 62, 0, }, /* 428 */ + { 62, 26, 12, 0, 0, 62, 0, }, /* 429 */ + { 76, 12, 3, 0, 0, 76, 0, }, /* 430 */ + { 76, 10, 5, 0, 0, 76, 0, }, /* 431 */ + { 76, 7, 12, 0, 0, 76, 0, }, /* 432 */ + { 76, 13, 12, 0, 0, 76, 0, }, /* 433 */ + { 93, 7, 12, 0, 0, 93, 0, }, /* 434 */ + { 93, 12, 3, 0, 0, 93, 0, }, /* 435 */ + { 93, 10, 5, 0, 0, 93, 0, }, /* 436 */ + { 93, 21, 12, 0, 0, 93, 0, }, /* 437 */ + { 70, 7, 12, 0, 0, 70, 0, }, /* 438 */ + { 70, 10, 5, 0, 0, 70, 0, }, /* 439 */ + { 70, 12, 3, 0, 0, 70, 0, }, /* 440 */ + { 70, 21, 12, 0, 0, 70, 0, }, /* 441 */ + { 70, 13, 12, 0, 0, 70, 0, }, /* 442 */ + { 73, 13, 12, 0, 0, 73, 0, }, /* 443 */ + { 73, 7, 12, 0, 0, 73, 0, }, /* 444 */ + { 73, 6, 12, 0, 0, 73, 0, }, /* 445 */ + { 73, 21, 12, 0, 0, 73, 0, }, /* 446 */ + { 13, 5, 12, 63, -6222, 13, 0, }, /* 447 */ + { 13, 5, 12, 67, -6221, 13, 0, }, /* 448 */ + { 13, 5, 12, 71, -6212, 13, 0, }, /* 449 */ + { 13, 5, 12, 75, -6210, 13, 0, }, /* 450 */ + { 13, 5, 12, 79, -6210, 13, 0, }, /* 451 */ + { 13, 5, 12, 79, -6211, 13, 0, }, /* 452 */ + { 13, 5, 12, 84, -6204, 13, 0, }, /* 453 */ + { 13, 5, 12, 88, -6180, 13, 0, }, /* 454 */ + { 13, 5, 12, 108, 35267, 13, 0, }, /* 455 */ + { 17, 9, 12, 0, -3008, 17, 0, }, /* 456 */ + { 76, 21, 12, 0, 0, 76, 0, }, /* 457 */ + { 28, 12, 3, 0, 0, -101, 0, }, /* 458 */ + { 28, 12, 3, 0, 0, 15, 0, }, /* 459 */ + { 10, 21, 12, 0, 0, -37, 0, }, /* 460 */ + { 28, 12, 3, 0, 0, -16, 0, }, /* 461 */ + { 28, 12, 3, 0, 0, -40, 0, }, /* 462 */ + { 28, 12, 3, 0, 0, -129, 0, }, /* 463 */ + { 10, 10, 5, 0, 0, -16, 0, }, /* 464 */ + { 10, 7, 12, 0, 0, 15, 0, }, /* 465 */ + { 10, 7, 12, 0, 0, -16, 0, }, /* 466 */ + { 10, 10, 5, 0, 0, -37, 0, }, /* 467 */ + { 28, 12, 3, 0, 0, -80, 0, }, /* 468 */ + { 10, 10, 5, 0, 0, 3, 0, }, /* 469 */ + { 28, 12, 3, 0, 0, -37, 0, }, /* 470 */ + { 13, 5, 12, 0, 0, 13, 0, }, /* 471 */ + { 13, 6, 12, 0, 0, 13, 0, }, /* 472 */ + { 34, 5, 12, 0, 35332, 34, 0, }, /* 473 */ + { 34, 5, 12, 0, 3814, 34, 0, }, /* 474 */ + { 34, 9, 12, 92, 1, 34, 0, }, /* 475 */ + { 34, 5, 12, 92, -1, 34, 0, }, /* 476 */ + { 34, 5, 12, 92, -58, 34, 0, }, /* 477 */ + { 34, 9, 12, 0, -7615, 34, 0, }, /* 478 */ + { 20, 5, 12, 0, 8, 20, 0, }, /* 479 */ + { 20, 9, 12, 0, -8, 20, 0, }, /* 480 */ + { 20, 5, 12, 0, 74, 20, 0, }, /* 481 */ + { 20, 5, 12, 0, 86, 20, 0, }, /* 482 */ + { 20, 5, 12, 0, 100, 20, 0, }, /* 483 */ + { 20, 5, 12, 0, 128, 20, 0, }, /* 484 */ + { 20, 5, 12, 0, 112, 20, 0, }, /* 485 */ + { 20, 5, 12, 0, 126, 20, 0, }, /* 486 */ + { 20, 8, 12, 0, -8, 20, 0, }, /* 487 */ + { 20, 5, 12, 0, 9, 20, 0, }, /* 488 */ + { 20, 9, 12, 0, -74, 20, 0, }, /* 489 */ + { 20, 8, 12, 0, -9, 20, 0, }, /* 490 */ + { 20, 5, 12, 21, -7173, 20, 0, }, /* 491 */ + { 20, 9, 12, 0, -86, 20, 0, }, /* 492 */ + { 20, 9, 12, 0, -100, 20, 0, }, /* 493 */ + { 20, 9, 12, 0, -112, 20, 0, }, /* 494 */ + { 20, 9, 12, 0, -128, 20, 0, }, /* 495 */ + { 20, 9, 12, 0, -126, 20, 0, }, /* 496 */ + { 28, 1, 3, 0, 0, 28, 0, }, /* 497 */ + { 28, 1, 13, 0, 0, 28, 0, }, /* 498 */ + { 10, 27, 2, 0, 0, 10, 0, }, /* 499 */ + { 10, 28, 2, 0, 0, 10, 0, }, /* 500 */ + { 10, 21, 14, 0, 0, 10, 0, }, /* 501 */ + { 0, 2, 2, 0, 0, 0, 0, }, /* 502 */ + { 28, 12, 3, 0, 0, -84, 0, }, /* 503 */ + { 10, 9, 12, 0, 0, 10, 0, }, /* 504 */ + { 10, 5, 12, 0, 0, 10, 0, }, /* 505 */ + { 20, 9, 12, 96, -7517, 20, 0, }, /* 506 */ + { 34, 9, 12, 100, -8383, 34, 0, }, /* 507 */ + { 34, 9, 12, 104, -8262, 34, 0, }, /* 508 */ + { 34, 9, 12, 0, 28, 34, 0, }, /* 509 */ + { 10, 7, 12, 0, 0, 10, 0, }, /* 510 */ + { 10, 5, 14, 0, 0, 10, 0, }, /* 511 */ + { 34, 5, 12, 0, -28, 34, 0, }, /* 512 */ + { 34, 14, 12, 0, 16, 34, 0, }, /* 513 */ + { 34, 14, 12, 0, -16, 34, 0, }, /* 514 */ + { 34, 14, 12, 0, 0, 34, 0, }, /* 515 */ + { 10, 25, 14, 0, 0, 10, 0, }, /* 516 */ + { 10, 26, 12, 0, 26, 10, 0, }, /* 517 */ + { 10, 26, 14, 0, 26, 10, 0, }, /* 518 */ + { 10, 26, 12, 0, -26, 10, 0, }, /* 519 */ + { 5, 26, 12, 0, 0, 5, 0, }, /* 520 */ + { 18, 9, 12, 0, 48, 18, 0, }, /* 521 */ + { 18, 5, 12, 0, -48, 18, 0, }, /* 522 */ + { 34, 9, 12, 0, -10743, 34, 0, }, /* 523 */ + { 34, 9, 12, 0, -3814, 34, 0, }, /* 524 */ + { 34, 9, 12, 0, -10727, 34, 0, }, /* 525 */ + { 34, 5, 12, 0, -10795, 34, 0, }, /* 526 */ + { 34, 5, 12, 0, -10792, 34, 0, }, /* 527 */ + { 34, 9, 12, 0, -10780, 34, 0, }, /* 528 */ + { 34, 9, 12, 0, -10749, 34, 0, }, /* 529 */ + { 34, 9, 12, 0, -10783, 34, 0, }, /* 530 */ + { 34, 9, 12, 0, -10782, 34, 0, }, /* 531 */ + { 34, 9, 12, 0, -10815, 34, 0, }, /* 532 */ + { 11, 5, 12, 0, 0, 11, 0, }, /* 533 */ + { 11, 26, 12, 0, 0, 11, 0, }, /* 534 */ + { 11, 12, 3, 0, 0, 11, 0, }, /* 535 */ + { 11, 21, 12, 0, 0, 11, 0, }, /* 536 */ + { 11, 15, 12, 0, 0, 11, 0, }, /* 537 */ + { 17, 5, 12, 0, -7264, 17, 0, }, /* 538 */ + { 59, 7, 12, 0, 0, 59, 0, }, /* 539 */ + { 59, 6, 12, 0, 0, 59, 0, }, /* 540 */ + { 59, 21, 12, 0, 0, 59, 0, }, /* 541 */ + { 59, 12, 3, 0, 0, 59, 0, }, /* 542 */ + { 13, 12, 3, 0, 0, 13, 0, }, /* 543 */ + { 10, 21, 12, 0, 0, -28, 0, }, /* 544 */ + { 23, 26, 12, 0, 0, 23, 0, }, /* 545 */ + { 10, 21, 12, 0, 0, -122, 0, }, /* 546 */ + { 10, 21, 12, 0, 0, -116, 0, }, /* 547 */ + { 23, 6, 12, 0, 0, 23, 0, }, /* 548 */ + { 10, 7, 12, 0, 0, 23, 0, }, /* 549 */ + { 23, 14, 12, 0, 0, 23, 0, }, /* 550 */ + { 10, 22, 12, 0, 0, -122, 0, }, /* 551 */ + { 10, 18, 12, 0, 0, -122, 0, }, /* 552 */ + { 10, 26, 12, 0, 0, -116, 0, }, /* 553 */ + { 10, 17, 12, 0, 0, -116, 0, }, /* 554 */ + { 10, 22, 12, 0, 0, -116, 0, }, /* 555 */ + { 10, 18, 12, 0, 0, -116, 0, }, /* 556 */ + { 28, 12, 3, 0, 0, -19, 0, }, /* 557 */ + { 24, 10, 3, 0, 0, 24, 0, }, /* 558 */ + { 10, 17, 14, 0, 0, -116, 0, }, /* 559 */ + { 10, 6, 12, 0, 0, -58, 0, }, /* 560 */ + { 10, 7, 12, 0, 0, -88, 0, }, /* 561 */ + { 10, 21, 14, 0, 0, -88, 0, }, /* 562 */ + { 10, 26, 12, 0, 0, 23, 0, }, /* 563 */ + { 27, 7, 12, 0, 0, 27, 0, }, /* 564 */ + { 28, 12, 3, 0, 0, -58, 0, }, /* 565 */ + { 10, 24, 12, 0, 0, -58, 0, }, /* 566 */ + { 27, 6, 12, 0, 0, 27, 0, }, /* 567 */ + { 10, 17, 12, 0, 0, -58, 0, }, /* 568 */ + { 30, 7, 12, 0, 0, 30, 0, }, /* 569 */ + { 30, 6, 12, 0, 0, 30, 0, }, /* 570 */ + { 4, 7, 12, 0, 0, 4, 0, }, /* 571 */ + { 24, 7, 12, 0, 0, 24, 0, }, /* 572 */ + { 10, 15, 12, 0, 0, 23, 0, }, /* 573 */ + { 24, 26, 12, 0, 0, 24, 0, }, /* 574 */ + { 10, 26, 14, 0, 0, 23, 0, }, /* 575 */ + { 30, 26, 12, 0, 0, 30, 0, }, /* 576 */ + { 23, 7, 12, 0, 0, 23, 0, }, /* 577 */ + { 61, 7, 12, 0, 0, 61, 0, }, /* 578 */ + { 61, 6, 12, 0, 0, 61, 0, }, /* 579 */ + { 61, 26, 12, 0, 0, 61, 0, }, /* 580 */ + { 86, 7, 12, 0, 0, 86, 0, }, /* 581 */ + { 86, 6, 12, 0, 0, 86, 0, }, /* 582 */ + { 86, 21, 12, 0, 0, 86, 0, }, /* 583 */ + { 77, 7, 12, 0, 0, 77, 0, }, /* 584 */ + { 77, 6, 12, 0, 0, 77, 0, }, /* 585 */ + { 77, 21, 12, 0, 0, 77, 0, }, /* 586 */ + { 77, 13, 12, 0, 0, 77, 0, }, /* 587 */ + { 13, 9, 12, 108, 1, 13, 0, }, /* 588 */ + { 13, 5, 12, 108, -35267, 13, 0, }, /* 589 */ + { 13, 7, 12, 0, 0, 13, 0, }, /* 590 */ + { 13, 21, 12, 0, 0, 13, 0, }, /* 591 */ + { 79, 7, 12, 0, 0, 79, 0, }, /* 592 */ + { 79, 14, 12, 0, 0, 79, 0, }, /* 593 */ + { 79, 12, 3, 0, 0, 79, 0, }, /* 594 */ + { 79, 21, 12, 0, 0, 79, 0, }, /* 595 */ + { 34, 9, 12, 0, -35332, 34, 0, }, /* 596 */ + { 34, 9, 12, 0, -42280, 34, 0, }, /* 597 */ + { 34, 9, 12, 0, -42308, 34, 0, }, /* 598 */ + { 34, 9, 12, 0, -42319, 34, 0, }, /* 599 */ + { 34, 9, 12, 0, -42315, 34, 0, }, /* 600 */ + { 34, 9, 12, 0, -42305, 34, 0, }, /* 601 */ + { 34, 9, 12, 0, -42258, 34, 0, }, /* 602 */ + { 34, 9, 12, 0, -42282, 34, 0, }, /* 603 */ + { 34, 9, 12, 0, -42261, 34, 0, }, /* 604 */ + { 34, 9, 12, 0, 928, 34, 0, }, /* 605 */ + { 49, 7, 12, 0, 0, 49, 0, }, /* 606 */ + { 49, 12, 3, 0, 0, 49, 0, }, /* 607 */ + { 49, 10, 5, 0, 0, 49, 0, }, /* 608 */ + { 49, 26, 12, 0, 0, 49, 0, }, /* 609 */ + { 10, 15, 12, 0, 0, -197, 0, }, /* 610 */ + { 10, 15, 12, 0, 0, -170, 0, }, /* 611 */ + { 10, 26, 12, 0, 0, -145, 0, }, /* 612 */ + { 10, 23, 12, 0, 0, -145, 0, }, /* 613 */ + { 65, 7, 12, 0, 0, 65, 0, }, /* 614 */ + { 65, 21, 12, 0, 0, 65, 0, }, /* 615 */ + { 75, 10, 5, 0, 0, 75, 0, }, /* 616 */ + { 75, 7, 12, 0, 0, 75, 0, }, /* 617 */ + { 75, 12, 3, 0, 0, 75, 0, }, /* 618 */ + { 75, 21, 12, 0, 0, 75, 0, }, /* 619 */ + { 75, 13, 12, 0, 0, 75, 0, }, /* 620 */ + { 15, 12, 3, 0, 0, -16, 0, }, /* 621 */ + { 15, 7, 12, 0, 0, -43, 0, }, /* 622 */ + { 69, 13, 12, 0, 0, 69, 0, }, /* 623 */ + { 69, 7, 12, 0, 0, 69, 0, }, /* 624 */ + { 69, 12, 3, 0, 0, 69, 0, }, /* 625 */ + { 10, 21, 12, 0, 0, -92, 0, }, /* 626 */ + { 69, 21, 12, 0, 0, 69, 0, }, /* 627 */ + { 74, 7, 12, 0, 0, 74, 0, }, /* 628 */ + { 74, 12, 3, 0, 0, 74, 0, }, /* 629 */ + { 74, 10, 5, 0, 0, 74, 0, }, /* 630 */ + { 74, 21, 12, 0, 0, 74, 0, }, /* 631 */ + { 84, 12, 3, 0, 0, 84, 0, }, /* 632 */ + { 84, 10, 5, 0, 0, 84, 0, }, /* 633 */ + { 84, 7, 12, 0, 0, 84, 0, }, /* 634 */ + { 84, 21, 12, 0, 0, 84, 0, }, /* 635 */ + { 10, 6, 12, 0, 0, -22, 0, }, /* 636 */ + { 84, 13, 12, 0, 0, 84, 0, }, /* 637 */ + { 39, 6, 12, 0, 0, 39, 0, }, /* 638 */ + { 68, 7, 12, 0, 0, 68, 0, }, /* 639 */ + { 68, 12, 3, 0, 0, 68, 0, }, /* 640 */ + { 68, 10, 5, 0, 0, 68, 0, }, /* 641 */ + { 68, 13, 12, 0, 0, 68, 0, }, /* 642 */ + { 68, 21, 12, 0, 0, 68, 0, }, /* 643 */ + { 92, 7, 12, 0, 0, 92, 0, }, /* 644 */ + { 92, 12, 3, 0, 0, 92, 0, }, /* 645 */ + { 92, 6, 12, 0, 0, 92, 0, }, /* 646 */ + { 92, 21, 12, 0, 0, 92, 0, }, /* 647 */ + { 87, 7, 12, 0, 0, 87, 0, }, /* 648 */ + { 87, 10, 5, 0, 0, 87, 0, }, /* 649 */ + { 87, 12, 3, 0, 0, 87, 0, }, /* 650 */ + { 87, 21, 12, 0, 0, 87, 0, }, /* 651 */ + { 87, 6, 12, 0, 0, 87, 0, }, /* 652 */ + { 34, 5, 12, 0, -928, 34, 0, }, /* 653 */ + { 9, 5, 12, 0, -38864, 9, 0, }, /* 654 */ + { 87, 13, 12, 0, 0, 87, 0, }, /* 655 */ + { 24, 7, 9, 0, 0, 24, 0, }, /* 656 */ + { 24, 7, 10, 0, 0, 24, 0, }, /* 657 */ + { 0, 4, 2, 0, 0, 0, 0, }, /* 658 */ + { 0, 3, 12, 0, 0, 0, 0, }, /* 659 */ + { 26, 25, 12, 0, 0, 26, 0, }, /* 660 */ + { 1, 24, 12, 0, 0, 1, 0, }, /* 661 */ + { 1, 7, 12, 0, 0, -10, 0, }, /* 662 */ + { 1, 26, 12, 0, 0, -10, 0, }, /* 663 */ + { 10, 6, 3, 0, 0, -58, 0, }, /* 664 */ + { 36, 7, 12, 0, 0, 36, 0, }, /* 665 */ + { 10, 21, 12, 0, 0, -25, 0, }, /* 666 */ + { 10, 15, 12, 0, 0, -76, 0, }, /* 667 */ + { 10, 26, 12, 0, 0, -25, 0, }, /* 668 */ + { 20, 14, 12, 0, 0, 20, 0, }, /* 669 */ + { 20, 15, 12, 0, 0, 20, 0, }, /* 670 */ + { 20, 26, 12, 0, 0, 20, 0, }, /* 671 */ + { 71, 7, 12, 0, 0, 71, 0, }, /* 672 */ + { 67, 7, 12, 0, 0, 67, 0, }, /* 673 */ + { 28, 12, 3, 0, 0, -1, 0, }, /* 674 */ + { 10, 15, 12, 0, 0, -1, 0, }, /* 675 */ + { 42, 7, 12, 0, 0, 42, 0, }, /* 676 */ + { 42, 15, 12, 0, 0, 42, 0, }, /* 677 */ + { 19, 7, 12, 0, 0, 19, 0, }, /* 678 */ + { 19, 14, 12, 0, 0, 19, 0, }, /* 679 */ + { 118, 7, 12, 0, 0, 118, 0, }, /* 680 */ + { 118, 12, 3, 0, 0, 118, 0, }, /* 681 */ + { 60, 7, 12, 0, 0, 60, 0, }, /* 682 */ + { 60, 21, 12, 0, 0, 60, 0, }, /* 683 */ + { 43, 7, 12, 0, 0, 43, 0, }, /* 684 */ + { 43, 21, 12, 0, 0, 43, 0, }, /* 685 */ + { 43, 14, 12, 0, 0, 43, 0, }, /* 686 */ + { 14, 9, 12, 0, 40, 14, 0, }, /* 687 */ + { 14, 5, 12, 0, -40, 14, 0, }, /* 688 */ + { 47, 7, 12, 0, 0, 47, 0, }, /* 689 */ + { 45, 7, 12, 0, 0, 45, 0, }, /* 690 */ + { 45, 13, 12, 0, 0, 45, 0, }, /* 691 */ + { 136, 9, 12, 0, 40, 136, 0, }, /* 692 */ + { 136, 5, 12, 0, -40, 136, 0, }, /* 693 */ + { 106, 7, 12, 0, 0, 106, 0, }, /* 694 */ + { 104, 7, 12, 0, 0, 104, 0, }, /* 695 */ + { 104, 21, 12, 0, 0, 104, 0, }, /* 696 */ + { 110, 7, 12, 0, 0, 110, 0, }, /* 697 */ + { 12, 7, 12, 0, 0, 12, 0, }, /* 698 */ + { 81, 7, 12, 0, 0, 81, 0, }, /* 699 */ + { 81, 21, 12, 0, 0, 81, 0, }, /* 700 */ + { 81, 15, 12, 0, 0, 81, 0, }, /* 701 */ + { 120, 7, 12, 0, 0, 120, 0, }, /* 702 */ + { 120, 26, 12, 0, 0, 120, 0, }, /* 703 */ + { 120, 15, 12, 0, 0, 120, 0, }, /* 704 */ + { 116, 7, 12, 0, 0, 116, 0, }, /* 705 */ + { 116, 15, 12, 0, 0, 116, 0, }, /* 706 */ + { 128, 7, 12, 0, 0, 128, 0, }, /* 707 */ + { 128, 15, 12, 0, 0, 128, 0, }, /* 708 */ + { 66, 7, 12, 0, 0, 66, 0, }, /* 709 */ + { 66, 15, 12, 0, 0, 66, 0, }, /* 710 */ + { 66, 21, 12, 0, 0, 66, 0, }, /* 711 */ + { 72, 7, 12, 0, 0, 72, 0, }, /* 712 */ + { 72, 21, 12, 0, 0, 72, 0, }, /* 713 */ + { 98, 7, 12, 0, 0, 98, 0, }, /* 714 */ + { 97, 7, 12, 0, 0, 97, 0, }, /* 715 */ + { 97, 15, 12, 0, 0, 97, 0, }, /* 716 */ + { 31, 7, 12, 0, 0, 31, 0, }, /* 717 */ + { 31, 12, 3, 0, 0, 31, 0, }, /* 718 */ + { 31, 15, 12, 0, 0, 31, 0, }, /* 719 */ + { 31, 21, 12, 0, 0, 31, 0, }, /* 720 */ + { 88, 7, 12, 0, 0, 88, 0, }, /* 721 */ + { 88, 15, 12, 0, 0, 88, 0, }, /* 722 */ + { 88, 21, 12, 0, 0, 88, 0, }, /* 723 */ + { 117, 7, 12, 0, 0, 117, 0, }, /* 724 */ + { 117, 15, 12, 0, 0, 117, 0, }, /* 725 */ + { 112, 7, 12, 0, 0, 112, 0, }, /* 726 */ + { 112, 26, 12, 0, 0, 112, 0, }, /* 727 */ + { 112, 12, 3, 0, 0, 112, 0, }, /* 728 */ + { 112, 15, 12, 0, 0, 112, 0, }, /* 729 */ + { 112, 21, 12, 0, 0, 112, 0, }, /* 730 */ + { 78, 7, 12, 0, 0, 78, 0, }, /* 731 */ + { 78, 21, 12, 0, 0, 78, 0, }, /* 732 */ + { 83, 7, 12, 0, 0, 83, 0, }, /* 733 */ + { 83, 15, 12, 0, 0, 83, 0, }, /* 734 */ + { 82, 7, 12, 0, 0, 82, 0, }, /* 735 */ + { 82, 15, 12, 0, 0, 82, 0, }, /* 736 */ + { 121, 7, 12, 0, 0, 121, 0, }, /* 737 */ + { 121, 21, 12, 0, 0, 121, 0, }, /* 738 */ + { 121, 15, 12, 0, 0, 121, 0, }, /* 739 */ + { 89, 7, 12, 0, 0, 89, 0, }, /* 740 */ + { 130, 9, 12, 0, 64, 130, 0, }, /* 741 */ + { 130, 5, 12, 0, -64, 130, 0, }, /* 742 */ + { 130, 15, 12, 0, 0, 130, 0, }, /* 743 */ + { 144, 7, 12, 0, 0, 144, 0, }, /* 744 */ + { 144, 12, 3, 0, 0, 144, 0, }, /* 745 */ + { 144, 13, 12, 0, 0, 144, 0, }, /* 746 */ + { 1, 15, 12, 0, 0, 1, 0, }, /* 747 */ + { 147, 7, 12, 0, 0, 147, 0, }, /* 748 */ + { 147, 15, 12, 0, 0, 147, 0, }, /* 749 */ + { 148, 7, 12, 0, 0, 148, 0, }, /* 750 */ + { 148, 12, 3, 0, 0, 148, 0, }, /* 751 */ + { 148, 15, 12, 0, 0, 148, 0, }, /* 752 */ + { 148, 21, 12, 0, 0, 148, 0, }, /* 753 */ + { 94, 10, 5, 0, 0, 94, 0, }, /* 754 */ + { 94, 12, 3, 0, 0, 94, 0, }, /* 755 */ + { 94, 7, 12, 0, 0, 94, 0, }, /* 756 */ + { 94, 21, 12, 0, 0, 94, 0, }, /* 757 */ + { 94, 15, 12, 0, 0, 94, 0, }, /* 758 */ + { 94, 13, 12, 0, 0, 94, 0, }, /* 759 */ + { 85, 12, 3, 0, 0, 85, 0, }, /* 760 */ + { 85, 10, 5, 0, 0, 85, 0, }, /* 761 */ + { 85, 7, 12, 0, 0, 85, 0, }, /* 762 */ + { 85, 21, 12, 0, 0, 85, 0, }, /* 763 */ + { 85, 1, 4, 0, 0, 85, 0, }, /* 764 */ + { 101, 7, 12, 0, 0, 101, 0, }, /* 765 */ + { 101, 13, 12, 0, 0, 101, 0, }, /* 766 */ + { 96, 12, 3, 0, 0, 96, 0, }, /* 767 */ + { 96, 7, 12, 0, 0, 96, 0, }, /* 768 */ + { 96, 10, 5, 0, 0, 96, 0, }, /* 769 */ + { 96, 13, 12, 0, 0, 96, 0, }, /* 770 */ + { 96, 21, 12, 0, 0, 96, 0, }, /* 771 */ + { 111, 7, 12, 0, 0, 111, 0, }, /* 772 */ + { 111, 12, 3, 0, 0, 111, 0, }, /* 773 */ + { 111, 21, 12, 0, 0, 111, 0, }, /* 774 */ + { 100, 12, 3, 0, 0, 100, 0, }, /* 775 */ + { 100, 10, 5, 0, 0, 100, 0, }, /* 776 */ + { 100, 7, 12, 0, 0, 100, 0, }, /* 777 */ + { 100, 7, 4, 0, 0, 100, 0, }, /* 778 */ + { 100, 21, 12, 0, 0, 100, 0, }, /* 779 */ + { 100, 13, 12, 0, 0, 100, 0, }, /* 780 */ + { 48, 15, 12, 0, 0, 48, 0, }, /* 781 */ + { 108, 7, 12, 0, 0, 108, 0, }, /* 782 */ + { 108, 10, 5, 0, 0, 108, 0, }, /* 783 */ + { 108, 12, 3, 0, 0, 108, 0, }, /* 784 */ + { 108, 21, 12, 0, 0, 108, 0, }, /* 785 */ + { 129, 7, 12, 0, 0, 129, 0, }, /* 786 */ + { 129, 21, 12, 0, 0, 129, 0, }, /* 787 */ + { 109, 7, 12, 0, 0, 109, 0, }, /* 788 */ + { 109, 12, 3, 0, 0, 109, 0, }, /* 789 */ + { 109, 10, 5, 0, 0, 109, 0, }, /* 790 */ + { 109, 13, 12, 0, 0, 109, 0, }, /* 791 */ + { 107, 12, 3, 0, 0, 107, 0, }, /* 792 */ + { 107, 12, 3, 0, 0, -49, 0, }, /* 793 */ + { 107, 10, 5, 0, 0, 107, 0, }, /* 794 */ + { 107, 10, 5, 0, 0, -49, 0, }, /* 795 */ + { 107, 7, 12, 0, 0, 107, 0, }, /* 796 */ + { 28, 12, 3, 0, 0, -49, 0, }, /* 797 */ + { 107, 10, 3, 0, 0, 107, 0, }, /* 798 */ + { 135, 7, 12, 0, 0, 135, 0, }, /* 799 */ + { 135, 10, 5, 0, 0, 135, 0, }, /* 800 */ + { 135, 12, 3, 0, 0, 135, 0, }, /* 801 */ + { 135, 21, 12, 0, 0, 135, 0, }, /* 802 */ + { 135, 13, 12, 0, 0, 135, 0, }, /* 803 */ + { 124, 7, 12, 0, 0, 124, 0, }, /* 804 */ + { 124, 10, 3, 0, 0, 124, 0, }, /* 805 */ + { 124, 10, 5, 0, 0, 124, 0, }, /* 806 */ + { 124, 12, 3, 0, 0, 124, 0, }, /* 807 */ + { 124, 21, 12, 0, 0, 124, 0, }, /* 808 */ + { 124, 13, 12, 0, 0, 124, 0, }, /* 809 */ + { 123, 7, 12, 0, 0, 123, 0, }, /* 810 */ + { 123, 10, 3, 0, 0, 123, 0, }, /* 811 */ + { 123, 10, 5, 0, 0, 123, 0, }, /* 812 */ + { 123, 12, 3, 0, 0, 123, 0, }, /* 813 */ + { 123, 21, 12, 0, 0, 123, 0, }, /* 814 */ + { 114, 7, 12, 0, 0, 114, 0, }, /* 815 */ + { 114, 10, 5, 0, 0, 114, 0, }, /* 816 */ + { 114, 12, 3, 0, 0, 114, 0, }, /* 817 */ + { 114, 21, 12, 0, 0, 114, 0, }, /* 818 */ + { 114, 13, 12, 0, 0, 114, 0, }, /* 819 */ + { 102, 7, 12, 0, 0, 102, 0, }, /* 820 */ + { 102, 12, 3, 0, 0, 102, 0, }, /* 821 */ + { 102, 10, 5, 0, 0, 102, 0, }, /* 822 */ + { 102, 13, 12, 0, 0, 102, 0, }, /* 823 */ + { 126, 7, 12, 0, 0, 126, 0, }, /* 824 */ + { 126, 12, 3, 0, 0, 126, 0, }, /* 825 */ + { 126, 10, 5, 0, 0, 126, 0, }, /* 826 */ + { 126, 13, 12, 0, 0, 126, 0, }, /* 827 */ + { 126, 15, 12, 0, 0, 126, 0, }, /* 828 */ + { 126, 21, 12, 0, 0, 126, 0, }, /* 829 */ + { 126, 26, 12, 0, 0, 126, 0, }, /* 830 */ + { 142, 7, 12, 0, 0, 142, 0, }, /* 831 */ + { 142, 10, 5, 0, 0, 142, 0, }, /* 832 */ + { 142, 12, 3, 0, 0, 142, 0, }, /* 833 */ + { 142, 21, 12, 0, 0, 142, 0, }, /* 834 */ + { 125, 9, 12, 0, 32, 125, 0, }, /* 835 */ + { 125, 5, 12, 0, -32, 125, 0, }, /* 836 */ + { 125, 13, 12, 0, 0, 125, 0, }, /* 837 */ + { 125, 15, 12, 0, 0, 125, 0, }, /* 838 */ + { 125, 7, 12, 0, 0, 125, 0, }, /* 839 */ + { 141, 7, 12, 0, 0, 141, 0, }, /* 840 */ + { 141, 12, 3, 0, 0, 141, 0, }, /* 841 */ + { 141, 10, 5, 0, 0, 141, 0, }, /* 842 */ + { 141, 7, 4, 0, 0, 141, 0, }, /* 843 */ + { 141, 21, 12, 0, 0, 141, 0, }, /* 844 */ + { 140, 7, 12, 0, 0, 140, 0, }, /* 845 */ + { 140, 12, 3, 0, 0, 140, 0, }, /* 846 */ + { 140, 10, 5, 0, 0, 140, 0, }, /* 847 */ + { 140, 7, 4, 0, 0, 140, 0, }, /* 848 */ + { 140, 21, 12, 0, 0, 140, 0, }, /* 849 */ + { 122, 7, 12, 0, 0, 122, 0, }, /* 850 */ + { 133, 7, 12, 0, 0, 133, 0, }, /* 851 */ + { 133, 10, 5, 0, 0, 133, 0, }, /* 852 */ + { 133, 12, 3, 0, 0, 133, 0, }, /* 853 */ + { 133, 21, 12, 0, 0, 133, 0, }, /* 854 */ + { 133, 13, 12, 0, 0, 133, 0, }, /* 855 */ + { 133, 15, 12, 0, 0, 133, 0, }, /* 856 */ + { 134, 21, 12, 0, 0, 134, 0, }, /* 857 */ + { 134, 7, 12, 0, 0, 134, 0, }, /* 858 */ + { 134, 12, 3, 0, 0, 134, 0, }, /* 859 */ + { 134, 10, 5, 0, 0, 134, 0, }, /* 860 */ + { 138, 7, 12, 0, 0, 138, 0, }, /* 861 */ + { 138, 12, 3, 0, 0, 138, 0, }, /* 862 */ + { 138, 7, 4, 0, 0, 138, 0, }, /* 863 */ + { 138, 13, 12, 0, 0, 138, 0, }, /* 864 */ + { 143, 7, 12, 0, 0, 143, 0, }, /* 865 */ + { 143, 10, 5, 0, 0, 143, 0, }, /* 866 */ + { 143, 12, 3, 0, 0, 143, 0, }, /* 867 */ + { 143, 13, 12, 0, 0, 143, 0, }, /* 868 */ + { 145, 7, 12, 0, 0, 145, 0, }, /* 869 */ + { 145, 12, 3, 0, 0, 145, 0, }, /* 870 */ + { 145, 10, 5, 0, 0, 145, 0, }, /* 871 */ + { 145, 21, 12, 0, 0, 145, 0, }, /* 872 */ + { 63, 7, 12, 0, 0, 63, 0, }, /* 873 */ + { 63, 14, 12, 0, 0, 63, 0, }, /* 874 */ + { 63, 21, 12, 0, 0, 63, 0, }, /* 875 */ + { 80, 7, 12, 0, 0, 80, 0, }, /* 876 */ + { 127, 7, 12, 0, 0, 127, 0, }, /* 877 */ + { 115, 7, 12, 0, 0, 115, 0, }, /* 878 */ + { 115, 13, 12, 0, 0, 115, 0, }, /* 879 */ + { 115, 21, 12, 0, 0, 115, 0, }, /* 880 */ + { 103, 7, 12, 0, 0, 103, 0, }, /* 881 */ + { 103, 12, 3, 0, 0, 103, 0, }, /* 882 */ + { 103, 21, 12, 0, 0, 103, 0, }, /* 883 */ + { 119, 7, 12, 0, 0, 119, 0, }, /* 884 */ + { 119, 12, 3, 0, 0, 119, 0, }, /* 885 */ + { 119, 21, 12, 0, 0, 119, 0, }, /* 886 */ + { 119, 26, 12, 0, 0, 119, 0, }, /* 887 */ + { 119, 6, 12, 0, 0, 119, 0, }, /* 888 */ + { 119, 13, 12, 0, 0, 119, 0, }, /* 889 */ + { 119, 15, 12, 0, 0, 119, 0, }, /* 890 */ + { 146, 9, 12, 0, 32, 146, 0, }, /* 891 */ + { 146, 5, 12, 0, -32, 146, 0, }, /* 892 */ + { 146, 15, 12, 0, 0, 146, 0, }, /* 893 */ + { 146, 21, 12, 0, 0, 146, 0, }, /* 894 */ + { 99, 7, 12, 0, 0, 99, 0, }, /* 895 */ + { 99, 10, 5, 0, 0, 99, 0, }, /* 896 */ + { 99, 12, 3, 0, 0, 99, 0, }, /* 897 */ + { 99, 6, 12, 0, 0, 99, 0, }, /* 898 */ + { 137, 6, 12, 0, 0, 137, 0, }, /* 899 */ + { 139, 6, 12, 0, 0, 139, 0, }, /* 900 */ + { 137, 7, 12, 0, 0, 137, 0, }, /* 901 */ + { 139, 7, 12, 0, 0, 139, 0, }, /* 902 */ + { 105, 7, 12, 0, 0, 105, 0, }, /* 903 */ + { 105, 26, 12, 0, 0, 105, 0, }, /* 904 */ + { 105, 12, 3, 0, 0, 105, 0, }, /* 905 */ + { 105, 21, 12, 0, 0, 105, 0, }, /* 906 */ + { 10, 1, 2, 0, 0, 105, 0, }, /* 907 */ + { 10, 10, 3, 0, 0, 10, 0, }, /* 908 */ + { 10, 10, 5, 0, 0, 10, 0, }, /* 909 */ + { 20, 12, 3, 0, 0, 20, 0, }, /* 910 */ + { 131, 26, 12, 0, 0, 131, 0, }, /* 911 */ + { 131, 12, 3, 0, 0, 131, 0, }, /* 912 */ + { 131, 21, 12, 0, 0, 131, 0, }, /* 913 */ + { 18, 12, 3, 0, 0, 18, 0, }, /* 914 */ + { 113, 7, 12, 0, 0, 113, 0, }, /* 915 */ + { 113, 15, 12, 0, 0, 113, 0, }, /* 916 */ + { 113, 12, 3, 0, 0, 113, 0, }, /* 917 */ + { 132, 9, 12, 0, 34, 132, 0, }, /* 918 */ + { 132, 5, 12, 0, -34, 132, 0, }, /* 919 */ + { 132, 12, 3, 0, 0, 132, 0, }, /* 920 */ + { 132, 13, 12, 0, 0, 132, 0, }, /* 921 */ + { 132, 21, 12, 0, 0, 132, 0, }, /* 922 */ + { 0, 2, 14, 0, 0, 0, 0, }, /* 923 */ + { 10, 26, 11, 0, 0, 10, 0, }, /* 924 */ + { 27, 26, 12, 0, 0, 27, 0, }, /* 925 */ + { 10, 24, 3, 0, 0, 10, 0, }, /* 926 */ + { 10, 1, 3, 0, 0, 10, 0, }, /* 927 */ }; const uint16_t PRIV(ucd_stage1)[] = { /* 17408 bytes */ @@ -968,3216 +1123,3226 @@ const uint16_t PRIV(ucd_stage1)[] = { /* 17408 bytes */ 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, /* U+1800 */ 62, 63, 64, 65, 66, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, /* U+2000 */ 77, 77, 78, 79, 66, 66, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, /* U+2800 */ - 90, 91, 92, 93, 94, 95, 96, 71, 97, 97, 97, 97, 97, 97, 97, 97, /* U+3000 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+3800 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+4000 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 98, 97, 97, 97, 97, /* U+4800 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+5000 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+5800 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+6000 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+6800 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+7000 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+7800 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+8000 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+8800 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+9000 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 99, /* U+9800 */ -100,101,101,101,101,101,101,101,101,102,103,103,104,105,106,107, /* U+A000 */ -108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,116, /* U+A800 */ -117,118,119,120,121,122,116,117,118,119,120,121,122,116,117,118, /* U+B000 */ -119,120,121,122,116,117,118,119,120,121,122,116,117,118,119,120, /* U+B800 */ -121,122,116,117,118,119,120,121,122,116,117,118,119,120,121,122, /* U+C000 */ -116,117,118,119,120,121,122,116,117,118,119,120,121,122,116,117, /* U+C800 */ -118,119,120,121,122,116,117,118,119,120,121,122,116,117,118,123, /* U+D000 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+D800 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+E000 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+E800 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F000 */ -125,125, 97, 97,126,127,128,129,130,130,131,132,133,134,135,136, /* U+F800 */ -137,138,139,140,141,142,143,144,145,146,147,141,148,148,149,141, /* U+10000 */ -150,151,152,153,154,155,156,157,158,159,160,141,161,141,162,141, /* U+10800 */ -163,164,165,166,167,168,169,141,170,171,141,172,173,174,175,141, /* U+11000 */ -176,177,141,141,178,179,141,141,180,181,182,183,141,184,141,141, /* U+11800 */ -185,185,185,185,185,185,185,186,187,185,188,141,141,141,141,141, /* U+12000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+12800 */ -189,189,189,189,189,189,189,189,190,141,141,141,141,141,141,141, /* U+13000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+13800 */ -141,141,141,141,141,141,141,141,191,191,191,191,192,141,141,141, /* U+14000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+14800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+15000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+15800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+16000 */ -193,193,193,193,194,195,196,197,141,141,141,141,198,199,200,201, /* U+16800 */ -202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202, /* U+17000 */ -202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202, /* U+17800 */ -202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,203, /* U+18000 */ -202,202,202,202,202,204,141,141,141,141,141,141,141,141,141,141, /* U+18800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+19000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+19800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+1A000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+1A800 */ -205,206,207,208,208,209,141,141,141,141,141,141,141,141,141,141, /* U+1B000 */ -141,141,141,141,141,141,141,141,210,211,141,141,141,141,141,141, /* U+1B800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+1C000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+1C800 */ - 71,212,213,214,215,216,217,141,218,219,220,221,222,223,224,225, /* U+1D000 */ -226,226,226,226,227,228,141,141,141,141,141,141,141,141,141,141, /* U+1D800 */ -229,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+1E000 */ -230,231,232,141,141,141,141,141,233,234,141,141,235,236,141,141, /* U+1E800 */ -237,238,239,240,241,242,243,244,243,243,245,243,246,247,248,249, /* U+1F000 */ -250,251,252,253,254,242,242,242,242,242,242,242,242,242,242,255, /* U+1F800 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+20000 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+20800 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+21000 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+21800 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+22000 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+22800 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+23000 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+23800 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+24000 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+24800 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+25000 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+25800 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+26000 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+26800 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+27000 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+27800 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+28000 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+28800 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+29000 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+29800 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,256, 97, 97, /* U+2A000 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+2A800 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,257, 97, /* U+2B000 */ -258, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+2B800 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+2C000 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,259, 97, 97, /* U+2C800 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+2D000 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+2D800 */ - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+2E000 */ - 97, 97, 97, 97, 97, 97, 97,260,141,141,141,141,141,141,141,141, /* U+2E800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+2F000 */ - 97, 97, 97, 97,261,141,141,141,141,141,141,141,141,141,141,141, /* U+2F800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+30000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+30800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+31000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+31800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+32000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+32800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+33000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+33800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+34000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+34800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+35000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+35800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+36000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+36800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+37000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+37800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+38000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+38800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+39000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+39800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+3A000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+3A800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+3B000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+3B800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+3C000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+3C800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+3D000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+3D800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+3E000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+3E800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+3F000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+3F800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+40000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+40800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+41000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+41800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+42000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+42800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+43000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+43800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+44000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+44800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+45000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+45800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+46000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+46800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+47000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+47800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+48000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+48800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+49000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+49800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+4A000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+4A800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+4B000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+4B800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+4C000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+4C800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+4D000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+4D800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+4E000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+4E800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+4F000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+4F800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+50000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+50800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+51000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+51800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+52000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+52800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+53000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+53800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+54000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+54800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+55000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+55800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+56000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+56800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+57000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+57800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+58000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+58800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+59000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+59800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+5A000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+5A800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+5B000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+5B800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+5C000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+5C800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+5D000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+5D800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+5E000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+5E800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+5F000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+5F800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+60000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+60800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+61000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+61800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+62000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+62800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+63000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+63800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+64000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+64800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+65000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+65800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+66000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+66800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+67000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+67800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+68000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+68800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+69000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+69800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+6A000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+6A800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+6B000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+6B800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+6C000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+6C800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+6D000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+6D800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+6E000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+6E800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+6F000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+6F800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+70000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+70800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+71000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+71800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+72000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+72800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+73000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+73800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+74000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+74800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+75000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+75800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+76000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+76800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+77000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+77800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+78000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+78800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+79000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+79800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+7A000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+7A800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+7B000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+7B800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+7C000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+7C800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+7D000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+7D800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+7E000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+7E800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+7F000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+7F800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+80000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+80800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+81000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+81800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+82000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+82800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+83000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+83800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+84000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+84800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+85000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+85800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+86000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+86800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+87000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+87800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+88000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+88800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+89000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+89800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+8A000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+8A800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+8B000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+8B800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+8C000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+8C800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+8D000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+8D800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+8E000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+8E800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+8F000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+8F800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+90000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+90800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+91000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+91800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+92000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+92800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+93000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+93800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+94000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+94800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+95000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+95800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+96000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+96800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+97000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+97800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+98000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+98800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+99000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+99800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+9A000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+9A800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+9B000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+9B800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+9C000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+9C800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+9D000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+9D800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+9E000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+9E800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+9F000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+9F800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A0000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A0800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A1000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A1800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A2000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A2800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A3000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A3800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A4000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A4800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A5000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A5800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A6000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A6800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A7000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A7800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A8000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A8800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A9000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A9800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+AA000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+AA800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+AB000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+AB800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+AC000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+AC800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+AD000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+AD800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+AE000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+AE800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+AF000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+AF800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B0000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B0800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B1000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B1800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B2000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B2800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B3000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B3800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B4000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B4800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B5000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B5800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B6000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B6800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B7000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B7800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B8000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B8800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B9000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B9800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+BA000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+BA800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+BB000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+BB800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+BC000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+BC800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+BD000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+BD800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+BE000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+BE800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+BF000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+BF800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C0000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C0800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C1000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C1800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C2000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C2800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C3000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C3800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C4000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C4800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C5000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C5800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C6000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C6800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C7000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C7800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C8000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C8800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C9000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C9800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+CA000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+CA800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+CB000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+CB800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+CC000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+CC800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+CD000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+CD800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+CE000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+CE800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+CF000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+CF800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D0000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D0800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D1000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D1800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D2000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D2800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D3000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D3800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D4000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D4800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D5000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D5800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D6000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D6800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D7000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D7800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D8000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D8800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D9000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D9800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+DA000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+DA800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+DB000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+DB800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+DC000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+DC800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+DD000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+DD800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+DE000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+DE800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+DF000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+DF800 */ -262,263,264,265,263,263,263,263,263,263,263,263,263,263,263,263, /* U+E0000 */ -263,263,263,263,263,263,263,263,263,263,263,263,263,263,263,263, /* U+E0800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E1000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E1800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E2000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E2800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E3000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E3800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E4000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E4800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E5000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E5800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E6000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E6800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E7000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E7800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E8000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E8800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E9000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E9800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+EA000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+EA800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+EB000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+EB800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+EC000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+EC800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+ED000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+ED800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+EE000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+EE800 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+EF000 */ -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+EF800 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F0000 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F0800 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F1000 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F1800 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F2000 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F2800 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F3000 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F3800 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F4000 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F4800 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F5000 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F5800 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F6000 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F6800 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F7000 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F7800 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F8000 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F8800 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F9000 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F9800 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+FA000 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+FA800 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+FB000 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+FB800 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+FC000 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+FC800 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+FD000 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+FD800 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+FE000 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+FE800 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+FF000 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,266, /* U+FF800 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+100000 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+100800 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+101000 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+101800 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+102000 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+102800 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+103000 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+103800 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+104000 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+104800 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+105000 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+105800 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+106000 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+106800 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+107000 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+107800 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+108000 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+108800 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+109000 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+109800 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+10A000 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+10A800 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+10B000 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+10B800 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+10C000 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+10C800 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+10D000 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+10D800 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+10E000 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+10E800 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+10F000 */ -125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,266, /* U+10F800 */ + 90, 91, 92, 93, 94, 95, 96, 97, 98, 98, 98, 98, 98, 98, 98, 98, /* U+3000 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+3800 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+4000 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 99, 98, 98, 98, 98, /* U+4800 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+5000 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+5800 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+6000 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+6800 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+7000 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+7800 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+8000 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+8800 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+9000 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,100, /* U+9800 */ +101,102,102,102,102,102,102,102,102,103,104,104,105,106,107,108, /* U+A000 */ +109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,117, /* U+A800 */ +118,119,120,121,122,123,117,118,119,120,121,122,123,117,118,119, /* U+B000 */ +120,121,122,123,117,118,119,120,121,122,123,117,118,119,120,121, /* U+B800 */ +122,123,117,118,119,120,121,122,123,117,118,119,120,121,122,123, /* U+C000 */ +117,118,119,120,121,122,123,117,118,119,120,121,122,123,117,118, /* U+C800 */ +119,120,121,122,123,117,118,119,120,121,122,123,117,118,119,124, /* U+D000 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+D800 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+E000 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+E800 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F000 */ +126,126, 98, 98,127,128,129,130,131,131,132,133,134,135,136,137, /* U+F800 */ +138,139,140,141,142,143,144,145,146,147,148,142,149,149,150,142, /* U+10000 */ +151,152,153,154,155,156,157,158,159,160,161,142,162,142,163,142, /* U+10800 */ +164,165,166,167,168,169,170,142,171,172,142,173,174,175,176,142, /* U+11000 */ +177,178,142,142,179,180,142,142,181,182,183,184,142,185,142,142, /* U+11800 */ +186,186,186,186,186,186,186,187,188,186,189,142,142,142,142,142, /* U+12000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+12800 */ +190,190,190,190,190,190,190,190,191,142,142,142,142,142,142,142, /* U+13000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+13800 */ +142,142,142,142,142,142,142,142,192,192,192,192,193,142,142,142, /* U+14000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+14800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+15000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+15800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+16000 */ +194,194,194,194,195,196,197,198,142,142,142,142,199,200,201,202, /* U+16800 */ +203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203, /* U+17000 */ +203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203, /* U+17800 */ +203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,204, /* U+18000 */ +203,203,203,203,203,205,142,142,142,142,142,142,142,142,142,142, /* U+18800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+19000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+19800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+1A000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+1A800 */ +206,207,208,209,209,210,142,142,142,142,142,142,142,142,142,142, /* U+1B000 */ +142,142,142,142,142,142,142,142,211,212,142,142,142,142,142,142, /* U+1B800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+1C000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+1C800 */ + 71,213,214,215,216,217,218,142,219,220,221,222,223,224,225,226, /* U+1D000 */ +227,227,227,227,228,229,142,142,142,142,142,142,142,142,142,142, /* U+1D800 */ +230,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+1E000 */ +231,232,233,142,142,142,142,142,234,235,142,142,236,237,142,142, /* U+1E800 */ +238,239,240,241,242,243,244,245,244,244,246,244,247,248,249,250, /* U+1F000 */ +251,252,253,254,255,243,243,243,243,243,243,243,243,243,243,256, /* U+1F800 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+20000 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+20800 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+21000 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+21800 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+22000 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+22800 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+23000 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+23800 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+24000 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+24800 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+25000 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+25800 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+26000 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+26800 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+27000 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+27800 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+28000 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+28800 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+29000 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+29800 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,257, 98, 98, /* U+2A000 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+2A800 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,258, 98, /* U+2B000 */ +259, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+2B800 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+2C000 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,260, 98, 98, /* U+2C800 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+2D000 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+2D800 */ + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+2E000 */ + 98, 98, 98, 98, 98, 98, 98,261,142,142,142,142,142,142,142,142, /* U+2E800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+2F000 */ + 98, 98, 98, 98,262,142,142,142,142,142,142,142,142,142,142,142, /* U+2F800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+30000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+30800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+31000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+31800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+32000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+32800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+33000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+33800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+34000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+34800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+35000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+35800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+36000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+36800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+37000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+37800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+38000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+38800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+39000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+39800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+3A000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+3A800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+3B000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+3B800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+3C000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+3C800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+3D000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+3D800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+3E000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+3E800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+3F000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+3F800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+40000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+40800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+41000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+41800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+42000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+42800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+43000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+43800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+44000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+44800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+45000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+45800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+46000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+46800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+47000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+47800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+48000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+48800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+49000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+49800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+4A000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+4A800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+4B000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+4B800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+4C000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+4C800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+4D000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+4D800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+4E000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+4E800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+4F000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+4F800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+50000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+50800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+51000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+51800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+52000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+52800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+53000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+53800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+54000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+54800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+55000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+55800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+56000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+56800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+57000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+57800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+58000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+58800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+59000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+59800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+5A000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+5A800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+5B000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+5B800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+5C000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+5C800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+5D000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+5D800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+5E000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+5E800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+5F000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+5F800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+60000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+60800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+61000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+61800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+62000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+62800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+63000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+63800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+64000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+64800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+65000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+65800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+66000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+66800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+67000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+67800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+68000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+68800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+69000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+69800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+6A000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+6A800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+6B000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+6B800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+6C000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+6C800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+6D000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+6D800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+6E000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+6E800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+6F000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+6F800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+70000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+70800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+71000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+71800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+72000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+72800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+73000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+73800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+74000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+74800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+75000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+75800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+76000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+76800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+77000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+77800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+78000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+78800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+79000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+79800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+7A000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+7A800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+7B000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+7B800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+7C000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+7C800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+7D000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+7D800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+7E000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+7E800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+7F000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+7F800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+80000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+80800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+81000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+81800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+82000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+82800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+83000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+83800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+84000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+84800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+85000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+85800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+86000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+86800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+87000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+87800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+88000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+88800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+89000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+89800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+8A000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+8A800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+8B000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+8B800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+8C000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+8C800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+8D000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+8D800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+8E000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+8E800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+8F000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+8F800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+90000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+90800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+91000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+91800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+92000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+92800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+93000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+93800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+94000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+94800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+95000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+95800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+96000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+96800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+97000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+97800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+98000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+98800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+99000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+99800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+9A000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+9A800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+9B000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+9B800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+9C000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+9C800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+9D000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+9D800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+9E000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+9E800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+9F000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+9F800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A0000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A0800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A1000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A1800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A2000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A2800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A3000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A3800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A4000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A4800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A5000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A5800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A6000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A6800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A7000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A7800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A8000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A8800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A9000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A9800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+AA000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+AA800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+AB000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+AB800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+AC000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+AC800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+AD000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+AD800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+AE000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+AE800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+AF000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+AF800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B0000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B0800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B1000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B1800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B2000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B2800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B3000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B3800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B4000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B4800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B5000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B5800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B6000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B6800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B7000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B7800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B8000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B8800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B9000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B9800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+BA000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+BA800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+BB000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+BB800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+BC000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+BC800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+BD000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+BD800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+BE000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+BE800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+BF000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+BF800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C0000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C0800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C1000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C1800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C2000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C2800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C3000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C3800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C4000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C4800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C5000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C5800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C6000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C6800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C7000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C7800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C8000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C8800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C9000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C9800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+CA000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+CA800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+CB000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+CB800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+CC000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+CC800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+CD000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+CD800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+CE000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+CE800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+CF000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+CF800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D0000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D0800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D1000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D1800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D2000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D2800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D3000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D3800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D4000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D4800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D5000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D5800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D6000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D6800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D7000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D7800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D8000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D8800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D9000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D9800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+DA000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+DA800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+DB000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+DB800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+DC000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+DC800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+DD000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+DD800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+DE000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+DE800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+DF000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+DF800 */ +263,264,265,266,264,264,264,264,264,264,264,264,264,264,264,264, /* U+E0000 */ +264,264,264,264,264,264,264,264,264,264,264,264,264,264,264,264, /* U+E0800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+E1000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+E1800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+E2000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+E2800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+E3000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+E3800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+E4000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+E4800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+E5000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+E5800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+E6000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+E6800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+E7000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+E7800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+E8000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+E8800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+E9000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+E9800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+EA000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+EA800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+EB000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+EB800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+EC000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+EC800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+ED000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+ED800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+EE000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+EE800 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+EF000 */ +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+EF800 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F0000 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F0800 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F1000 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F1800 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F2000 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F2800 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F3000 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F3800 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F4000 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F4800 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F5000 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F5800 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F6000 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F6800 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F7000 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F7800 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F8000 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F8800 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F9000 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F9800 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+FA000 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+FA800 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+FB000 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+FB800 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+FC000 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+FC800 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+FD000 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+FD800 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+FE000 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+FE800 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+FF000 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,267, /* U+FF800 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+100000 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+100800 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+101000 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+101800 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+102000 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+102800 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+103000 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+103800 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+104000 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+104800 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+105000 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+105800 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+106000 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+106800 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+107000 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+107800 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+108000 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+108800 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+109000 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+109800 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+10A000 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+10A800 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+10B000 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+10B800 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+10C000 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+10C800 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+10D000 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+10D800 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+10E000 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+10E800 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+10F000 */ +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,267, /* U+10F800 */ }; -const uint16_t PRIV(ucd_stage2)[] = { /* 68352 bytes, block = 128 */ +const uint16_t PRIV(ucd_stage2)[] = { /* 68608 bytes, block = 128 */ /* block 0 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 3, 4, 4, 4, 5, 4, 4, 4, 6, 7, 4, 8, 4, 9, 4, 4, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 4, 4, 8, 8, 8, 4, - 4, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 11, 11, 11, 11, - 11, 11, 11, 13, 11, 11, 11, 11, 11, 11, 11, 6, 4, 7, 14, 15, - 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 16, 16, 16, 16, - 16, 16, 16, 18, 16, 16, 16, 16, 16, 16, 16, 6, 8, 7, 8, 0, + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 3, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 4, 5, 5, 5, 6, 5, 5, 5, 7, 8, 5, 9, 5, 10, 5, 5, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 5, 5, 9, 9, 9, 5, + 5, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 12, 12, 12, 12, + 12, 12, 12, 14, 12, 12, 12, 12, 12, 12, 12, 7, 5, 8, 15, 16, + 15, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 18, 17, 17, 17, 17, + 17, 17, 17, 19, 17, 17, 17, 17, 17, 17, 17, 7, 9, 8, 9, 1, /* block 1 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 3, 4, 5, 5, 5, 5, 19, 4, 14, 20, 21, 22, 8, 23, 20, 14, - 19, 8, 24, 24, 14, 25, 4, 4, 14, 24, 21, 26, 24, 24, 24, 4, - 11, 11, 11, 11, 11, 27, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 8, 11, 11, 11, 11, 11, 11, 11, 28, - 16, 16, 16, 16, 16, 29, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 8, 16, 16, 16, 16, 16, 16, 16, 30, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 4, 5, 6, 6, 6, 6, 20, 5, 15, 21, 22, 23, 9, 24, 21, 15, + 20, 9, 25, 25, 15, 26, 5, 5, 15, 25, 22, 27, 25, 25, 25, 5, + 12, 12, 12, 12, 12, 28, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 9, 12, 12, 12, 12, 12, 12, 12, 29, + 17, 17, 17, 17, 17, 30, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 9, 17, 17, 17, 17, 17, 17, 17, 31, /* block 2 */ - 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, - 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, - 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, - 33, 34, 31, 32, 31, 32, 31, 32, 34, 31, 32, 31, 32, 31, 32, 31, - 32, 31, 32, 31, 32, 31, 32, 31, 32, 34, 31, 32, 31, 32, 31, 32, - 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, - 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, - 31, 32, 31, 32, 31, 32, 31, 32, 35, 31, 32, 31, 32, 31, 32, 36, + 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, + 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, + 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, + 34, 35, 32, 33, 32, 33, 32, 33, 35, 32, 33, 32, 33, 32, 33, 32, + 33, 32, 33, 32, 33, 32, 33, 32, 33, 35, 32, 33, 32, 33, 32, 33, + 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, + 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, + 32, 33, 32, 33, 32, 33, 32, 33, 36, 32, 33, 32, 33, 32, 33, 37, /* block 3 */ - 37, 38, 31, 32, 31, 32, 39, 31, 32, 40, 40, 31, 32, 34, 41, 42, - 43, 31, 32, 40, 44, 45, 46, 47, 31, 32, 48, 34, 46, 49, 50, 51, - 31, 32, 31, 32, 31, 32, 52, 31, 32, 52, 34, 34, 31, 32, 52, 31, - 32, 53, 53, 31, 32, 31, 32, 54, 31, 32, 34, 21, 31, 32, 34, 55, - 21, 21, 21, 21, 56, 57, 58, 59, 60, 61, 62, 63, 64, 31, 32, 31, - 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 65, 31, 32, - 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, - 34, 66, 67, 68, 31, 32, 69, 70, 31, 32, 31, 32, 31, 32, 31, 32, + 38, 39, 32, 33, 32, 33, 40, 32, 33, 41, 41, 32, 33, 35, 42, 43, + 44, 32, 33, 41, 45, 46, 47, 48, 32, 33, 49, 35, 47, 50, 51, 52, + 32, 33, 32, 33, 32, 33, 53, 32, 33, 53, 35, 35, 32, 33, 53, 32, + 33, 54, 54, 32, 33, 32, 33, 55, 32, 33, 35, 22, 32, 33, 35, 56, + 22, 22, 22, 22, 57, 58, 59, 60, 61, 62, 63, 64, 65, 32, 33, 32, + 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 66, 32, 33, + 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, + 35, 67, 68, 69, 32, 33, 70, 71, 32, 33, 32, 33, 32, 33, 32, 33, /* block 4 */ - 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, - 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, - 71, 34, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, - 31, 32, 31, 32, 34, 34, 34, 34, 34, 34, 72, 31, 32, 73, 74, 75, - 75, 31, 32, 76, 77, 78, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, - 79, 80, 81, 82, 83, 34, 84, 84, 34, 85, 34, 86, 87, 34, 34, 34, - 84, 88, 34, 89, 34, 90, 91, 34, 92, 93, 91, 94, 95, 34, 34, 93, - 34, 96, 97, 34, 34, 98, 34, 34, 34, 34, 34, 34, 34, 99, 34, 34, + 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, + 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, + 72, 35, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, + 32, 33, 32, 33, 35, 35, 35, 35, 35, 35, 73, 32, 33, 74, 75, 76, + 76, 32, 33, 77, 78, 79, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, + 80, 81, 82, 83, 84, 35, 85, 85, 35, 86, 35, 87, 88, 35, 35, 35, + 85, 89, 35, 90, 35, 91, 92, 35, 93, 94, 92, 95, 96, 35, 35, 94, + 35, 97, 98, 35, 35, 99, 35, 35, 35, 35, 35, 35, 35,100, 35, 35, /* block 5 */ -100, 34, 34,100, 34, 34, 34,101,100,102,103,103,104, 34, 34, 34, - 34, 34,105, 34, 21, 34, 34, 34, 34, 34, 34, 34, 34,106,107, 34, - 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, -108,108,108,108,108,108,108,108,108,109,109,109,109,109,109,109, -109,109, 14, 14, 14, 14,109,109,109,109,109,109,109,109,109,109, -109,109, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, -108,108,108,108,108, 14, 14, 14, 14, 14,110,110,109, 14,109, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, +101, 35, 35,101, 35, 35, 35,102,101,103,104,104,105, 35, 35, 35, + 35, 35,106, 35, 22, 35, 35, 35, 35, 35, 35, 35, 35,107,108, 35, + 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, +109,109,109,109,109,109,109,109,109,110,110,110,110,110,110,110, +110,110, 15, 15, 15, 15,110,110,110,110,110,110,110,110,110,110, +110,110, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, +109,109,109,109,109, 15, 15, 15, 15, 15,111,111,110, 15,110, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, /* block 6 */ -111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, -111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, -111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, -111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, -111,111,111,111,111,112,111,111,111,111,111,111,111,111,111,111, -111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, -111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, -113,114,113,114,109,115,113,114,116,116,117,118,118,118, 4,119, +112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112, +112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112, +112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112, +112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112, +112,112,113,112,112,114,112,112,112,112,112,112,112,112,112,112, +112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112, +112,112,112,115,115,115,115,115,115,115,115,115,115,115,115,115, +116,117,116,117,110,118,116,117,119,119,120,121,121,121, 5,122, /* block 7 */ -116,116,116,116,115, 14,120, 4,121,121,121,116,122,116,123,123, -124,125,126,125,125,127,125,125,128,129,130,125,131,125,125,125, -132,133,116,134,125,125,135,125,125,136,125,125,137,138,138,138, -124,139,140,139,139,141,139,139,142,143,144,139,145,139,139,139, -146,147,148,149,139,139,150,139,139,151,139,139,152,153,153,154, -155,156,157,157,157,158,159,160,113,114,113,114,113,114,113,114, -113,114,161,162,161,162,161,162,161,162,161,162,161,162,161,162, -163,164,165,166,167,168,169,113,114,170,113,114,124,171,171,171, +119,119,119,119,118, 15,123, 5,124,124,124,119,125,119,126,126, +127,128,129,128,128,130,128,128,131,132,133,128,134,128,128,128, +135,136,119,137,128,128,138,128,128,139,128,128,140,141,141,141, +127,142,143,142,142,144,142,142,145,146,147,142,148,142,142,142, +149,150,151,152,142,142,153,142,142,154,142,142,155,156,156,157, +158,159,160,160,160,161,162,163,116,117,116,117,116,117,116,117, +116,117,164,165,164,165,164,165,164,165,164,165,164,165,164,165, +166,167,168,169,170,171,172,116,117,173,116,117,127,174,174,174, /* block 8 */ -172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172, -173,173,174,173,175,173,173,173,173,173,173,173,173,173,176,173, -173,177,178,173,173,173,173,173,173,173,179,173,173,173,173,173, -180,180,181,180,182,180,180,180,180,180,180,180,180,180,183,180, -180,184,185,180,180,180,180,180,180,180,186,180,180,180,180,180, -187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187, -188,189,190,191,188,189,188,189,188,189,188,189,188,189,188,189, -188,189,188,189,188,189,188,189,188,189,188,189,188,189,188,189, +175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175, +176,176,177,176,178,176,176,176,176,176,176,176,176,176,179,176, +176,180,181,176,176,176,176,176,176,176,182,176,176,176,176,176, +183,183,184,183,185,183,183,183,183,183,183,183,183,183,186,183, +183,187,188,183,183,183,183,183,183,183,189,183,183,183,183,183, +190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190, +191,192,193,194,191,192,191,192,191,192,191,192,191,192,191,192, +191,192,191,192,191,192,191,192,191,192,191,192,191,192,191,192, /* block 9 */ -188,189,192,193,193,111,111,193,194,194,188,189,188,189,188,189, -188,189,188,189,188,189,188,189,188,189,188,189,188,189,188,189, -188,189,188,189,188,189,188,189,188,189,188,189,188,189,188,189, -188,189,188,189,188,189,188,189,188,189,188,189,188,189,188,189, -195,188,189,188,189,188,189,188,189,188,189,188,189,188,189,196, -188,189,188,189,188,189,188,189,188,189,188,189,188,189,188,189, -188,189,188,189,188,189,188,189,188,189,188,189,188,189,188,189, -188,189,188,189,188,189,188,189,188,189,188,189,188,189,188,189, +191,192,195,196,197,198,198,197,199,199,191,192,191,192,191,192, +191,192,191,192,191,192,191,192,191,192,191,192,191,192,191,192, +191,192,191,192,191,192,191,192,191,192,191,192,191,192,191,192, +191,192,191,192,191,192,191,192,191,192,191,192,191,192,191,192, +200,191,192,191,192,191,192,191,192,191,192,191,192,191,192,201, +191,192,191,192,191,192,191,192,191,192,191,192,191,192,191,192, +191,192,191,192,191,192,191,192,191,192,191,192,191,192,191,192, +191,192,191,192,191,192,191,192,191,192,191,192,191,192,191,192, /* block 10 */ -188,189,188,189,188,189,188,189,188,189,188,189,188,189,188,189, -188,189,188,189,188,189,188,189,188,189,188,189,188,189,188,189, -188,189,188,189,188,189,188,189,188,189,188,189,188,189,188,189, -116,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197, -197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197, -197,197,197,197,197,197,197,116,116,198,199,199,199,199,199,199, -200,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201, -201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201, +191,192,191,192,191,192,191,192,191,192,191,192,191,192,191,192, +191,192,191,192,191,192,191,192,191,192,191,192,191,192,191,192, +191,192,191,192,191,192,191,192,191,192,191,192,191,192,191,192, +119,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202, +202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202, +202,202,202,202,202,202,202,119,119,203,204,204,204,204,204,204, +205,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206, +206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206, /* block 11 */ -201,201,201,201,201,201,201,200,200, 4,202,116,116,203,203,204, -116,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205, -205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205, -205,205,205,205,205,205,205,205,205,205,205,205,205,205,206,205, -207,205,205,207,205,205,207,205,116,116,116,116,116,116,116,116, -208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208, -208,208,208,208,208,208,208,208,208,208,208,116,116,116,116,208, -208,208,208,207,207,116,116,116,116,116,116,116,116,116,116,116, +206,206,206,206,206,206,206,205,205,207,208,119,119,209,209,210, +119,211,211,211,211,211,211,211,211,211,211,211,211,211,211,211, +211,211,211,211,211,211,211,211,211,211,211,211,211,211,211,211, +211,211,211,211,211,211,211,211,211,211,211,211,211,211,212,211, +213,211,211,213,211,211,213,211,119,119,119,119,119,119,119,119, +214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214, +214,214,214,214,214,214,214,214,214,214,214,119,119,119,119,214, +214,214,214,213,213,119,119,119,119,119,119,119,119,119,119,119, /* block 12 */ -209,209,209,209,209,210,211,211,211,212,212,213, 4,212,214,214, -215,215,215,215,215,215,215,215,215,215,215, 4,216,116,212, 4, -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -109,217,217,217,217,217,217,217,217,217,217,111,111,111,111,111, -111,111,111,111,111,111,215,215,215,215,215,215,215,215,215,215, -218,218,218,218,218,218,218,218,218,218,212,212,212,212,217,217, -111,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +215,215,215,215,215,216,217,217,217,218,218,219,220,218,221,221, +222,222,222,222,222,222,222,222,222,222,222,220,223,119,218,220, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +225,224,224,224,224,224,224,224,224,224,224,226,226,226,226,226, +226,226,226,226,226,226,222,222,222,222,222,222,222,222,222,222, +227,227,227,227,227,227,227,227,227,227,218,218,218,218,224,224, +226,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, /* block 13 */ -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -217,217,217,217,212,217,215,215,215,215,215,215,215,210,214,215, -215,215,215,215,215,219,219,215,215,214,215,215,215,215,217,217, -218,218,218,218,218,218,218,218,218,218,217,217,217,214,214,217, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +224,224,224,224,228,224,222,222,222,222,222,222,222,216,221,222, +222,222,222,222,222,229,229,222,222,221,222,222,222,222,224,224, +230,230,230,230,230,230,230,230,230,230,224,224,224,221,221,224, /* block 14 */ -220,220,220,220,220,220,220,220,220,220,220,220,220,220,116,221, -222,223,222,222,222,222,222,222,222,222,222,222,222,222,222,222, -222,222,222,222,222,222,222,222,222,222,222,222,222,222,222,222, -223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223, -223,223,223,223,223,223,223,223,223,223,223,116,116,222,222,222, -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, - -/* block 15 */ +231,231,231,231,231,231,231,231,231,231,231,231,231,231,119,232, +233,234,233,233,233,233,233,233,233,233,233,233,233,233,233,233, +233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233, +234,234,234,234,234,234,234,234,234,234,234,234,234,234,234,234, +234,234,234,234,234,234,234,234,234,234,234,119,119,233,233,233, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, 224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, 224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, -224,224,224,224,224,224,225,225,225,225,225,225,225,225,225,225, -225,224,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -226,226,226,226,226,226,226,226,226,226,227,227,227,227,227,227, -227,227,227,227,227,227,227,227,227,227,227,227,227,227,227,227, -227,227,227,227,227,227,227,227,227,227,227,228,228,228,228,228, -228,228,228,228,229,229,230,231,231,231,229,116,116,228,232,232, + +/* block 15 */ +235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235, +235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235, +235,235,235,235,235,235,236,236,236,236,236,236,236,236,236,236, +236,235,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +237,237,237,237,237,237,237,237,237,237,238,238,238,238,238,238, +238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238, +238,238,238,238,238,238,238,238,238,238,238,239,239,239,239,239, +239,239,239,239,240,240,241,242,242,242,240,119,119,239,243,243, /* block 16 */ -233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233, -233,233,233,233,233,233,234,234,234,234,235,234,234,234,234,234, -234,234,234,234,235,234,234,234,235,234,234,234,234,234,116,116, -236,236,236,236,236,236,236,236,236,236,236,236,236,236,236,116, -237,237,237,237,237,237,237,237,237,237,237,237,237,237,237,237, -237,237,237,237,237,237,237,237,237,238,238,238,116,116,239,116, -222,222,222,222,222,222,222,222,222,222,222,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244, +244,244,244,244,244,244,245,245,245,245,246,245,245,245,245,245, +245,245,245,245,246,245,245,245,246,245,245,245,245,245,119,119, +247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,119, +248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248, +248,248,248,248,248,248,248,248,248,249,249,249,119,119,250,119, +233,233,233,233,233,233,233,233,233,233,233,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 17 */ -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -217,217,217,217,217,116,217,217,217,217,217,217,217,217,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,215,215,215,215,215,215,215,215,215,215,215,215,215, -215,215,210,215,215,215,215,215,215,215,215,215,215,215,215,215, -215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +224,224,224,224,224,119,224,224,224,224,224,224,224,224,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,222,222,222,222,222,222,222,222,222,222,222,222,222, +222,222,216,222,222,222,222,222,222,222,222,222,222,222,222,222, +222,222,222,222,222,222,222,222,222,222,222,222,222,222,222,222, /* block 18 */ -240,240,240,241,242,242,242,242,242,242,242,242,242,242,242,242, -242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242, -242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242, -242,242,242,242,242,242,242,242,242,242,240,241,240,242,241,241, -241,240,240,240,240,240,240,240,240,241,241,241,241,240,241,241, -242,111,111,240,240,240,240,240,242,242,242,242,242,242,242,242, -242,242,240,240, 4, 4,243,243,243,243,243,243,243,243,243,243, -244,245,242,242,242,242,242,242,242,242,242,242,242,242,242,242, +251,251,251,252,253,253,253,253,253,253,253,253,253,253,253,253, +253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, +253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, +253,253,253,253,253,253,253,253,253,253,251,252,251,253,252,252, +252,251,251,251,251,251,251,251,251,252,252,252,252,251,252,252, +253,254,255,251,251,251,251,251,253,253,253,253,253,253,253,253, +253,253,251,251,256,257,258,258,258,258,258,258,258,258,258,258, +259,260,253,253,253,253,253,253,253,253,253,253,253,253,253,253, /* block 19 */ -246,247,248,248,116,246,246,246,246,246,246,246,246,116,116,246, -246,116,116,246,246,246,246,246,246,246,246,246,246,246,246,246, -246,246,246,246,246,246,246,246,246,116,246,246,246,246,246,246, -246,116,246,116,116,116,246,246,246,246,116,116,247,246,249,248, -248,247,247,247,247,116,116,248,248,116,116,248,248,247,246,116, -116,116,116,116,116,116,116,249,116,116,116,116,246,246,116,246, -246,246,247,247,116,116,250,250,250,250,250,250,250,250,250,250, -246,246,251,251,252,252,252,252,252,252,253,251,246,254,247,116, +261,262,263,263,119,261,261,261,261,261,261,261,261,119,119,261, +261,119,119,261,261,261,261,261,261,261,261,261,261,261,261,261, +261,261,261,261,261,261,261,261,261,119,261,261,261,261,261,261, +261,119,261,119,119,119,261,261,261,261,119,119,262,261,264,263, +263,262,262,262,262,119,119,263,263,119,119,263,263,262,261,119, +119,119,119,119,119,119,119,264,119,119,119,119,261,261,119,261, +261,261,262,262,119,119,265,265,265,265,265,265,265,265,265,265, +261,261,266,266,267,267,267,267,267,267,268,266,261,269,262,119, /* block 20 */ -116,255,255,256,116,257,257,257,257,257,257,116,116,116,116,257, -257,116,116,257,257,257,257,257,257,257,257,257,257,257,257,257, -257,257,257,257,257,257,257,257,257,116,257,257,257,257,257,257, -257,116,257,257,116,257,257,116,257,257,116,116,255,116,256,256, -256,255,255,116,116,116,116,255,255,116,116,255,255,255,116,116, -116,255,116,116,116,116,116,116,116,257,257,257,257,116,257,116, -116,116,116,116,116,116,258,258,258,258,258,258,258,258,258,258, -255,255,257,257,257,255,259,116,116,116,116,116,116,116,116,116, +119,270,270,271,119,272,272,272,272,272,272,119,119,119,119,272, +272,119,119,272,272,272,272,272,272,272,272,272,272,272,272,272, +272,272,272,272,272,272,272,272,272,119,272,272,272,272,272,272, +272,119,272,272,119,272,272,119,272,272,119,119,270,119,271,271, +271,270,270,119,119,119,119,270,270,119,119,270,270,270,119,119, +119,270,119,119,119,119,119,119,119,272,272,272,272,119,272,119, +119,119,119,119,119,119,273,273,273,273,273,273,273,273,273,273, +270,270,272,272,272,270,274,119,119,119,119,119,119,119,119,119, /* block 21 */ -116,260,260,261,116,262,262,262,262,262,262,262,262,262,116,262, -262,262,116,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,116,262,262,262,262,262,262, -262,116,262,262,116,262,262,262,262,262,116,116,260,262,261,261, -261,260,260,260,260,260,116,260,260,261,116,261,261,260,116,116, -262,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -262,262,260,260,116,116,263,263,263,263,263,263,263,263,263,263, -264,265,116,116,116,116,116,116,116,262,260,260,260,260,260,260, +119,275,275,276,119,277,277,277,277,277,277,277,277,277,119,277, +277,277,119,277,277,277,277,277,277,277,277,277,277,277,277,277, +277,277,277,277,277,277,277,277,277,119,277,277,277,277,277,277, +277,119,277,277,119,277,277,277,277,277,119,119,275,277,276,276, +276,275,275,275,275,275,119,275,275,276,119,276,276,275,119,119, +277,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +277,277,275,275,119,119,278,278,278,278,278,278,278,278,278,278, +279,280,119,119,119,119,119,119,119,277,275,275,275,275,275,275, /* block 22 */ -116,266,267,267,116,268,268,268,268,268,268,268,268,116,116,268, -268,116,116,268,268,268,268,268,268,268,268,268,268,268,268,268, -268,268,268,268,268,268,268,268,268,116,268,268,268,268,268,268, -268,116,268,268,116,268,268,268,268,268,116,116,266,268,269,266, -267,266,266,266,266,116,116,267,267,116,116,267,267,266,116,116, -116,116,116,116,116,116,266,269,116,116,116,116,268,268,116,268, -268,268,266,266,116,116,270,270,270,270,270,270,270,270,270,270, -271,268,272,272,272,272,272,272,116,116,116,116,116,116,116,116, +119,281,282,282,119,283,283,283,283,283,283,283,283,119,119,283, +283,119,119,283,283,283,283,283,283,283,283,283,283,283,283,283, +283,283,283,283,283,283,283,283,283,119,283,283,283,283,283,283, +283,119,283,283,119,283,283,283,283,283,119,119,281,283,284,281, +282,281,281,281,281,119,119,282,282,119,119,282,282,281,119,119, +119,119,119,119,119,119,281,284,119,119,119,119,283,283,119,283, +283,283,281,281,119,119,285,285,285,285,285,285,285,285,285,285, +286,283,287,287,287,287,287,287,119,119,119,119,119,119,119,119, /* block 23 */ -116,116,273,274,116,274,274,274,274,274,274,116,116,116,274,274, -274,116,274,274,274,274,116,116,116,274,274,116,274,116,274,274, -116,116,116,274,274,116,116,116,274,274,274,116,116,116,274,274, -274,274,274,274,274,274,274,274,274,274,116,116,116,116,275,276, -273,276,276,116,116,116,276,276,276,116,276,276,276,273,116,116, -274,116,116,116,116,116,116,275,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,277,277,277,277,277,277,277,277,277,277, -278,278,278,279,279,279,279,279,279,280,279,116,116,116,116,116, +119,119,288,289,119,289,289,289,289,289,289,119,119,119,289,289, +289,119,289,289,289,289,119,119,119,289,289,119,289,119,289,289, +119,119,119,289,289,119,119,119,289,289,289,119,119,119,289,289, +289,289,289,289,289,289,289,289,289,289,119,119,119,119,290,291, +288,291,291,119,119,119,291,291,291,119,291,291,291,288,119,119, +289,119,119,119,119,119,119,290,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,292,292,292,292,292,292,292,292,292,292, +293,293,293,294,295,295,295,295,295,296,295,119,119,119,119,119, /* block 24 */ -281,282,282,282,281,283,283,283,283,283,283,283,283,116,283,283, -283,116,283,283,283,283,283,283,283,283,283,283,283,283,283,283, -283,283,283,283,283,283,283,283,283,116,283,283,283,283,283,283, -283,283,283,283,283,283,283,283,283,283,116,116,116,283,281,281, -281,282,282,282,282,116,281,281,281,116,281,281,281,281,116,116, -116,116,116,116,116,281,281,116,283,283,283,116,116,116,116,116, -283,283,281,281,116,116,284,284,284,284,284,284,284,284,284,284, -116,116,116,116,116,116,116,116,285,285,285,285,285,285,285,286, +297,298,298,298,297,299,299,299,299,299,299,299,299,119,299,299, +299,119,299,299,299,299,299,299,299,299,299,299,299,299,299,299, +299,299,299,299,299,299,299,299,299,119,299,299,299,299,299,299, +299,299,299,299,299,299,299,299,299,299,119,119,119,299,297,297, +297,298,298,298,298,119,297,297,297,119,297,297,297,297,119,119, +119,119,119,119,119,297,297,119,299,299,299,119,119,119,119,119, +299,299,297,297,119,119,300,300,300,300,300,300,300,300,300,300, +119,119,119,119,119,119,119,119,301,301,301,301,301,301,301,302, /* block 25 */ -287,288,289,289,290,287,287,287,287,287,287,287,287,116,287,287, -287,116,287,287,287,287,287,287,287,287,287,287,287,287,287,287, -287,287,287,287,287,287,287,287,287,116,287,287,287,287,287,287, -287,287,287,287,116,287,287,287,287,287,116,116,288,287,289,288, -289,289,291,289,289,116,288,289,289,116,289,289,288,288,116,116, -116,116,116,116,116,291,291,116,116,116,116,116,116,116,287,116, -287,287,288,288,116,116,292,292,292,292,292,292,292,292,292,292, -116,287,287,116,116,116,116,116,116,116,116,116,116,116,116,116, +303,304,305,305,306,303,303,303,303,303,303,303,303,119,303,303, +303,119,303,303,303,303,303,303,303,303,303,303,303,303,303,303, +303,303,303,303,303,303,303,303,303,119,303,303,303,303,303,303, +303,303,303,303,119,303,303,303,303,303,119,119,304,303,305,304, +305,305,307,305,305,119,304,305,305,119,305,305,304,304,119,119, +119,119,119,119,119,307,307,119,119,119,119,119,119,119,303,119, +303,303,304,304,119,119,308,308,308,308,308,308,308,308,308,308, +119,303,303,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 26 */ -293,293,294,294,116,295,295,295,295,295,295,295,295,116,295,295, -295,116,295,295,295,295,295,295,295,295,295,295,295,295,295,295, -295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, -295,295,295,295,295,295,295,295,295,295,295,293,293,295,296,294, -294,293,293,293,293,116,294,294,294,116,294,294,294,293,297,298, -116,116,116,116,295,295,295,296,299,299,299,299,299,299,299,295, -295,295,293,293,116,116,300,300,300,300,300,300,300,300,300,300, -299,299,299,299,299,299,299,299,299,298,295,295,295,295,295,295, +309,309,310,310,119,311,311,311,311,311,311,311,311,119,311,311, +311,119,311,311,311,311,311,311,311,311,311,311,311,311,311,311, +311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311, +311,311,311,311,311,311,311,311,311,311,311,309,309,311,312,310, +310,309,309,309,309,119,310,310,310,119,310,310,310,309,313,314, +119,119,119,119,311,311,311,312,315,315,315,315,315,315,315,311, +311,311,309,309,119,119,316,316,316,316,316,316,316,316,316,316, +315,315,315,315,315,315,315,315,315,314,311,311,311,311,311,311, /* block 27 */ -116,116,301,301,116,302,302,302,302,302,302,302,302,302,302,302, -302,302,302,302,302,302,302,116,116,116,302,302,302,302,302,302, -302,302,302,302,302,302,302,302,302,302,302,302,302,302,302,302, -302,302,116,302,302,302,302,302,302,302,302,302,116,302,116,116, -302,302,302,302,302,302,302,116,116,116,303,116,116,116,116,304, -301,301,303,303,303,116,303,116,301,301,301,301,301,301,301,304, -116,116,116,116,116,116,305,305,305,305,305,305,305,305,305,305, -116,116,301,301,306,116,116,116,116,116,116,116,116,116,116,116, +119,119,317,317,119,318,318,318,318,318,318,318,318,318,318,318, +318,318,318,318,318,318,318,119,119,119,318,318,318,318,318,318, +318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,318, +318,318,119,318,318,318,318,318,318,318,318,318,119,318,119,119, +318,318,318,318,318,318,318,119,119,119,319,119,119,119,119,320, +317,317,319,319,319,119,319,119,317,317,317,317,317,317,317,320, +119,119,119,119,119,119,321,321,321,321,321,321,321,321,321,321, +119,119,317,317,322,119,119,119,119,119,119,119,119,119,119,119, /* block 28 */ -116,307,307,307,307,307,307,307,307,307,307,307,307,307,307,307, -307,307,307,307,307,307,307,307,307,307,307,307,307,307,307,307, -307,307,307,307,307,307,307,307,307,307,307,307,307,307,307,307, -307,308,307,309,308,308,308,308,308,308,308,116,116,116,116, 5, -307,307,307,307,307,307,310,308,308,308,308,308,308,308,308,311, -312,312,312,312,312,312,312,312,312,312,311,311,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +119,323,323,323,323,323,323,323,323,323,323,323,323,323,323,323, +323,323,323,323,323,323,323,323,323,323,323,323,323,323,323,323, +323,323,323,323,323,323,323,323,323,323,323,323,323,323,323,323, +323,324,323,325,324,324,324,324,324,324,324,119,119,119,119, 6, +323,323,323,323,323,323,326,324,324,324,324,324,324,324,324,327, +328,328,328,328,328,328,328,328,328,328,327,327,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 29 */ -116,313,313,116,313,116,116,313,313,116,313,116,116,313,116,116, -116,116,116,116,313,313,313,313,116,313,313,313,313,313,313,313, -116,313,313,313,116,313,116,313,116,116,313,313,116,313,313,313, -313,314,313,315,314,314,314,314,314,314,116,314,314,313,116,116, -313,313,313,313,313,116,316,116,314,314,314,314,314,314,116,116, -317,317,317,317,317,317,317,317,317,317,116,116,313,313,313,313, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +119,329,329,119,329,119,119,329,329,119,329,119,119,329,119,119, +119,119,119,119,329,329,329,329,119,329,329,329,329,329,329,329, +119,329,329,329,119,329,119,329,119,119,329,329,119,329,329,329, +329,330,329,331,330,330,330,330,330,330,119,330,330,329,119,119, +329,329,329,329,329,119,332,119,330,330,330,330,330,330,119,119, +333,333,333,333,333,333,333,333,333,333,119,119,329,329,329,329, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 30 */ -318,319,319,319,320,320,320,320,320,320,320,320,320,320,320,320, -320,320,320,319,320,319,319,319,321,321,319,319,319,319,319,319, -322,322,322,322,322,322,322,322,322,322,323,323,323,323,323,323, -323,323,323,323,319,321,319,321,319,321,324,325,324,325,326,326, -318,318,318,318,318,318,318,318,116,318,318,318,318,318,318,318, -318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,318, -318,318,318,318,318,318,318,318,318,318,318,318,318,116,116,116, -116,321,321,321,321,321,321,321,321,321,321,321,321,321,321,326, +334,335,335,335,336,336,336,336,336,336,336,336,336,336,336,336, +336,336,336,335,336,335,335,335,337,337,335,335,335,335,335,335, +338,338,338,338,338,338,338,338,338,338,339,339,339,339,339,339, +339,339,339,339,335,337,335,337,335,337,340,341,340,341,342,342, +334,334,334,334,334,334,334,334,119,334,334,334,334,334,334,334, +334,334,334,334,334,334,334,334,334,334,334,334,334,334,334,334, +334,334,334,334,334,334,334,334,334,334,334,334,334,119,119,119, +119,337,337,337,337,337,337,337,337,337,337,337,337,337,337,342, /* block 31 */ -321,321,321,321,321,320,321,321,318,318,318,318,318,321,321,321, -321,321,321,321,321,321,321,321,116,321,321,321,321,321,321,321, -321,321,321,321,321,321,321,321,321,321,321,321,321,321,321,321, -321,321,321,321,321,321,321,321,321,321,321,321,321,116,319,319, -319,319,319,319,319,319,321,319,319,319,319,319,319,116,319,319, -320,320,320,320,320, 19, 19, 19, 19,320,320,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +337,337,337,337,337,336,337,337,334,334,334,334,334,337,337,337, +337,337,337,337,337,337,337,337,119,337,337,337,337,337,337,337, +337,337,337,337,337,337,337,337,337,337,337,337,337,337,337,337, +337,337,337,337,337,337,337,337,337,337,337,337,337,119,335,335, +335,335,335,335,335,335,337,335,335,335,335,335,335,119,335,335, +336,336,336,336,336, 20, 20, 20, 20,336,336,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 32 */ -327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327, -327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327, -327,327,327,327,327,327,327,327,327,327,327,328,328,329,329,329, -329,330,329,329,329,329,329,329,328,329,329,330,330,329,329,327, -331,331,331,331,331,331,331,331,331,331,332,332,332,332,332,332, -327,327,327,327,327,327,330,330,329,329,327,327,327,327,329,329, -329,327,328,328,328,327,327,328,328,328,328,328,328,328,327,327, -327,329,329,329,329,327,327,327,327,327,327,327,327,327,327,327, +343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,343, +343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,343, +343,343,343,343,343,343,343,343,343,343,343,344,344,345,345,345, +345,346,345,345,345,345,345,345,344,345,345,346,346,345,345,343, +347,347,347,347,347,347,347,347,347,347,348,348,348,348,348,348, +343,343,343,343,343,343,346,346,345,345,343,343,343,343,345,345, +345,343,344,344,344,343,343,344,344,344,344,344,344,344,343,343, +343,345,345,345,345,343,343,343,343,343,343,343,343,343,343,343, /* block 33 */ -327,327,329,328,330,329,329,328,328,328,328,328,328,329,327,328, -331,331,331,331,331,331,331,331,331,331,328,328,328,329,333,333, -334,334,334,334,334,334,334,334,334,334,334,334,334,334,334,334, -334,334,334,334,334,334,334,334,334,334,334,334,334,334,334,334, -334,334,334,334,334,334,116,334,116,116,116,116,116,334,116,116, -335,335,335,335,335,335,335,335,335,335,335,335,335,335,335,335, -335,335,335,335,335,335,335,335,335,335,335,335,335,335,335,335, -335,335,335,335,335,335,335,335,335,335,335, 4,336,335,335,335, +343,343,345,344,346,345,345,344,344,344,344,344,344,345,343,344, +349,349,349,349,349,349,349,349,349,349,344,344,344,345,350,350, +351,351,351,351,351,351,351,351,351,351,351,351,351,351,351,351, +351,351,351,351,351,351,351,351,351,351,351,351,351,351,351,351, +351,351,351,351,351,351,119,351,119,119,119,119,119,351,119,119, +352,352,352,352,352,352,352,352,352,352,352,352,352,352,352,352, +352,352,352,352,352,352,352,352,352,352,352,352,352,352,352,352, +352,352,352,352,352,352,352,352,352,352,352,353,354,352,352,352, /* block 34 */ -337,337,337,337,337,337,337,337,337,337,337,337,337,337,337,337, -337,337,337,337,337,337,337,337,337,337,337,337,337,337,337,337, -337,337,337,337,337,337,337,337,337,337,337,337,337,337,337,337, -337,337,337,337,337,337,337,337,337,337,337,337,337,337,337,337, -337,337,337,337,337,337,337,337,337,337,337,337,337,337,337,337, -337,337,337,337,337,337,337,337,337,337,337,337,337,337,337,337, -338,338,338,338,338,338,338,338,338,338,338,338,338,338,338,338, -338,338,338,338,338,338,338,338,338,338,338,338,338,338,338,338, +355,355,355,355,355,355,355,355,355,355,355,355,355,355,355,355, +355,355,355,355,355,355,355,355,355,355,355,355,355,355,355,355, +355,355,355,355,355,355,355,355,355,355,355,355,355,355,355,355, +355,355,355,355,355,355,355,355,355,355,355,355,355,355,355,355, +355,355,355,355,355,355,355,355,355,355,355,355,355,355,355,355, +355,355,355,355,355,355,355,355,355,355,355,355,355,355,355,355, +356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,356, +356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,356, /* block 35 */ -338,338,338,338,338,338,338,338,338,338,338,338,338,338,338,338, -338,338,338,338,338,338,338,338,338,338,338,338,338,338,338,338, -338,338,338,338,338,338,338,338,339,339,339,339,339,339,339,339, -339,339,339,339,339,339,339,339,339,339,339,339,339,339,339,339, -339,339,339,339,339,339,339,339,339,339,339,339,339,339,339,339, -339,339,339,339,339,339,339,339,339,339,339,339,339,339,339,339, -339,339,339,339,339,339,339,339,339,339,339,339,339,339,339,339, -339,339,339,339,339,339,339,339,339,339,339,339,339,339,339,339, +356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,356, +356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,356, +356,356,356,356,356,356,356,356,357,357,357,357,357,357,357,357, +357,357,357,357,357,357,357,357,357,357,357,357,357,357,357,357, +357,357,357,357,357,357,357,357,357,357,357,357,357,357,357,357, +357,357,357,357,357,357,357,357,357,357,357,357,357,357,357,357, +357,357,357,357,357,357,357,357,357,357,357,357,357,357,357,357, +357,357,357,357,357,357,357,357,357,357,357,357,357,357,357,357, /* block 36 */ -340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,340, -340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,340, -340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,340, -340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,340, -340,340,340,340,340,340,340,340,340,116,340,340,340,340,116,116, -340,340,340,340,340,340,340,116,340,116,340,340,340,340,116,116, -340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,340, -340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,340, +358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358, +358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358, +358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358, +358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358, +358,358,358,358,358,358,358,358,358,119,358,358,358,358,119,119, +358,358,358,358,358,358,358,119,358,119,358,358,358,358,119,119, +358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358, +358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358, /* block 37 */ -340,340,340,340,340,340,340,340,340,116,340,340,340,340,116,116, -340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,340, -340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,340, -340,116,340,340,340,340,116,116,340,340,340,340,340,340,340,116, -340,116,340,340,340,340,116,116,340,340,340,340,340,340,340,340, -340,340,340,340,340,340,340,116,340,340,340,340,340,340,340,340, -340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,340, -340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,340, +358,358,358,358,358,358,358,358,358,119,358,358,358,358,119,119, +358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358, +358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358, +358,119,358,358,358,358,119,119,358,358,358,358,358,358,358,119, +358,119,358,358,358,358,119,119,358,358,358,358,358,358,358,358, +358,358,358,358,358,358,358,119,358,358,358,358,358,358,358,358, +358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358, +358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358, /* block 38 */ -340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,340, -340,116,340,340,340,340,116,116,340,340,340,340,340,340,340,340, -340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,340, -340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,340, -340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,340, -340,340,340,340,340,340,340,340,340,340,340,116,116,341,341,341, -342,342,342,342,342,342,342,342,342,343,343,343,343,343,343,343, -343,343,343,343,343,343,343,343,343,343,343,343,343,116,116,116, +358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358, +358,119,358,358,358,358,119,119,358,358,358,358,358,358,358,358, +358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358, +358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358, +358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358, +358,358,358,358,358,358,358,358,358,358,358,119,119,359,359,359, +360,360,360,360,360,360,360,360,360,361,361,361,361,361,361,361, +361,361,361,361,361,361,361,361,361,361,361,361,361,119,119,119, /* block 39 */ -340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,340, -344,344,344,344,344,344,344,344,344,344,116,116,116,116,116,116, -345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345, -345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345, -345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345, -345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345, -345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345, -346,346,346,346,346,346,116,116,347,347,347,347,347,347,116,116, +358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358, +362,362,362,362,362,362,362,362,362,362,119,119,119,119,119,119, +363,363,363,363,363,363,363,363,363,363,363,363,363,363,363,363, +363,363,363,363,363,363,363,363,363,363,363,363,363,363,363,363, +363,363,363,363,363,363,363,363,363,363,363,363,363,363,363,363, +363,363,363,363,363,363,363,363,363,363,363,363,363,363,363,363, +363,363,363,363,363,363,363,363,363,363,363,363,363,363,363,363, +364,364,364,364,364,364,119,119,365,365,365,365,365,365,119,119, /* block 40 */ -348,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, -349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, -349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, -349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, -349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, -349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, -349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, -349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, +366,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367, +367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367, +367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367, +367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367, +367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367, +367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367, +367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367, +367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367, /* block 41 */ -349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, -349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, -349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, -349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, -349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, -349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, -349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, -349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, +367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367, +367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367, +367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367, +367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367, +367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367, +367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367, +367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367, +367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367, /* block 42 */ -349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, -349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, -349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, -349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, -349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, -349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, -349,349,349,349,349,349,349,349,349,349,349,349,349,350,350,349, -349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, +367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367, +367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367, +367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367, +367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367, +367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367, +367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367, +367,367,367,367,367,367,367,367,367,367,367,367,367,368,368,367, +367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367, /* block 43 */ -351,352,352,352,352,352,352,352,352,352,352,352,352,352,352,352, -352,352,352,352,352,352,352,352,352,352,352,353,354,116,116,116, -355,355,355,355,355,355,355,355,355,355,355,355,355,355,355,355, -355,355,355,355,355,355,355,355,355,355,355,355,355,355,355,355, -355,355,355,355,355,355,355,355,355,355,355,355,355,355,355,355, -355,355,355,355,355,355,355,355,355,355,355,355,355,355,355,355, -355,355,355,355,355,355,355,355,355,355,355, 4, 4, 4,356,356, -356,355,355,355,355,355,355,355,355,116,116,116,116,116,116,116, +369,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370, +370,370,370,370,370,370,370,370,370,370,370,371,372,119,119,119, +373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373, +373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373, +373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373, +373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373, +373,373,373,373,373,373,373,373,373,373,373, 5, 5, 5,374,374, +374,373,373,373,373,373,373,373,373,119,119,119,119,119,119,119, /* block 44 */ -357,357,357,357,357,357,357,357,357,357,357,357,357,116,357,357, -357,357,358,358,358,116,116,116,116,116,116,116,116,116,116,116, -359,359,359,359,359,359,359,359,359,359,359,359,359,359,359,359, -359,359,360,360,360, 4, 4,116,116,116,116,116,116,116,116,116, -361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361, -361,361,362,362,116,116,116,116,116,116,116,116,116,116,116,116, -363,363,363,363,363,363,363,363,363,363,363,363,363,116,363,363, -363,116,364,364,116,116,116,116,116,116,116,116,116,116,116,116, +375,375,375,375,375,375,375,375,375,375,375,375,375,119,375,375, +375,375,376,376,376,119,119,119,119,119,119,119,119,119,119,119, +377,377,377,377,377,377,377,377,377,377,377,377,377,377,377,377, +377,377,378,378,378,379,379,119,119,119,119,119,119,119,119,119, +380,380,380,380,380,380,380,380,380,380,380,380,380,380,380,380, +380,380,381,381,119,119,119,119,119,119,119,119,119,119,119,119, +382,382,382,382,382,382,382,382,382,382,382,382,382,119,382,382, +382,119,383,383,119,119,119,119,119,119,119,119,119,119,119,119, /* block 45 */ -365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365, -365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365, -365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365, -365,365,365,365,366,366,367,366,366,366,366,366,366,366,367,367, -367,367,367,367,367,367,366,367,367,366,366,366,366,366,366,366, -366,366,366,366,368,368,368,369,368,368,368,370,365,366,116,116, -371,371,371,371,371,371,371,371,371,371,116,116,116,116,116,116, -372,372,372,372,372,372,372,372,372,372,116,116,116,116,116,116, +384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384, +384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384, +384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384, +384,384,384,384,385,385,386,385,385,385,385,385,385,385,386,386, +386,386,386,386,386,386,385,386,386,385,385,385,385,385,385,385, +385,385,385,385,387,387,387,388,387,387,387,389,384,385,119,119, +390,390,390,390,390,390,390,390,390,390,119,119,119,119,119,119, +391,391,391,391,391,391,391,391,391,391,119,119,119,119,119,119, /* block 46 */ -373,373, 4, 4,373, 4,374,373,373,373,373,375,375,375,376,116, -377,377,377,377,377,377,377,377,377,377,116,116,116,116,116,116, -378,378,378,378,378,378,378,378,378,378,378,378,378,378,378,378, -378,378,378,378,378,378,378,378,378,378,378,378,378,378,378,378, -378,378,378,379,378,378,378,378,378,378,378,378,378,378,378,378, -378,378,378,378,378,378,378,378,378,378,378,378,378,378,378,378, -378,378,378,378,378,378,378,378,378,378,378,378,378,378,378,378, -378,378,378,378,378,378,378,378,378,116,116,116,116,116,116,116, +392,392,393,393,392,393,394,392,392,392,392,395,395,395,396,119, +397,397,397,397,397,397,397,397,397,397,119,119,119,119,119,119, +398,398,398,398,398,398,398,398,398,398,398,398,398,398,398,398, +398,398,398,398,398,398,398,398,398,398,398,398,398,398,398,398, +398,398,398,399,398,398,398,398,398,398,398,398,398,398,398,398, +398,398,398,398,398,398,398,398,398,398,398,398,398,398,398,398, +398,398,398,398,398,398,398,398,398,398,398,398,398,398,398,398, +398,398,398,398,398,398,398,398,398,119,119,119,119,119,119,119, /* block 47 */ -378,378,378,378,378,375,375,378,378,378,378,378,378,378,378,378, -378,378,378,378,378,378,378,378,378,378,378,378,378,378,378,378, -378,378,378,378,378,378,378,378,378,375,378,116,116,116,116,116, -349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, -349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, -349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, -349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, -349,349,349,349,349,349,116,116,116,116,116,116,116,116,116,116, +398,398,398,398,398,395,395,398,398,398,398,398,398,398,398,398, +398,398,398,398,398,398,398,398,398,398,398,398,398,398,398,398, +398,398,398,398,398,398,398,398,398,395,398,119,119,119,119,119, +367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367, +367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367, +367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367, +367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367, +367,367,367,367,367,367,119,119,119,119,119,119,119,119,119,119, /* block 48 */ -380,380,380,380,380,380,380,380,380,380,380,380,380,380,380,380, -380,380,380,380,380,380,380,380,380,380,380,380,380,380,380,116, -381,381,381,382,382,382,382,381,381,382,382,382,116,116,116,116, -382,382,381,382,382,382,382,382,382,381,381,381,116,116,116,116, -383,116,116,116,384,384,385,385,385,385,385,385,385,385,385,385, -386,386,386,386,386,386,386,386,386,386,386,386,386,386,386,386, -386,386,386,386,386,386,386,386,386,386,386,386,386,386,116,116, -386,386,386,386,386,116,116,116,116,116,116,116,116,116,116,116, +400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400, +400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,119, +401,401,401,402,402,402,402,401,401,402,402,402,119,119,119,119, +402,402,401,402,402,402,402,402,402,401,401,401,119,119,119,119, +403,119,119,119,404,404,405,405,405,405,405,405,405,405,405,405, +406,406,406,406,406,406,406,406,406,406,406,406,406,406,406,406, +406,406,406,406,406,406,406,406,406,406,406,406,406,406,119,119, +406,406,406,406,406,119,119,119,119,119,119,119,119,119,119,119, /* block 49 */ -387,387,387,387,387,387,387,387,387,387,387,387,387,387,387,387, -387,387,387,387,387,387,387,387,387,387,387,387,387,387,387,387, -387,387,387,387,387,387,387,387,387,387,387,387,116,116,116,116, -387,387,387,387,387,387,387,387,387,387,387,387,387,387,387,387, -387,387,387,387,387,387,387,387,387,387,116,116,116,116,116,116, -388,388,388,388,388,388,388,388,388,388,389,116,116,116,390,390, -391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391, -391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391, +407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407, +407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407, +407,407,407,407,407,407,407,407,407,407,407,407,119,119,119,119, +407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407, +407,407,407,407,407,407,407,407,407,407,119,119,119,119,119,119, +408,408,408,408,408,408,408,408,408,408,409,119,119,119,410,410, +411,411,411,411,411,411,411,411,411,411,411,411,411,411,411,411, +411,411,411,411,411,411,411,411,411,411,411,411,411,411,411,411, /* block 50 */ -392,392,392,392,392,392,392,392,392,392,392,392,392,392,392,392, -392,392,392,392,392,392,392,393,393,394,394,393,116,116,395,395, -396,396,396,396,396,396,396,396,396,396,396,396,396,396,396,396, -396,396,396,396,396,396,396,396,396,396,396,396,396,396,396,396, -396,396,396,396,396,396,396,396,396,396,396,396,396,396,396,396, -396,396,396,396,396,397,398,397,398,398,398,398,398,398,398,116, -398,399,398,399,399,398,398,398,398,398,398,398,398,397,397,397, -397,397,397,398,398,398,398,398,398,398,398,398,398,116,116,398, +412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412, +412,412,412,412,412,412,412,413,413,414,414,413,119,119,415,415, +416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416, +416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416, +416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416, +416,416,416,416,416,417,418,417,418,418,418,418,418,418,418,119, +418,419,418,419,419,418,418,418,418,418,418,418,418,417,417,417, +417,417,417,418,418,418,418,418,418,418,418,418,418,119,119,418, /* block 51 */ -400,400,400,400,400,400,400,400,400,400,116,116,116,116,116,116, -400,400,400,400,400,400,400,400,400,400,116,116,116,116,116,116, -401,401,401,401,401,401,401,402,401,401,401,401,401,401,116,116, -111,111,111,111,111,111,111,111,111,111,111,111,111,111,403,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +420,420,420,420,420,420,420,420,420,420,119,119,119,119,119,119, +420,420,420,420,420,420,420,420,420,420,119,119,119,119,119,119, +421,421,421,421,421,421,421,422,421,421,421,421,421,421,119,119, +112,112,112,112,112,112,112,112,112,112,112,112,112,112,423,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 52 */ -404,404,404,404,405,406,406,406,406,406,406,406,406,406,406,406, -406,406,406,406,406,406,406,406,406,406,406,406,406,406,406,406, -406,406,406,406,406,406,406,406,406,406,406,406,406,406,406,406, -406,406,406,406,404,405,404,404,404,404,404,405,404,405,405,405, -405,405,404,405,405,406,406,406,406,406,406,406,116,116,116,116, -407,407,407,407,407,407,407,407,407,407,408,408,408,408,408,408, -408,409,409,409,409,409,409,409,409,409,409,404,404,404,404,404, -404,404,404,404,409,409,409,409,409,409,409,409,409,116,116,116, +424,424,424,424,425,426,426,426,426,426,426,426,426,426,426,426, +426,426,426,426,426,426,426,426,426,426,426,426,426,426,426,426, +426,426,426,426,426,426,426,426,426,426,426,426,426,426,426,426, +426,426,426,426,424,425,424,424,424,424,424,425,424,425,425,425, +425,425,424,425,425,426,426,426,426,426,426,426,119,119,119,119, +427,427,427,427,427,427,427,427,427,427,428,428,428,428,428,428, +428,429,429,429,429,429,429,429,429,429,429,424,424,424,424,424, +424,424,424,424,429,429,429,429,429,429,429,429,429,119,119,119, /* block 53 */ -410,410,411,412,412,412,412,412,412,412,412,412,412,412,412,412, -412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412, -412,411,410,410,410,410,411,411,410,410,411,410,410,410,412,412, -413,413,413,413,413,413,413,413,413,413,412,412,412,412,412,412, -414,414,414,414,414,414,414,414,414,414,414,414,414,414,414,414, -414,414,414,414,414,414,414,414,414,414,414,414,414,414,414,414, -414,414,414,414,414,414,415,416,415,415,416,416,416,415,416,415, -415,415,416,416,116,116,116,116,116,116,116,116,417,417,417,417, +430,430,431,432,432,432,432,432,432,432,432,432,432,432,432,432, +432,432,432,432,432,432,432,432,432,432,432,432,432,432,432,432, +432,431,430,430,430,430,431,431,430,430,431,430,430,430,432,432, +433,433,433,433,433,433,433,433,433,433,432,432,432,432,432,432, +434,434,434,434,434,434,434,434,434,434,434,434,434,434,434,434, +434,434,434,434,434,434,434,434,434,434,434,434,434,434,434,434, +434,434,434,434,434,434,435,436,435,435,436,436,436,435,436,435, +435,435,436,436,119,119,119,119,119,119,119,119,437,437,437,437, /* block 54 */ -418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418, -418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418, -418,418,418,418,419,419,419,419,419,419,419,419,420,420,420,420, -420,420,420,420,419,419,420,420,116,116,116,421,421,421,421,421, -422,422,422,422,422,422,422,422,422,422,116,116,116,418,418,418, -423,423,423,423,423,423,423,423,423,423,424,424,424,424,424,424, -424,424,424,424,424,424,424,424,424,424,424,424,424,424,424,424, -424,424,424,424,424,424,424,424,425,425,425,425,425,425,426,426, +438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,438, +438,438,438,438,438,438,438,438,438,438,438,438,438,438,438,438, +438,438,438,438,439,439,439,439,439,439,439,439,440,440,440,440, +440,440,440,440,439,439,440,440,119,119,119,441,441,441,441,441, +442,442,442,442,442,442,442,442,442,442,119,119,119,438,438,438, +443,443,443,443,443,443,443,443,443,443,444,444,444,444,444,444, +444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444, +444,444,444,444,444,444,444,444,445,445,445,445,445,445,446,446, /* block 55 */ -427,428,429,430,431,432,433,434,435,116,116,116,116,116,116,116, -436,436,436,436,436,436,436,436,436,436,436,436,436,436,436,436, -436,436,436,436,436,436,436,436,436,436,436,436,436,436,436,436, -436,436,436,436,436,436,436,436,436,436,436,116,116,436,436,436, -437,437,437,437,437,437,437,437,116,116,116,116,116,116,116,116, -111,111,111, 4,111,111,111,111,111,111,111,111,111,111,111,111, -111,438,111,111,111,111,111,111,111,439,439,439,439,111,439,439, -439,439,438,438,111,439,439,438,111,111,116,116,116,116,116,116, +447,448,449,450,451,452,453,454,455,119,119,119,119,119,119,119, +456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456, +456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456, +456,456,456,456,456,456,456,456,456,456,456,119,119,456,456,456, +457,457,457,457,457,457,457,457,119,119,119,119,119,119,119,119, +458,459,458,460,459,461,461,462,461,462,463,459,462,462,459,459, +462,464,459,459,459,459,459,459,459,465,466,465,465,461,465,465, +465,465,467,467,468,466,466,469,470,470,119,119,119,119,119,119, /* block 56 */ - 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, - 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, - 34, 34, 34, 34, 34, 34,124,124,124,124,124,440,108,108,108,108, -108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108, -108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108, -108,108,108,108,108,108,108,108,108,108,108,108,108,117,117,117, -117,117,108,108,108,108,117,117,117,117,117, 34, 34, 34, 34, 34, - 34, 34, 34, 34, 34, 34, 34, 34,441,442, 34, 34, 34,443, 34, 34, + 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, + 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, + 35, 35, 35, 35, 35, 35,127,127,127,127,127,471,109,109,109,109, +109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109, +109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109, +109,109,109,109,109,109,109,109,109,109,109,109,109,120,120,120, +120,120,109,109,109,109,120,120,120,120,120, 35, 35, 35, 35, 35, + 35, 35, 35, 35, 35, 35, 35, 35,472,473, 35, 35, 35,474, 35, 35, /* block 57 */ - 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, - 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,108,108,108,108,108, -108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108, -108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,117, -111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, -111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, -111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, -111,111,111,111,111,111,111,111,111,111,116,111,111,111,111,111, + 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, + 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,109,109,109,109,109, +109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109, +109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,120, +113,113,112,112,112,112,112,112,112,112,112,112,112,112,112,112, +112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112, +112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112, +112,112,112,112,112,112,112,112,112,112,119,112,112,112,112,112, /* block 58 */ - 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, - 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, - 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, - 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, - 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, - 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, -444,445, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, - 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, + 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, + 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, + 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, + 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, + 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, + 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, +475,476, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, + 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, /* block 59 */ - 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, - 31, 32, 31, 32, 31, 32, 34, 34, 34, 34, 34,446, 34, 34,447, 34, - 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, - 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, - 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, - 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, - 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, - 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, + 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, + 32, 33, 32, 33, 32, 33, 35, 35, 35, 35, 35,477, 35, 35,478, 35, + 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, + 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, + 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, + 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, + 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, + 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, /* block 60 */ -448,448,448,448,448,448,448,448,449,449,449,449,449,449,449,449, -448,448,448,448,448,448,116,116,449,449,449,449,449,449,116,116, -448,448,448,448,448,448,448,448,449,449,449,449,449,449,449,449, -448,448,448,448,448,448,448,448,449,449,449,449,449,449,449,449, -448,448,448,448,448,448,116,116,449,449,449,449,449,449,116,116, -124,448,124,448,124,448,124,448,116,449,116,449,116,449,116,449, -448,448,448,448,448,448,448,448,449,449,449,449,449,449,449,449, -450,450,451,451,451,451,452,452,453,453,454,454,455,455,116,116, +479,479,479,479,479,479,479,479,480,480,480,480,480,480,480,480, +479,479,479,479,479,479,119,119,480,480,480,480,480,480,119,119, +479,479,479,479,479,479,479,479,480,480,480,480,480,480,480,480, +479,479,479,479,479,479,479,479,480,480,480,480,480,480,480,480, +479,479,479,479,479,479,119,119,480,480,480,480,480,480,119,119, +127,479,127,479,127,479,127,479,119,480,119,480,119,480,119,480, +479,479,479,479,479,479,479,479,480,480,480,480,480,480,480,480, +481,481,482,482,482,482,483,483,484,484,485,485,486,486,119,119, /* block 61 */ -448,448,448,448,448,448,448,448,456,456,456,456,456,456,456,456, -448,448,448,448,448,448,448,448,456,456,456,456,456,456,456,456, -448,448,448,448,448,448,448,448,456,456,456,456,456,456,456,456, -448,448,124,457,124,116,124,124,449,449,458,458,459,115,460,115, -115,115,124,457,124,116,124,124,461,461,461,461,459,115,115,115, -448,448,124,124,116,116,124,124,449,449,462,462,116,115,115,115, -448,448,124,124,124,165,124,124,449,449,463,463,170,115,115,115, -116,116,124,457,124,116,124,124,464,464,465,465,459,115,115,116, +479,479,479,479,479,479,479,479,487,487,487,487,487,487,487,487, +479,479,479,479,479,479,479,479,487,487,487,487,487,487,487,487, +479,479,479,479,479,479,479,479,487,487,487,487,487,487,487,487, +479,479,127,488,127,119,127,127,480,480,489,489,490,118,491,118, +118,118,127,488,127,119,127,127,492,492,492,492,490,118,118,118, +479,479,127,127,119,119,127,127,480,480,493,493,119,118,118,118, +479,479,127,127,127,168,127,127,480,480,494,494,173,118,118,118, +119,119,127,488,127,119,127,127,495,495,496,496,490,118,118,119, /* block 62 */ - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 23,466,467, 23, 23, - 9, 9, 9, 9, 9, 9, 4, 4, 22, 26, 6, 22, 22, 26, 6, 22, - 4, 4, 4, 4, 4, 4, 4, 4,468,469, 23, 23, 23, 23, 23, 3, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 22, 26, 4,470, 4, 4, 15, - 15, 4, 4, 4, 8, 6, 7, 4, 4,470, 4, 4, 4, 4, 4, 4, - 4, 4, 8, 4, 15, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, - 23, 23, 23, 23, 23,471, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, - 24,108,116,116, 24, 24, 24, 24, 24, 24, 8, 8, 8, 6, 7,108, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 24,497,498, 24, 24, + 10, 10, 10, 10, 10, 10, 5, 5, 23, 27, 7, 23, 23, 27, 7, 23, + 5, 5, 5, 5, 5, 5, 5, 5,499,500, 24, 24, 24, 24, 24, 4, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 23, 27, 5,501, 5, 5, 16, + 16, 5, 5, 5, 9, 7, 8, 5, 5,501, 5, 5, 5, 5, 5, 5, + 5, 5, 9, 5, 16, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, + 24, 24, 24, 24, 24,502, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 25,109,119,119, 25, 25, 25, 25, 25, 25, 9, 9, 9, 7, 8,109, /* block 63 */ - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 8, 8, 8, 6, 7,116, -108,108,108,108,108,108,108,108,108,108,108,108,108,116,116,116, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -111,111,111,111,111,111,111,111,111,111,111,111,111,403,403,403, -403,111,403,403,403,111,111,111,111,111,111,111,111,111,111,111, -111,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 9, 9, 9, 7, 8,119, +109,109,109,109,109,109,109,109,109,109,109,109,109,119,119,119, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +112,112,112,112,112,112,112,112,112,112,112,112,112,423,423,423, +423,112,423,423,423,112,112,112,112,112,112,112,112,112,112,112, +503,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 64 */ - 19, 19,472, 19, 19, 19, 19,472, 19, 19,473,472,472,472,473,473, -472,472,472,473, 19,472, 19, 19, 8,472,472,472,472,472, 19, 19, - 19, 19, 20, 19,472, 19,474, 19,472, 19,475,476,472,472, 19,473, -472,472,477,472,473,439,439,439,439,478, 19, 19,473,473,472,472, - 8, 8, 8, 8, 8,472,473,473,473,473, 19, 8, 19, 19,479, 19, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, -481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,481, + 20, 20,504, 20, 20, 20, 20,504, 20, 20,505,504,504,504,505,505, +504,504,504,505, 20,504, 20, 20, 9,504,504,504,504,504, 20, 20, + 20, 20, 21, 20,504, 20,506, 20,504, 20,507,508,504,504, 20,505, +504,504,509,504,505,510,510,510,510,511, 20, 20,505,505,504,504, + 9, 9, 9, 9, 9,504,505,505,505,505, 20, 9, 20, 20,512, 20, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, +513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513, +514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,514, /* block 65 */ -482,482,482, 31, 32,482,482,482,482, 24, 19, 19,116,116,116,116, - 8, 8, 8, 8,483, 20, 20, 20, 20, 20, 8, 8, 19, 19, 19, 19, - 8, 19, 19, 8, 19, 19, 8, 19, 19, 20, 20, 19, 19, 19, 8, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 8, 8, - 19, 19, 8, 19, 8, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, +515,515,515, 32, 33,515,515,515,515, 25, 20, 20,119,119,119,119, + 9, 9, 9, 9,516, 21, 21, 21, 21, 21, 9, 9, 20, 20, 20, 20, + 9, 20, 20, 9, 20, 20, 9, 20, 20, 21, 21, 20, 20, 20, 9, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 9, 9, + 20, 20, 9, 20, 9, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, /* block 66 */ - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, /* block 67 */ - 19, 19, 19, 19, 19, 19, 19, 19, 6, 7, 6, 7, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 19, 19, 19, 19, - 8, 8, 19, 19, 19, 19, 19, 19, 20, 6, 7, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 8, 19, 19, 19, + 20, 20, 20, 20, 20, 20, 20, 20, 7, 8, 7, 8, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 20, 20, 20, 20, + 9, 9, 20, 20, 20, 20, 20, 20, 21, 7, 8, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 9, 20, 20, 20, /* block 68 */ - 19, 19, 19, 19, 19, 19, 19, 19, 20, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 8, 8, 8, 8, - 8, 8, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 19, 19, 19, 19, 20, 20, 20, 19, 19, 19, 19, 19, + 20, 20, 20, 20, 20, 20, 20, 20, 21, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 9, 9, 9, 9, + 9, 9, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 20, 20, 20, 20, 21, 21, 21, 20, 20, 20, 20, 20, /* block 69 */ - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, /* block 70 */ - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19,484,484,484,484,484,484,484,484,484,484, -484,484,485,484,484,484,484,484,484,484,484,484,484,484,484,484, -486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, -486,486,486,486,486,486,486,486,486,486, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20,517,517,517,517,517,517,517,517,517,517, +517,517,518,517,517,517,517,517,517,517,517,517,517,517,517,517, +519,519,519,519,519,519,519,519,519,519,519,519,519,519,519,519, +519,519,519,519,519,519,519,519,519,519, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, /* block 71 */ - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - -/* block 72 */ - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 20, 8, 19, 19, 19, 19, 19, 19, 19, 19, - 20, 8, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 8, 8, 8,483,483,483,483, 8, - -/* block 73 */ - 20, 20, 20, 20, 20, 20, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,483, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - -/* block 74 */ - 20, 20, 20, 20, 20, 20, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + +/* block 72 */ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 21, 9, 20, 20, 20, 20, 20, 20, 20, 20, + 21, 9, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 9, 9, 9,516,516,516,516, 9, + +/* block 73 */ + 21, 21, 21, 21, 21, 21, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,516, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + +/* block 74 */ + 21, 21, 21, 21, 21, 21, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, /* block 75 */ - 20, 20, 20, 20, 20, 20, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 19, 20, 19, 20, 19, 19, 19, 19, 19, 19, 20, 19, 19, - 19, 20, 19, 19, 19, 19, 19, 19, 20, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 20, 20, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 20, 19, 19, 20, 19, 19, 19, 19, 20, 19, 20, 19, - 19, 19, 19, 20, 20, 20, 19, 20, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 20, 20, 20, 20, 20, 6, 7, 6, 7, 6, 7, 6, 7, - 6, 7, 6, 7, 6, 7, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 21, 21, 21, 21, 21, 21, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 20, 21, 20, 21, 20, 20, 20, 20, 20, 20, 21, 20, 20, + 20, 21, 20, 20, 20, 20, 20, 20, 21, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 21, 21, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 21, 20, 20, 21, 20, 20, 20, 20, 21, 20, 21, 20, + 20, 20, 20, 21, 21, 21, 20, 21, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 21, 21, 21, 21, 21, 7, 8, 7, 8, 7, 8, 7, 8, + 7, 8, 7, 8, 7, 8, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, /* block 76 */ - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 19, 20, 20, 20, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 20, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 20, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, - 8, 8, 8, 8, 8, 6, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 20, 21, 21, 21, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 21, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 21, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, + 9, 9, 9, 9, 9, 7, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 7, 8, 7, 8, 7, 8, 7, 8, 7, 8, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, /* block 77 */ -487,487,487,487,487,487,487,487,487,487,487,487,487,487,487,487, -487,487,487,487,487,487,487,487,487,487,487,487,487,487,487,487, -487,487,487,487,487,487,487,487,487,487,487,487,487,487,487,487, -487,487,487,487,487,487,487,487,487,487,487,487,487,487,487,487, -487,487,487,487,487,487,487,487,487,487,487,487,487,487,487,487, -487,487,487,487,487,487,487,487,487,487,487,487,487,487,487,487, -487,487,487,487,487,487,487,487,487,487,487,487,487,487,487,487, -487,487,487,487,487,487,487,487,487,487,487,487,487,487,487,487, +520,520,520,520,520,520,520,520,520,520,520,520,520,520,520,520, +520,520,520,520,520,520,520,520,520,520,520,520,520,520,520,520, +520,520,520,520,520,520,520,520,520,520,520,520,520,520,520,520, +520,520,520,520,520,520,520,520,520,520,520,520,520,520,520,520, +520,520,520,520,520,520,520,520,520,520,520,520,520,520,520,520, +520,520,520,520,520,520,520,520,520,520,520,520,520,520,520,520, +520,520,520,520,520,520,520,520,520,520,520,520,520,520,520,520, +520,520,520,520,520,520,520,520,520,520,520,520,520,520,520,520, /* block 78 */ - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8,483,483, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9,516,516, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, /* block 79 */ - 8, 8, 8, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7, 6, - 7, 6, 7, 6, 7, 6, 7, 6, 7, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 6, 7, 6, 7, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 6, 7, 8, 8, + 9, 9, 9, 7, 8, 7, 8, 7, 8, 7, 8, 7, 8, 7, 8, 7, + 8, 7, 8, 7, 8, 7, 8, 7, 8, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 7, 8, 7, 8, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 7, 8, 9, 9, /* block 80 */ - 19, 19, 19, 19, 19, 20, 20, 20, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 19, 19, 8, 8, 8, 8, 8, 8, 19, 19, 19, - 20, 19, 19, 19, 19, 20, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19,116,116, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 20, 20, 20, 20, 20, 21, 21, 21, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 20, 20, 9, 9, 9, 9, 9, 9, 20, 20, 20, + 21, 20, 20, 20, 20, 21, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20,119,119, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, /* block 81 */ - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19,116,116, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19,116, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,116, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20,119,119, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20,119, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,119, /* block 82 */ -488,488,488,488,488,488,488,488,488,488,488,488,488,488,488,488, -488,488,488,488,488,488,488,488,488,488,488,488,488,488,488,488, -488,488,488,488,488,488,488,488,488,488,488,488,488,488,488,116, -489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, -489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, -489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,116, - 31, 32,490,491,492,493,494, 31, 32, 31, 32, 31, 32,495,496,497, -498, 34, 31, 32, 34, 31, 32, 34, 34, 34, 34, 34,108,108,499,499, +521,521,521,521,521,521,521,521,521,521,521,521,521,521,521,521, +521,521,521,521,521,521,521,521,521,521,521,521,521,521,521,521, +521,521,521,521,521,521,521,521,521,521,521,521,521,521,521,119, +522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522, +522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522, +522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,119, + 32, 33,523,524,525,526,527, 32, 33, 32, 33, 32, 33,528,529,530, +531, 35, 32, 33, 35, 32, 33, 35, 35, 35, 35, 35,109,109,532,532, /* block 83 */ -161,162,161,162,161,162,161,162,161,162,161,162,161,162,161,162, -161,162,161,162,161,162,161,162,161,162,161,162,161,162,161,162, -161,162,161,162,161,162,161,162,161,162,161,162,161,162,161,162, -161,162,161,162,161,162,161,162,161,162,161,162,161,162,161,162, -161,162,161,162,161,162,161,162,161,162,161,162,161,162,161,162, -161,162,161,162,161,162,161,162,161,162,161,162,161,162,161,162, -161,162,161,162,500,501,501,501,501,501,501,161,162,161,162,502, -502,502,161,162,116,116,116,116,116,503,503,503,503,504,503,503, +164,165,164,165,164,165,164,165,164,165,164,165,164,165,164,165, +164,165,164,165,164,165,164,165,164,165,164,165,164,165,164,165, +164,165,164,165,164,165,164,165,164,165,164,165,164,165,164,165, +164,165,164,165,164,165,164,165,164,165,164,165,164,165,164,165, +164,165,164,165,164,165,164,165,164,165,164,165,164,165,164,165, +164,165,164,165,164,165,164,165,164,165,164,165,164,165,164,165, +164,165,164,165,533,534,534,534,534,534,534,164,165,164,165,535, +535,535,164,165,119,119,119,119,119,536,536,536,536,537,536,536, /* block 84 */ -505,505,505,505,505,505,505,505,505,505,505,505,505,505,505,505, -505,505,505,505,505,505,505,505,505,505,505,505,505,505,505,505, -505,505,505,505,505,505,116,505,116,116,116,116,116,505,116,116, -506,506,506,506,506,506,506,506,506,506,506,506,506,506,506,506, -506,506,506,506,506,506,506,506,506,506,506,506,506,506,506,506, -506,506,506,506,506,506,506,506,506,506,506,506,506,506,506,506, -506,506,506,506,506,506,506,506,116,116,116,116,116,116,116,507, -508,116,116,116,116,116,116,116,116,116,116,116,116,116,116,509, +538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538, +538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538, +538,538,538,538,538,538,119,538,119,119,119,119,119,538,119,119, +539,539,539,539,539,539,539,539,539,539,539,539,539,539,539,539, +539,539,539,539,539,539,539,539,539,539,539,539,539,539,539,539, +539,539,539,539,539,539,539,539,539,539,539,539,539,539,539,539, +539,539,539,539,539,539,539,539,119,119,119,119,119,119,119,540, +541,119,119,119,119,119,119,119,119,119,119,119,119,119,119,542, /* block 85 */ -340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,340, -340,340,340,340,340,340,340,116,116,116,116,116,116,116,116,116, -340,340,340,340,340,340,340,116,340,340,340,340,340,340,340,116, -340,340,340,340,340,340,340,116,340,340,340,340,340,340,340,116, -340,340,340,340,340,340,340,116,340,340,340,340,340,340,340,116, -340,340,340,340,340,340,340,116,340,340,340,340,340,340,340,116, -193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193, -193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193, +358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358, +358,358,358,358,358,358,358,119,119,119,119,119,119,119,119,119, +358,358,358,358,358,358,358,119,358,358,358,358,358,358,358,119, +358,358,358,358,358,358,358,119,358,358,358,358,358,358,358,119, +358,358,358,358,358,358,358,119,358,358,358,358,358,358,358,119, +358,358,358,358,358,358,358,119,358,358,358,358,358,358,358,119, +543,543,543,543,543,543,543,543,543,543,543,543,543,543,543,543, +543,543,543,543,543,543,543,543,543,543,543,543,543,543,543,543, /* block 86 */ - 4, 4, 22, 26, 22, 26, 4, 4, 4, 22, 26, 4, 22, 26, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 9, 4, 4, 9, 4, 22, 26, 4, 4, - 22, 26, 6, 7, 6, 7, 6, 7, 6, 7, 4, 4, 4, 4, 4,109, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 9, 9, 4, 4, 4, 4, - 9, 4, 6, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, + 5, 5, 23, 27, 23, 27, 5, 5, 5, 23, 27, 5, 23, 27, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 10, 5, 5, 10, 5, 23, 27, 5, 5, + 23, 27, 7, 8, 7, 8, 7, 8, 7, 8, 5, 5, 5, 5, 5,110, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 10, 10, 5, 5, 5, 5, + 10, 5, 7,544, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 87 */ -510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, -510,510,510,510,510,510,510,510,510,510,116,510,510,510,510,510, -510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, -510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, -510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, -510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, -510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, -510,510,510,510,116,116,116,116,116,116,116,116,116,116,116,116, +545,545,545,545,545,545,545,545,545,545,545,545,545,545,545,545, +545,545,545,545,545,545,545,545,545,545,119,545,545,545,545,545, +545,545,545,545,545,545,545,545,545,545,545,545,545,545,545,545, +545,545,545,545,545,545,545,545,545,545,545,545,545,545,545,545, +545,545,545,545,545,545,545,545,545,545,545,545,545,545,545,545, +545,545,545,545,545,545,545,545,545,545,545,545,545,545,545,545, +545,545,545,545,545,545,545,545,545,545,545,545,545,545,545,545, +545,545,545,545,119,119,119,119,119,119,119,119,119,119,119,119, /* block 88 */ -510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, -510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, -510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, -510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, -510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, -510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, -510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, -510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, +545,545,545,545,545,545,545,545,545,545,545,545,545,545,545,545, +545,545,545,545,545,545,545,545,545,545,545,545,545,545,545,545, +545,545,545,545,545,545,545,545,545,545,545,545,545,545,545,545, +545,545,545,545,545,545,545,545,545,545,545,545,545,545,545,545, +545,545,545,545,545,545,545,545,545,545,545,545,545,545,545,545, +545,545,545,545,545,545,545,545,545,545,545,545,545,545,545,545, +545,545,545,545,545,545,545,545,545,545,545,545,545,545,545,545, +545,545,545,545,545,545,545,545,545,545,545,545,545,545,545,545, /* block 89 */ -510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, -510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, -510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, -510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, -510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, -510,510,510,510,510,510,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,116,116,116,116, +545,545,545,545,545,545,545,545,545,545,545,545,545,545,545,545, +545,545,545,545,545,545,545,545,545,545,545,545,545,545,545,545, +545,545,545,545,545,545,545,545,545,545,545,545,545,545,545,545, +545,545,545,545,545,545,545,545,545,545,545,545,545,545,545,545, +545,545,545,545,545,545,545,545,545,545,545,545,545,545,545,545, +545,545,545,545,545,545,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,119,119,119,119, /* block 90 */ - 3, 4, 4, 4, 19,511,439,512, 6, 7, 6, 7, 6, 7, 6, 7, - 6, 7, 19, 19, 6, 7, 6, 7, 6, 7, 6, 7, 9, 6, 7, 7, - 19,512,512,512,512,512,512,512,512,512,111,111,111,111,513,513, -514,109,109,109,109,109, 19, 19,512,512,512,511,439,470, 19, 19, -116,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, + 4,546,546,547, 20,548,549,550,551,552,551,552,551,552,551,552, +551,552, 20,553,551,552,551,552,551,552,551,552,554,555,556,556, + 20,550,550,550,550,550,550,550,550,550,557,557,557,557,558,558, +559,560,560,560,560,560, 20,553,550,550,550,548,561,562,563,563, +119,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564, +564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564, +564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564, +564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564, /* block 91 */ -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,116,116,111,111, 14, 14,516,516,515, - 9,517,517,517,517,517,517,517,517,517,517,517,517,517,517,517, -517,517,517,517,517,517,517,517,517,517,517,517,517,517,517,517, -517,517,517,517,517,517,517,517,517,517,517,517,517,517,517,517, -517,517,517,517,517,517,517,517,517,517,517,517,517,517,517,517, -517,517,517,517,517,517,517,517,517,517,517,517,517,517,517,517, -517,517,517,517,517,517,517,517,517,517,517, 4,109,518,518,517, +564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564, +564,564,564,564,564,564,564,119,119,565,565,566,566,567,567,564, +568,569,569,569,569,569,569,569,569,569,569,569,569,569,569,569, +569,569,569,569,569,569,569,569,569,569,569,569,569,569,569,569, +569,569,569,569,569,569,569,569,569,569,569,569,569,569,569,569, +569,569,569,569,569,569,569,569,569,569,569,569,569,569,569,569, +569,569,569,569,569,569,569,569,569,569,569,569,569,569,569,569, +569,569,569,569,569,569,569,569,569,569,569,546,560,570,570,569, /* block 92 */ -116,116,116,116,116,519,519,519,519,519,519,519,519,519,519,519, -519,519,519,519,519,519,519,519,519,519,519,519,519,519,519,519, -519,519,519,519,519,519,519,519,519,519,519,519,519,519,519,519, -116,520,520,520,520,520,520,520,520,520,520,520,520,520,520,520, -520,520,520,520,520,520,520,520,520,520,520,520,520,520,520,520, -520,520,520,520,520,520,520,520,520,520,520,520,520,520,520,520, -520,520,520,520,520,520,520,520,520,520,520,520,520,520,520,520, -520,520,520,520,520,520,520,520,520,520,520,520,520,520,520,520, +119,119,119,119,119,571,571,571,571,571,571,571,571,571,571,571, +571,571,571,571,571,571,571,571,571,571,571,571,571,571,571,571, +571,571,571,571,571,571,571,571,571,571,571,571,571,571,571,571, +119,572,572,572,572,572,572,572,572,572,572,572,572,572,572,572, +572,572,572,572,572,572,572,572,572,572,572,572,572,572,572,572, +572,572,572,572,572,572,572,572,572,572,572,572,572,572,572,572, +572,572,572,572,572,572,572,572,572,572,572,572,572,572,572,572, +572,572,572,572,572,572,572,572,572,572,572,572,572,572,572,572, /* block 93 */ -520,520,520,520,520,520,520,520,520,520,520,520,520,520,520,116, - 19, 19, 24, 24, 24, 24, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, -519,519,519,519,519,519,519,519,519,519,519,519,519,519,519,519, -519,519,519,519,519,519,519,519,519,519,519,116,116,116,116,116, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19,116,116,116,116,116,116,116,116,116,116,116,116, -517,517,517,517,517,517,517,517,517,517,517,517,517,517,517,517, +572,572,572,572,572,572,572,572,572,572,572,572,572,572,572,119, +563,563,573,573,573,573,563,563,563,563,563,563,563,563,563,563, +571,571,571,571,571,571,571,571,571,571,571,571,571,571,571,571, +571,571,571,571,571,571,571,571,571,571,571,119,119,119,119,119, +563,563,563,563,563,563,563,563,563,563,563,563,563,563,563,563, +563,563,563,563,563,563,563,563,563,563,563,563,563,563,563,563, +563,563,563,563,119,119,119,119,119,119,119,119,119,119,119,119, +569,569,569,569,569,569,569,569,569,569,569,569,569,569,569,569, /* block 94 */ -521,521,521,521,521,521,521,521,521,521,521,521,521,521,521,521, -521,521,521,521,521,521,521,521,521,521,521,521,521,521,521,116, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 24, 24, 24, 24, 24, 24, 24, 24, - 19, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -521,521,521,521,521,521,521,521,521,521,521,521,521,521,521,521, -521,521,521,521,521,521,521,521,521,521,521,521,521,521,521, 19, +574,574,574,574,574,574,574,574,574,574,574,574,574,574,574,574, +574,574,574,574,574,574,574,574,574,574,574,574,574,574,574,119, +573,573,573,573,573,573,573,573,573,573,563,563,563,563,563,563, +563,563,563,563,563,563,563,563,563,563,563,563,563,563,563,563, +563,563,563,563,563,563,563,563, 25, 25, 25, 25, 25, 25, 25, 25, + 20, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, +574,574,574,574,574,574,574,574,574,574,574,574,574,574,574,574, +574,574,574,574,574,574,574,574,574,574,574,574,574,574,574, 20, /* block 95 */ - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 20, 19, 20, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, -522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522, -522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522, -522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,116, +573,573,573,573,573,573,573,573,573,573,563,563,563,563,563,563, +563,563,563,563,563,563,563,575,563,575,563,563,563,563,563,563, +563,563,563,563,563,563,563,563,563,563,563,563,563,563,563,563, +563, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, +563,563,563,563,563,563,563,563,563,563,563,563, 20, 20, 20, 20, +576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576, +576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576, +576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,119, /* block 96 */ -522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522, -522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522, -522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522, -522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522, -522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522, -522,522,522,522,522,522,522,522, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, +576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576, +576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576, +576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576, +576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576, +576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,576, +576,576,576,576,576,576,576,576,563,563,563,563,563,563,563,563, +563,563,563,563,563,563,563,563,563,563,563,563,563,563,563,563, +563, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,563,563,563,563,563, /* block 97 */ -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, +563,563,563,563,563,563,563,563,563,563,563,563,563,563,563,563, +563,563,563,563,563,563,563,563,563,563,563,563,563,563,563, 20, /* block 98 */ -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,116,116,116,116,116,116,116,116,116,116, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, /* block 99 */ -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,119,119,119,119,119,119,119,119,119,119, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, /* block 100 */ -524,524,524,524,524,524,524,524,524,524,524,524,524,524,524,524, -524,524,524,524,524,525,524,524,524,524,524,524,524,524,524,524, -524,524,524,524,524,524,524,524,524,524,524,524,524,524,524,524, -524,524,524,524,524,524,524,524,524,524,524,524,524,524,524,524, -524,524,524,524,524,524,524,524,524,524,524,524,524,524,524,524, -524,524,524,524,524,524,524,524,524,524,524,524,524,524,524,524, -524,524,524,524,524,524,524,524,524,524,524,524,524,524,524,524, -524,524,524,524,524,524,524,524,524,524,524,524,524,524,524,524, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 101 */ -524,524,524,524,524,524,524,524,524,524,524,524,524,524,524,524, -524,524,524,524,524,524,524,524,524,524,524,524,524,524,524,524, -524,524,524,524,524,524,524,524,524,524,524,524,524,524,524,524, -524,524,524,524,524,524,524,524,524,524,524,524,524,524,524,524, -524,524,524,524,524,524,524,524,524,524,524,524,524,524,524,524, -524,524,524,524,524,524,524,524,524,524,524,524,524,524,524,524, -524,524,524,524,524,524,524,524,524,524,524,524,524,524,524,524, -524,524,524,524,524,524,524,524,524,524,524,524,524,524,524,524, +578,578,578,578,578,578,578,578,578,578,578,578,578,578,578,578, +578,578,578,578,578,579,578,578,578,578,578,578,578,578,578,578, +578,578,578,578,578,578,578,578,578,578,578,578,578,578,578,578, +578,578,578,578,578,578,578,578,578,578,578,578,578,578,578,578, +578,578,578,578,578,578,578,578,578,578,578,578,578,578,578,578, +578,578,578,578,578,578,578,578,578,578,578,578,578,578,578,578, +578,578,578,578,578,578,578,578,578,578,578,578,578,578,578,578, +578,578,578,578,578,578,578,578,578,578,578,578,578,578,578,578, /* block 102 */ -524,524,524,524,524,524,524,524,524,524,524,524,524,116,116,116, -526,526,526,526,526,526,526,526,526,526,526,526,526,526,526,526, -526,526,526,526,526,526,526,526,526,526,526,526,526,526,526,526, -526,526,526,526,526,526,526,526,526,526,526,526,526,526,526,526, -526,526,526,526,526,526,526,116,116,116,116,116,116,116,116,116, -527,527,527,527,527,527,527,527,527,527,527,527,527,527,527,527, -527,527,527,527,527,527,527,527,527,527,527,527,527,527,527,527, -527,527,527,527,527,527,527,527,528,528,528,528,528,528,529,529, +578,578,578,578,578,578,578,578,578,578,578,578,578,578,578,578, +578,578,578,578,578,578,578,578,578,578,578,578,578,578,578,578, +578,578,578,578,578,578,578,578,578,578,578,578,578,578,578,578, +578,578,578,578,578,578,578,578,578,578,578,578,578,578,578,578, +578,578,578,578,578,578,578,578,578,578,578,578,578,578,578,578, +578,578,578,578,578,578,578,578,578,578,578,578,578,578,578,578, +578,578,578,578,578,578,578,578,578,578,578,578,578,578,578,578, +578,578,578,578,578,578,578,578,578,578,578,578,578,578,578,578, /* block 103 */ -530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530, -530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530, -530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530, -530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530, -530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530, -530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530, -530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530, -530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530, +578,578,578,578,578,578,578,578,578,578,578,578,578,119,119,119, +580,580,580,580,580,580,580,580,580,580,580,580,580,580,580,580, +580,580,580,580,580,580,580,580,580,580,580,580,580,580,580,580, +580,580,580,580,580,580,580,580,580,580,580,580,580,580,580,580, +580,580,580,580,580,580,580,119,119,119,119,119,119,119,119,119, +581,581,581,581,581,581,581,581,581,581,581,581,581,581,581,581, +581,581,581,581,581,581,581,581,581,581,581,581,581,581,581,581, +581,581,581,581,581,581,581,581,582,582,582,582,582,582,583,583, /* block 104 */ -530,530,530,530,530,530,530,530,530,530,530,530,531,532,532,532, -530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530, -533,533,533,533,533,533,533,533,533,533,530,530,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -188,189,188,189,188,189,188,189,188,189,534,535,188,189,188,189, -188,189,188,189,188,189,188,189,188,189,188,189,188,189,188,189, -188,189,188,189,188,189,188,189,188,189,188,189,188,189,536,193, -194,194,194,537,193,193,193,193,193,193,193,193,193,193,537,441, +584,584,584,584,584,584,584,584,584,584,584,584,584,584,584,584, +584,584,584,584,584,584,584,584,584,584,584,584,584,584,584,584, +584,584,584,584,584,584,584,584,584,584,584,584,584,584,584,584, +584,584,584,584,584,584,584,584,584,584,584,584,584,584,584,584, +584,584,584,584,584,584,584,584,584,584,584,584,584,584,584,584, +584,584,584,584,584,584,584,584,584,584,584,584,584,584,584,584, +584,584,584,584,584,584,584,584,584,584,584,584,584,584,584,584, +584,584,584,584,584,584,584,584,584,584,584,584,584,584,584,584, /* block 105 */ -188,189,188,189,188,189,188,189,188,189,188,189,188,189,188,189, -188,189,188,189,188,189,188,189,188,189,188,189,441,441,193,193, -538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538, -538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538, -538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538, -538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538, -538,538,538,538,538,538,539,539,539,539,539,539,539,539,539,539, -540,540,541,541,541,541,541,541,116,116,116,116,116,116,116,116, +584,584,584,584,584,584,584,584,584,584,584,584,585,586,586,586, +584,584,584,584,584,584,584,584,584,584,584,584,584,584,584,584, +587,587,587,587,587,587,587,587,587,587,584,584,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +191,192,191,192,191,192,191,192,191,192,588,589,191,192,191,192, +191,192,191,192,191,192,191,192,191,192,191,192,191,192,191,192, +191,192,191,192,191,192,191,192,191,192,191,192,191,192,590,197, +199,199,199,591,543,543,543,543,543,543,543,543,543,543,591,472, /* block 106 */ - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14,109,109,109,109,109,109,109,109,109, - 14, 14, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, - 34, 34, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, - 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, - 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, - 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, -108, 34, 34, 34, 34, 34, 34, 34, 34, 31, 32, 31, 32,542, 31, 32, +191,192,191,192,191,192,191,192,191,192,191,192,191,192,191,192, +191,192,191,192,191,192,191,192,191,192,191,192,472,472,543,543, +592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592, +592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592, +592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592, +592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592, +592,592,592,592,592,592,593,593,593,593,593,593,593,593,593,593, +594,594,595,595,595,595,595,595,119,119,119,119,119,119,119,119, /* block 107 */ - 31, 32, 31, 32, 31, 32, 31, 32,109, 14, 14, 31, 32,543, 34, 21, - 31, 32, 31, 32, 34, 34, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, - 31, 32, 31, 32, 31, 32, 31, 32, 31, 32,544,545,546,547,544, 34, -548,549,550,551, 31, 32, 31, 32, 31, 32,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116, 21,108,108, 34, 21, 21, 21, 21, 21, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15,110,110,110,110,110,110,110,110,110, + 15, 15, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, + 35, 35, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, + 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, + 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, + 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, +109, 35, 35, 35, 35, 35, 35, 35, 35, 32, 33, 32, 33,596, 32, 33, /* block 108 */ -552,552,553,552,552,552,553,552,552,552,552,553,552,552,552,552, -552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,552, -552,552,552,554,554,553,553,554,555,555,555,555,116,116,116,116, - 24, 24, 24, 24, 24, 24, 19, 19, 5, 19,116,116,116,116,116,116, -556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,556, -556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,556, -556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,556, -556,556,556,556,557,557,557,557,116,116,116,116,116,116,116,116, + 32, 33, 32, 33, 32, 33, 32, 33,110, 15, 15, 32, 33,597, 35, 22, + 32, 33, 32, 33, 35, 35, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, + 32, 33, 32, 33, 32, 33, 32, 33, 32, 33,598,599,600,601,598, 35, +602,603,604,605, 32, 33, 32, 33, 32, 33,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119, 22,109,109, 35, 22, 22, 22, 22, 22, /* block 109 */ -558,558,559,559,559,559,559,559,559,559,559,559,559,559,559,559, -559,559,559,559,559,559,559,559,559,559,559,559,559,559,559,559, -559,559,559,559,559,559,559,559,559,559,559,559,559,559,559,559, -559,559,559,559,558,558,558,558,558,558,558,558,558,558,558,558, -558,558,558,558,560,560,116,116,116,116,116,116,116,116,561,561, -562,562,562,562,562,562,562,562,562,562,116,116,116,116,116,116, -240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240, -240,240,242,242,242,242,242,242,244,244,244,242,244,242,242,240, +606,606,607,606,606,606,607,606,606,606,606,607,606,606,606,606, +606,606,606,606,606,606,606,606,606,606,606,606,606,606,606,606, +606,606,606,608,608,607,607,608,609,609,609,609,119,119,119,119, +610,610,610,611,611,611,612,612,613,612,119,119,119,119,119,119, +614,614,614,614,614,614,614,614,614,614,614,614,614,614,614,614, +614,614,614,614,614,614,614,614,614,614,614,614,614,614,614,614, +614,614,614,614,614,614,614,614,614,614,614,614,614,614,614,614, +614,614,614,614,615,615,615,615,119,119,119,119,119,119,119,119, /* block 110 */ -563,563,563,563,563,563,563,563,563,563,564,564,564,564,564,564, -564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564, -564,564,564,564,564,564,565,565,565,565,565,565,565,565, 4,566, -567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567, -567,567,567,567,567,567,567,568,568,568,568,568,568,568,568,568, -568,568,569,569,116,116,116,116,116,116,116,116,116,116,116,570, -337,337,337,337,337,337,337,337,337,337,337,337,337,337,337,337, -337,337,337,337,337,337,337,337,337,337,337,337,337,116,116,116, +616,616,617,617,617,617,617,617,617,617,617,617,617,617,617,617, +617,617,617,617,617,617,617,617,617,617,617,617,617,617,617,617, +617,617,617,617,617,617,617,617,617,617,617,617,617,617,617,617, +617,617,617,617,616,616,616,616,616,616,616,616,616,616,616,616, +616,616,616,616,618,618,119,119,119,119,119,119,119,119,619,619, +620,620,620,620,620,620,620,620,620,620,119,119,119,119,119,119, +251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251, +251,621,253,622,253,253,253,253,259,259,259,253,259,253,253,251, /* block 111 */ -571,571,571,572,573,573,573,573,573,573,573,573,573,573,573,573, -573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573, -573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573, -573,573,573,571,572,572,571,571,571,571,572,572,571,572,572,572, -572,574,574,574,574,574,574,574,574,574,574,574,574,574,116,109, -575,575,575,575,575,575,575,575,575,575,116,116,116,116,574,574, -327,327,327,327,327,329,576,327,327,327,327,327,327,327,327,327, -331,331,331,331,331,331,331,331,331,331,327,327,327,327,327,116, +623,623,623,623,623,623,623,623,623,623,624,624,624,624,624,624, +624,624,624,624,624,624,624,624,624,624,624,624,624,624,624,624, +624,624,624,624,624,624,625,625,625,625,625,625,625,625,626,627, +628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,628, +628,628,628,628,628,628,628,629,629,629,629,629,629,629,629,629, +629,629,630,630,119,119,119,119,119,119,119,119,119,119,119,631, +355,355,355,355,355,355,355,355,355,355,355,355,355,355,355,355, +355,355,355,355,355,355,355,355,355,355,355,355,355,119,119,119, /* block 112 */ -577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, -577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, -577,577,577,577,577,577,577,577,577,578,578,578,578,578,578,579, -579,578,578,579,579,578,578,116,116,116,116,116,116,116,116,116, -577,577,577,578,577,577,577,577,577,577,577,577,578,579,116,116, -580,580,580,580,580,580,580,580,580,580,116,116,581,581,581,581, -327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327, -576,327,327,327,327,327,327,333,333,333,327,328,329,328,327,327, +632,632,632,633,634,634,634,634,634,634,634,634,634,634,634,634, +634,634,634,634,634,634,634,634,634,634,634,634,634,634,634,634, +634,634,634,634,634,634,634,634,634,634,634,634,634,634,634,634, +634,634,634,632,633,633,632,632,632,632,633,633,632,633,633,633, +633,635,635,635,635,635,635,635,635,635,635,635,635,635,119,636, +637,637,637,637,637,637,637,637,637,637,119,119,119,119,635,635, +343,343,343,343,343,345,638,343,343,343,343,343,343,343,343,343, +349,349,349,349,349,349,349,349,349,349,343,343,343,343,343,119, /* block 113 */ -582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,582, -582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,582, -582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,582, -583,582,583,583,583,582,582,583,583,582,582,582,582,582,583,583, -582,583,582,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,582,582,584,585,585, -586,586,586,586,586,586,586,586,586,586,586,587,588,588,587,587, -589,589,586,590,590,587,588,116,116,116,116,116,116,116,116,116, +639,639,639,639,639,639,639,639,639,639,639,639,639,639,639,639, +639,639,639,639,639,639,639,639,639,639,639,639,639,639,639,639, +639,639,639,639,639,639,639,639,639,640,640,640,640,640,640,641, +641,640,640,641,641,640,640,119,119,119,119,119,119,119,119,119, +639,639,639,640,639,639,639,639,639,639,639,639,640,641,119,119, +642,642,642,642,642,642,642,642,642,642,119,119,643,643,643,643, +343,343,343,343,343,343,343,343,343,343,343,343,343,343,343,343, +638,343,343,343,343,343,343,350,350,350,343,344,345,344,343,343, /* block 114 */ -116,340,340,340,340,340,340,116,116,340,340,340,340,340,340,116, -116,340,340,340,340,340,340,116,116,116,116,116,116,116,116,116, -340,340,340,340,340,340,340,116,340,340,340,340,340,340,340,116, - 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, - 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, - 34, 34, 34,591, 34, 34, 34, 34, 34, 34, 34, 14,108,108,108,108, - 34, 34, 34, 34, 34,124,116,116,116,116,116,116,116,116,116,116, -592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592, +644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644, +644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644, +644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644, +645,644,645,645,645,644,644,645,645,644,644,644,644,644,645,645, +644,645,644,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,644,644,646,647,647, +648,648,648,648,648,648,648,648,648,648,648,649,650,650,649,649, +651,651,648,652,652,649,650,119,119,119,119,119,119,119,119,119, /* block 115 */ -592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592, -592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592, -592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592, -592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592, -586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,586, -586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,586, -586,586,586,587,587,588,587,587,588,587,587,589,587,588,116,116, -593,593,593,593,593,593,593,593,593,593,116,116,116,116,116,116, +119,358,358,358,358,358,358,119,119,358,358,358,358,358,358,119, +119,358,358,358,358,358,358,119,119,119,119,119,119,119,119,119, +358,358,358,358,358,358,358,119,358,358,358,358,358,358,358,119, + 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, + 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, + 35, 35, 35,653, 35, 35, 35, 35, 35, 35, 35, 15,109,109,109,109, + 35, 35, 35, 35, 35,127,119,119,119,119,119,119,119,119,119,119, +654,654,654,654,654,654,654,654,654,654,654,654,654,654,654,654, /* block 116 */ -594,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, -595,595,595,595,595,595,595,595,595,595,595,595,594,595,595,595, -595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, -595,595,595,595,595,595,595,595,594,595,595,595,595,595,595,595, -595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, -595,595,595,595,594,595,595,595,595,595,595,595,595,595,595,595, -595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, -594,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, +654,654,654,654,654,654,654,654,654,654,654,654,654,654,654,654, +654,654,654,654,654,654,654,654,654,654,654,654,654,654,654,654, +654,654,654,654,654,654,654,654,654,654,654,654,654,654,654,654, +654,654,654,654,654,654,654,654,654,654,654,654,654,654,654,654, +648,648,648,648,648,648,648,648,648,648,648,648,648,648,648,648, +648,648,648,648,648,648,648,648,648,648,648,648,648,648,648,648, +648,648,648,649,649,650,649,649,650,649,649,651,649,650,119,119, +655,655,655,655,655,655,655,655,655,655,119,119,119,119,119,119, /* block 117 */ -595,595,595,595,595,595,595,595,595,595,595,595,594,595,595,595, -595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, -595,595,595,595,595,595,595,595,594,595,595,595,595,595,595,595, -595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, -595,595,595,595,594,595,595,595,595,595,595,595,595,595,595,595, -595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, -594,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, -595,595,595,595,595,595,595,595,595,595,595,595,594,595,595,595, +656,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657, +657,657,657,657,657,657,657,657,657,657,657,657,656,657,657,657, +657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657, +657,657,657,657,657,657,657,657,656,657,657,657,657,657,657,657, +657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657, +657,657,657,657,656,657,657,657,657,657,657,657,657,657,657,657, +657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657, +656,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657, /* block 118 */ -595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, -595,595,595,595,595,595,595,595,594,595,595,595,595,595,595,595, -595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, -595,595,595,595,594,595,595,595,595,595,595,595,595,595,595,595, -595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, -594,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, -595,595,595,595,595,595,595,595,595,595,595,595,594,595,595,595, -595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, +657,657,657,657,657,657,657,657,657,657,657,657,656,657,657,657, +657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657, +657,657,657,657,657,657,657,657,656,657,657,657,657,657,657,657, +657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657, +657,657,657,657,656,657,657,657,657,657,657,657,657,657,657,657, +657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657, +656,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657, +657,657,657,657,657,657,657,657,657,657,657,657,656,657,657,657, /* block 119 */ -595,595,595,595,595,595,595,595,594,595,595,595,595,595,595,595, -595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, -595,595,595,595,594,595,595,595,595,595,595,595,595,595,595,595, -595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, -594,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, -595,595,595,595,595,595,595,595,595,595,595,595,594,595,595,595, -595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, -595,595,595,595,595,595,595,595,594,595,595,595,595,595,595,595, +657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657, +657,657,657,657,657,657,657,657,656,657,657,657,657,657,657,657, +657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657, +657,657,657,657,656,657,657,657,657,657,657,657,657,657,657,657, +657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657, +656,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657, +657,657,657,657,657,657,657,657,657,657,657,657,656,657,657,657, +657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657, /* block 120 */ -595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, -595,595,595,595,594,595,595,595,595,595,595,595,595,595,595,595, -595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, -594,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, -595,595,595,595,595,595,595,595,595,595,595,595,594,595,595,595, -595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, -595,595,595,595,595,595,595,595,594,595,595,595,595,595,595,595, -595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, +657,657,657,657,657,657,657,657,656,657,657,657,657,657,657,657, +657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657, +657,657,657,657,656,657,657,657,657,657,657,657,657,657,657,657, +657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657, +656,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657, +657,657,657,657,657,657,657,657,657,657,657,657,656,657,657,657, +657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657, +657,657,657,657,657,657,657,657,656,657,657,657,657,657,657,657, /* block 121 */ -595,595,595,595,594,595,595,595,595,595,595,595,595,595,595,595, -595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, -594,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, -595,595,595,595,595,595,595,595,595,595,595,595,594,595,595,595, -595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, -595,595,595,595,595,595,595,595,594,595,595,595,595,595,595,595, -595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, -595,595,595,595,594,595,595,595,595,595,595,595,595,595,595,595, +657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657, +657,657,657,657,656,657,657,657,657,657,657,657,657,657,657,657, +657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657, +656,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657, +657,657,657,657,657,657,657,657,657,657,657,657,656,657,657,657, +657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657, +657,657,657,657,657,657,657,657,656,657,657,657,657,657,657,657, +657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657, /* block 122 */ -595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, -594,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, -595,595,595,595,595,595,595,595,595,595,595,595,594,595,595,595, -595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, -595,595,595,595,595,595,595,595,594,595,595,595,595,595,595,595, -595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, -595,595,595,595,594,595,595,595,595,595,595,595,595,595,595,595, -595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, +657,657,657,657,656,657,657,657,657,657,657,657,657,657,657,657, +657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657, +656,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657, +657,657,657,657,657,657,657,657,657,657,657,657,656,657,657,657, +657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657, +657,657,657,657,657,657,657,657,656,657,657,657,657,657,657,657, +657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657, +657,657,657,657,656,657,657,657,657,657,657,657,657,657,657,657, /* block 123 */ -595,595,595,595,595,595,595,595,594,595,595,595,595,595,595,595, -595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, -595,595,595,595,116,116,116,116,116,116,116,116,116,116,116,116, -338,338,338,338,338,338,338,338,338,338,338,338,338,338,338,338, -338,338,338,338,338,338,338,116,116,116,116,339,339,339,339,339, -339,339,339,339,339,339,339,339,339,339,339,339,339,339,339,339, -339,339,339,339,339,339,339,339,339,339,339,339,339,339,339,339, -339,339,339,339,339,339,339,339,339,339,339,339,116,116,116,116, +657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657, +656,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657, +657,657,657,657,657,657,657,657,657,657,657,657,656,657,657,657, +657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657, +657,657,657,657,657,657,657,657,656,657,657,657,657,657,657,657, +657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657, +657,657,657,657,656,657,657,657,657,657,657,657,657,657,657,657, +657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657, /* block 124 */ -596,596,596,596,596,596,596,596,596,596,596,596,596,596,596,596, -596,596,596,596,596,596,596,596,596,596,596,596,596,596,596,596, -596,596,596,596,596,596,596,596,596,596,596,596,596,596,596,596, -596,596,596,596,596,596,596,596,596,596,596,596,596,596,596,596, -596,596,596,596,596,596,596,596,596,596,596,596,596,596,596,596, -596,596,596,596,596,596,596,596,596,596,596,596,596,596,596,596, -596,596,596,596,596,596,596,596,596,596,596,596,596,596,596,596, -596,596,596,596,596,596,596,596,596,596,596,596,596,596,596,596, +657,657,657,657,657,657,657,657,656,657,657,657,657,657,657,657, +657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657, +657,657,657,657,119,119,119,119,119,119,119,119,119,119,119,119, +356,356,356,356,356,356,356,356,356,356,356,356,356,356,356,356, +356,356,356,356,356,356,356,119,119,119,119,357,357,357,357,357, +357,357,357,357,357,357,357,357,357,357,357,357,357,357,357,357, +357,357,357,357,357,357,357,357,357,357,357,357,357,357,357,357, +357,357,357,357,357,357,357,357,357,357,357,357,119,119,119,119, /* block 125 */ -597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597, -597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597, -597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597, -597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597, -597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597, -597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597, -597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597, -597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597, +658,658,658,658,658,658,658,658,658,658,658,658,658,658,658,658, +658,658,658,658,658,658,658,658,658,658,658,658,658,658,658,658, +658,658,658,658,658,658,658,658,658,658,658,658,658,658,658,658, +658,658,658,658,658,658,658,658,658,658,658,658,658,658,658,658, +658,658,658,658,658,658,658,658,658,658,658,658,658,658,658,658, +658,658,658,658,658,658,658,658,658,658,658,658,658,658,658,658, +658,658,658,658,658,658,658,658,658,658,658,658,658,658,658,658, +658,658,658,658,658,658,658,658,658,658,658,658,658,658,658,658, /* block 126 */ -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,116,116, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659, +659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659, +659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659, +659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659, +659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659, +659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659, +659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659, +659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659, /* block 127 */ -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,119,119, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, /* block 128 */ - 34, 34, 34, 34, 34, 34, 34,116,116,116,116,116,116,116,116,116, -116,116,116,200,200,200,200,200,116,116,116,116,116,208,205,208, -208,208,208,208,208,208,208,208,208,598,208,208,208,208,208,208, -208,208,208,208,208,208,208,116,208,208,208,208,208,116,208,116, -208,208,116,208,208,116,208,208,208,208,208,208,208,208,208,208, -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 129 */ -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -217,217,599,599,599,599,599,599,599,599,599,599,599,599,599,599, -599,599,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,217,217,217,217,217,217,217,217,217,217,217,217,217, -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, + 35, 35, 35, 35, 35, 35, 35,119,119,119,119,119,119,119,119,119, +119,119,119,205,205,205,205,205,119,119,119,119,119,214,211,214, +214,214,214,214,214,214,214,214,214,660,214,214,214,214,214,214, +214,214,214,214,214,214,214,119,214,214,214,214,214,119,214,119, +214,214,119,214,214,119,214,214,214,214,214,214,214,214,214,214, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, /* block 130 */ -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +224,224,661,661,661,661,661,661,661,661,661,661,661,661,661,661, +661,661,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,224,224,224,224,224,224,224,224,224,224,224,224,224, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, /* block 131 */ -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -217,217,217,217,217,217,217,217,217,217,217,217,217,217, 7, 6, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, /* block 132 */ -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -116,116,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -217,217,217,217,217,217,217,217,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -217,217,217,217,217,217,217,217,217,217,217,217,213,214,116,116, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +224,224,224,224,224,224,224,224,224,224,224,224,224,224, 8, 7, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, /* block 133 */ -111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, - 4, 4, 4, 4, 4, 4, 4, 6, 7, 4,116,116,116,116,116,116, -111,111,111,111,111,111,111,111,111,111,111,111,111,111,193,193, - 4, 9, 9, 15, 15, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7, 6, - 7, 6, 7, 6, 7, 4, 4, 6, 7, 4, 4, 4, 4, 15, 15, 15, - 4, 4, 4,116, 4, 4, 4, 4, 9, 6, 7, 6, 7, 6, 7, 4, - 4, 4, 8, 9, 8, 8, 8,116, 4, 5, 4, 4,116,116,116,116, -217,217,217,217,217,116,217,217,217,217,217,217,217,217,217,217, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +119,119,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +224,224,224,224,224,224,224,224,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +224,224,662,224,224,224,224,224,224,224,224,224,219,663,119,119, /* block 134 */ -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -217,217,217,217,217,217,217,217,217,217,217,217,217,116,116, 23, +112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112, + 5, 5, 5, 5, 5, 5, 5, 7, 8, 5,119,119,119,119,119,119, +112,112,112,112,112,112,112,112,112,112,112,112,112,112,543,543, + 5, 10, 10, 16, 16, 7, 8, 7, 8, 7, 8, 7, 8, 7, 8, 7, + 8, 7, 8, 7, 8,547,547, 7, 8, 5, 5, 5, 5, 16, 16, 16, + 5, 5, 5,119, 5, 5, 5, 5, 10, 7, 8, 7, 8, 7, 8, 5, + 5, 5, 9, 10, 9, 9, 9,119, 5, 6, 5, 5,119,119,119,119, +224,224,224,224,224,119,224,224,224,224,224,224,224,224,224,224, /* block 135 */ -116, 4, 4, 4, 5, 4, 4, 4, 6, 7, 4, 8, 4, 9, 4, 4, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 4, 4, 8, 8, 8, 4, - 4, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 6, 4, 7, 14, 15, - 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 6, 8, 7, 8, 6, - 7, 4, 6, 7, 4, 4,517,517,517,517,517,517,517,517,517,517, -109,517,517,517,517,517,517,517,517,517,517,517,517,517,517,517, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +224,224,224,224,224,224,224,224,224,224,224,224,224,119,119, 24, /* block 136 */ -517,517,517,517,517,517,517,517,517,517,517,517,517,517,517,517, -517,517,517,517,517,517,517,517,517,517,517,517,517,517,600,600, -520,520,520,520,520,520,520,520,520,520,520,520,520,520,520,520, -520,520,520,520,520,520,520,520,520,520,520,520,520,520,520,116, -116,116,520,520,520,520,520,520,116,116,520,520,520,520,520,520, -116,116,520,520,520,520,520,520,116,116,520,520,520,116,116,116, - 5, 5, 8, 14, 19, 5, 5,116, 19, 8, 8, 8, 8, 19, 19,116, -471,471,471,471,471,471,471,471,471, 23, 23, 23, 19, 19,116,116, +119, 5, 5, 5, 6, 5, 5, 5, 7, 8, 5, 9, 5, 10, 5, 5, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 5, 5, 9, 9, 9, 5, + 5, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 7, 5, 8, 15, 16, + 15, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7, 9, 8, 9, 7, + 8,546,551,552,546,546,569,569,569,569,569,569,569,569,569,569, +560,569,569,569,569,569,569,569,569,569,569,569,569,569,569,569, /* block 137 */ -601,601,601,601,601,601,601,601,601,601,601,601,116,601,601,601, -601,601,601,601,601,601,601,601,601,601,601,601,601,601,601,601, -601,601,601,601,601,601,601,116,601,601,601,601,601,601,601,601, -601,601,601,601,601,601,601,601,601,601,601,116,601,601,116,601, -601,601,601,601,601,601,601,601,601,601,601,601,601,601,116,116, -601,601,601,601,601,601,601,601,601,601,601,601,601,601,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +569,569,569,569,569,569,569,569,569,569,569,569,569,569,569,569, +569,569,569,569,569,569,569,569,569,569,569,569,569,569,664,664, +572,572,572,572,572,572,572,572,572,572,572,572,572,572,572,572, +572,572,572,572,572,572,572,572,572,572,572,572,572,572,572,119, +119,119,572,572,572,572,572,572,119,119,572,572,572,572,572,572, +119,119,572,572,572,572,572,572,119,119,572,572,572,119,119,119, + 6, 6, 9, 15, 20, 6, 6,119, 20, 9, 9, 9, 9, 20, 20,119, +502,502,502,502,502,502,502,502,502, 24, 24, 24, 20, 20,119,119, /* block 138 */ -601,601,601,601,601,601,601,601,601,601,601,601,601,601,601,601, -601,601,601,601,601,601,601,601,601,601,601,601,601,601,601,601, -601,601,601,601,601,601,601,601,601,601,601,601,601,601,601,601, -601,601,601,601,601,601,601,601,601,601,601,601,601,601,601,601, -601,601,601,601,601,601,601,601,601,601,601,601,601,601,601,601, -601,601,601,601,601,601,601,601,601,601,601,601,601,601,601,601, -601,601,601,601,601,601,601,601,601,601,601,601,601,601,601,601, -601,601,601,601,601,601,601,601,601,601,601,116,116,116,116,116, +665,665,665,665,665,665,665,665,665,665,665,665,119,665,665,665, +665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,665, +665,665,665,665,665,665,665,119,665,665,665,665,665,665,665,665, +665,665,665,665,665,665,665,665,665,665,665,119,665,665,119,665, +665,665,665,665,665,665,665,665,665,665,665,665,665,665,119,119, +665,665,665,665,665,665,665,665,665,665,665,665,665,665,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 139 */ - 4, 4, 4,116,116,116,116, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24,116,116,116, 19, 19, 19, 19, 19, 19, 19, 19, 19, -602,602,602,602,602,602,602,602,602,602,602,602,602,602,602,602, -602,602,602,602,602,602,602,602,602,602,602,602,602,602,602,602, -602,602,602,602,602,602,602,602,602,602,602,602,602,602,602,602, -602,602,602,602,602,603,603,603,603,604,604,604,604,604,604,604, +665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,665, +665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,665, +665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,665, +665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,665, +665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,665, +665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,665, +665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,665, +665,665,665,665,665,665,665,665,665,665,665,119,119,119,119,119, /* block 140 */ -604,604,604,604,604,604,604,604,604,604,603,603,604,604,604,116, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,116,116,116,116, -604,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,111,116,116, +666,666,666,119,119,119,119,667,667,667,667,667,667,667,667,667, +667,667,667,667,667,667,667,667,667,667,667,667,667,667,667,667, +667,667,667,667,667,667,667,667,667,667,667,667,667,667,667,667, +667,667,667,667,119,119,119,668,668,668,668,668,668,668,668,668, +669,669,669,669,669,669,669,669,669,669,669,669,669,669,669,669, +669,669,669,669,669,669,669,669,669,669,669,669,669,669,669,669, +669,669,669,669,669,669,669,669,669,669,669,669,669,669,669,669, +669,669,669,669,669,670,670,670,670,671,671,671,671,671,671,671, /* block 141 */ -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +671,671,671,671,671,671,671,671,671,671,670,670,671,671,671,119, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,119,119,119,119, +671,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,112,119,119, /* block 142 */ -605,605,605,605,605,605,605,605,605,605,605,605,605,605,605,605, -605,605,605,605,605,605,605,605,605,605,605,605,605,116,116,116, -606,606,606,606,606,606,606,606,606,606,606,606,606,606,606,606, -606,606,606,606,606,606,606,606,606,606,606,606,606,606,606,606, -606,606,606,606,606,606,606,606,606,606,606,606,606,606,606,606, -606,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -111, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,116,116,116,116, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 143 */ -607,607,607,607,607,607,607,607,607,607,607,607,607,607,607,607, -607,607,607,607,607,607,607,607,607,607,607,607,607,607,607,607, -608,608,608,608,116,116,116,116,116,116,116,116,116,607,607,607, -609,609,609,609,609,609,609,609,609,609,609,609,609,609,609,609, -609,610,609,609,609,609,609,609,609,609,610,116,116,116,116,116, -611,611,611,611,611,611,611,611,611,611,611,611,611,611,611,611, -611,611,611,611,611,611,611,611,611,611,611,611,611,611,611,611, -611,611,611,611,611,611,612,612,612,612,612,116,116,116,116,116, +672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,672, +672,672,672,672,672,672,672,672,672,672,672,672,672,119,119,119, +673,673,673,673,673,673,673,673,673,673,673,673,673,673,673,673, +673,673,673,673,673,673,673,673,673,673,673,673,673,673,673,673, +673,673,673,673,673,673,673,673,673,673,673,673,673,673,673,673, +673,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +674,675,675,675,675,675,675,675,675,675,675,675,675,675,675,675, +675,675,675,675,675,675,675,675,675,675,675,675,119,119,119,119, /* block 144 */ -613,613,613,613,613,613,613,613,613,613,613,613,613,613,613,613, -613,613,613,613,613,613,613,613,613,613,613,613,613,613,116,614, -615,615,615,615,615,615,615,615,615,615,615,615,615,615,615,615, -615,615,615,615,615,615,615,615,615,615,615,615,615,615,615,615, -615,615,615,615,116,116,116,116,615,615,615,615,615,615,615,615, -616,617,617,617,617,617,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +676,676,676,676,676,676,676,676,676,676,676,676,676,676,676,676, +676,676,676,676,676,676,676,676,676,676,676,676,676,676,676,676, +677,677,677,677,119,119,119,119,119,119,119,119,119,676,676,676, +678,678,678,678,678,678,678,678,678,678,678,678,678,678,678,678, +678,679,678,678,678,678,678,678,678,678,679,119,119,119,119,119, +680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680, +680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680, +680,680,680,680,680,680,681,681,681,681,681,119,119,119,119,119, /* block 145 */ -618,618,618,618,618,618,618,618,618,618,618,618,618,618,618,618, -618,618,618,618,618,618,618,618,618,618,618,618,618,618,618,618, -618,618,618,618,618,618,618,618,619,619,619,619,619,619,619,619, -619,619,619,619,619,619,619,619,619,619,619,619,619,619,619,619, -619,619,619,619,619,619,619,619,619,619,619,619,619,619,619,619, -620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,620, -620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,620, -620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,620, +682,682,682,682,682,682,682,682,682,682,682,682,682,682,682,682, +682,682,682,682,682,682,682,682,682,682,682,682,682,682,119,683, +684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684, +684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684, +684,684,684,684,119,119,119,119,684,684,684,684,684,684,684,684, +685,686,686,686,686,686,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 146 */ -621,621,621,621,621,621,621,621,621,621,621,621,621,621,621,621, -621,621,621,621,621,621,621,621,621,621,621,621,621,621,116,116, -622,622,622,622,622,622,622,622,622,622,116,116,116,116,116,116, -623,623,623,623,623,623,623,623,623,623,623,623,623,623,623,623, -623,623,623,623,623,623,623,623,623,623,623,623,623,623,623,623, -623,623,623,623,116,116,116,116,624,624,624,624,624,624,624,624, -624,624,624,624,624,624,624,624,624,624,624,624,624,624,624,624, -624,624,624,624,624,624,624,624,624,624,624,624,116,116,116,116, +687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687, +687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687, +687,687,687,687,687,687,687,687,688,688,688,688,688,688,688,688, +688,688,688,688,688,688,688,688,688,688,688,688,688,688,688,688, +688,688,688,688,688,688,688,688,688,688,688,688,688,688,688,688, +689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689, +689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689, +689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689, /* block 147 */ -625,625,625,625,625,625,625,625,625,625,625,625,625,625,625,625, -625,625,625,625,625,625,625,625,625,625,625,625,625,625,625,625, -625,625,625,625,625,625,625,625,116,116,116,116,116,116,116,116, -626,626,626,626,626,626,626,626,626,626,626,626,626,626,626,626, -626,626,626,626,626,626,626,626,626,626,626,626,626,626,626,626, -626,626,626,626,626,626,626,626,626,626,626,626,626,626,626,626, -626,626,626,626,116,116,116,116,116,116,116,116,116,116,116,627, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +690,690,690,690,690,690,690,690,690,690,690,690,690,690,690,690, +690,690,690,690,690,690,690,690,690,690,690,690,690,690,119,119, +691,691,691,691,691,691,691,691,691,691,119,119,119,119,119,119, +692,692,692,692,692,692,692,692,692,692,692,692,692,692,692,692, +692,692,692,692,692,692,692,692,692,692,692,692,692,692,692,692, +692,692,692,692,119,119,119,119,693,693,693,693,693,693,693,693, +693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693, +693,693,693,693,693,693,693,693,693,693,693,693,119,119,119,119, /* block 148 */ -628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,628, -628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,628, -628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,628, -628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,628, -628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,628, -628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,628, -628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,628, -628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,628, +694,694,694,694,694,694,694,694,694,694,694,694,694,694,694,694, +694,694,694,694,694,694,694,694,694,694,694,694,694,694,694,694, +694,694,694,694,694,694,694,694,119,119,119,119,119,119,119,119, +695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695, +695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695, +695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695, +695,695,695,695,119,119,119,119,119,119,119,119,119,119,119,696, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 149 */ -628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,628, -628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,628, -628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,628, -628,628,628,628,628,628,628,116,116,116,116,116,116,116,116,116, -628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,628, -628,628,628,628,628,628,116,116,116,116,116,116,116,116,116,116, -628,628,628,628,628,628,628,628,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +697,697,697,697,697,697,697,697,697,697,697,697,697,697,697,697, +697,697,697,697,697,697,697,697,697,697,697,697,697,697,697,697, +697,697,697,697,697,697,697,697,697,697,697,697,697,697,697,697, +697,697,697,697,697,697,697,697,697,697,697,697,697,697,697,697, +697,697,697,697,697,697,697,697,697,697,697,697,697,697,697,697, +697,697,697,697,697,697,697,697,697,697,697,697,697,697,697,697, +697,697,697,697,697,697,697,697,697,697,697,697,697,697,697,697, +697,697,697,697,697,697,697,697,697,697,697,697,697,697,697,697, /* block 150 */ -629,629,629,629,629,629,116,116,629,116,629,629,629,629,629,629, -629,629,629,629,629,629,629,629,629,629,629,629,629,629,629,629, -629,629,629,629,629,629,629,629,629,629,629,629,629,629,629,629, -629,629,629,629,629,629,116,629,629,116,116,116,629,116,116,629, -630,630,630,630,630,630,630,630,630,630,630,630,630,630,630,630, -630,630,630,630,630,630,116,631,632,632,632,632,632,632,632,632, -633,633,633,633,633,633,633,633,633,633,633,633,633,633,633,633, -633,633,633,633,633,633,633,634,634,635,635,635,635,635,635,635, +697,697,697,697,697,697,697,697,697,697,697,697,697,697,697,697, +697,697,697,697,697,697,697,697,697,697,697,697,697,697,697,697, +697,697,697,697,697,697,697,697,697,697,697,697,697,697,697,697, +697,697,697,697,697,697,697,119,119,119,119,119,119,119,119,119, +697,697,697,697,697,697,697,697,697,697,697,697,697,697,697,697, +697,697,697,697,697,697,119,119,119,119,119,119,119,119,119,119, +697,697,697,697,697,697,697,697,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 151 */ -636,636,636,636,636,636,636,636,636,636,636,636,636,636,636,636, -636,636,636,636,636,636,636,636,636,636,636,636,636,636,636,116, -116,116,116,116,116,116,116,637,637,637,637,637,637,637,637,637, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -638,638,638,638,638,638,638,638,638,638,638,638,638,638,638,638, -638,638,638,116,638,638,116,116,116,116,116,639,639,639,639,639, +698,698,698,698,698,698,119,119,698,119,698,698,698,698,698,698, +698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698, +698,698,698,698,698,698,698,698,698,698,698,698,698,698,698,698, +698,698,698,698,698,698,119,698,698,119,119,119,698,119,119,698, +699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699, +699,699,699,699,699,699,119,700,701,701,701,701,701,701,701,701, +702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702, +702,702,702,702,702,702,702,703,703,704,704,704,704,704,704,704, /* block 152 */ -640,640,640,640,640,640,640,640,640,640,640,640,640,640,640,640, -640,640,640,640,640,640,641,641,641,641,641,641,116,116,116,642, -643,643,643,643,643,643,643,643,643,643,643,643,643,643,643,643, -643,643,643,643,643,643,643,643,643,643,116,116,116,116,116,644, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705, +705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,119, +119,119,119,119,119,119,119,706,706,706,706,706,706,706,706,706, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +707,707,707,707,707,707,707,707,707,707,707,707,707,707,707,707, +707,707,707,119,707,707,119,119,119,119,119,708,708,708,708,708, /* block 153 */ -645,645,645,645,645,645,645,645,645,645,645,645,645,645,645,645, -645,645,645,645,645,645,645,645,645,645,645,645,645,645,645,645, -646,646,646,646,646,646,646,646,646,646,646,646,646,646,646,646, -646,646,646,646,646,646,646,646,116,116,116,116,647,647,646,646, -647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647, -116,116,647,647,647,647,647,647,647,647,647,647,647,647,647,647, -647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647, -647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647, +709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,709, +709,709,709,709,709,709,710,710,710,710,710,710,119,119,119,711, +712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,712, +712,712,712,712,712,712,712,712,712,712,119,119,119,119,119,713, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 154 */ -648,649,649,649,116,649,649,116,116,116,116,116,649,649,649,649, -648,648,648,648,116,648,648,648,116,648,648,648,648,648,648,648, -648,648,648,648,648,648,648,648,648,648,648,648,648,648,648,648, -648,648,648,648,648,648,116,116,649,649,649,116,116,116,116,649, -650,650,650,650,650,650,650,650,650,116,116,116,116,116,116,116, -651,651,651,651,651,651,651,651,651,116,116,116,116,116,116,116, -652,652,652,652,652,652,652,652,652,652,652,652,652,652,652,652, -652,652,652,652,652,652,652,652,652,652,652,652,652,653,653,654, +714,714,714,714,714,714,714,714,714,714,714,714,714,714,714,714, +714,714,714,714,714,714,714,714,714,714,714,714,714,714,714,714, +715,715,715,715,715,715,715,715,715,715,715,715,715,715,715,715, +715,715,715,715,715,715,715,715,119,119,119,119,716,716,715,715, +716,716,716,716,716,716,716,716,716,716,716,716,716,716,716,716, +119,119,716,716,716,716,716,716,716,716,716,716,716,716,716,716, +716,716,716,716,716,716,716,716,716,716,716,716,716,716,716,716, +716,716,716,716,716,716,716,716,716,716,716,716,716,716,716,716, /* block 155 */ -655,655,655,655,655,655,655,655,655,655,655,655,655,655,655,655, -655,655,655,655,655,655,655,655,655,655,655,655,655,656,656,656, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -657,657,657,657,657,657,657,657,658,657,657,657,657,657,657,657, -657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657, -657,657,657,657,657,659,659,116,116,116,116,660,660,660,660,660, -661,661,661,661,661,661,661,116,116,116,116,116,116,116,116,116, +717,718,718,718,119,718,718,119,119,119,119,119,718,718,718,718, +717,717,717,717,119,717,717,717,119,717,717,717,717,717,717,717, +717,717,717,717,717,717,717,717,717,717,717,717,717,717,717,717, +717,717,717,717,717,717,119,119,718,718,718,119,119,119,119,718, +719,719,719,719,719,719,719,719,719,119,119,119,119,119,119,119, +720,720,720,720,720,720,720,720,720,119,119,119,119,119,119,119, +721,721,721,721,721,721,721,721,721,721,721,721,721,721,721,721, +721,721,721,721,721,721,721,721,721,721,721,721,721,722,722,723, /* block 156 */ -662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,662, -662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,662, -662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,662, -662,662,662,662,662,662,116,116,116,663,663,663,663,663,663,663, -664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664, -664,664,664,664,664,664,116,116,665,665,665,665,665,665,665,665, -666,666,666,666,666,666,666,666,666,666,666,666,666,666,666,666, -666,666,666,116,116,116,116,116,667,667,667,667,667,667,667,667, +724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, +724,724,724,724,724,724,724,724,724,724,724,724,724,725,725,725, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +726,726,726,726,726,726,726,726,727,726,726,726,726,726,726,726, +726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726, +726,726,726,726,726,728,728,119,119,119,119,729,729,729,729,729, +730,730,730,730,730,730,730,119,119,119,119,119,119,119,119,119, /* block 157 */ -668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668, -668,668,116,116,116,116,116,116,116,669,669,669,669,116,116,116, -116,116,116,116,116,116,116,116,116,670,670,670,670,670,670,670, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731, +731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731, +731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731, +731,731,731,731,731,731,119,119,119,732,732,732,732,732,732,732, +733,733,733,733,733,733,733,733,733,733,733,733,733,733,733,733, +733,733,733,733,733,733,119,119,734,734,734,734,734,734,734,734, +735,735,735,735,735,735,735,735,735,735,735,735,735,735,735,735, +735,735,735,119,119,119,119,119,736,736,736,736,736,736,736,736, /* block 158 */ -671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671, -671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671, -671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671, -671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671, -671,671,671,671,671,671,671,671,671,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +737,737,737,737,737,737,737,737,737,737,737,737,737,737,737,737, +737,737,119,119,119,119,119,119,119,738,738,738,738,119,119,119, +119,119,119,119,119,119,119,119,119,739,739,739,739,739,739,739, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 159 */ -672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,672, -672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,672, -672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,672, -672,672,672,116,116,116,116,116,116,116,116,116,116,116,116,116, -673,673,673,673,673,673,673,673,673,673,673,673,673,673,673,673, -673,673,673,673,673,673,673,673,673,673,673,673,673,673,673,673, -673,673,673,673,673,673,673,673,673,673,673,673,673,673,673,673, -673,673,673,116,116,116,116,116,116,116,674,674,674,674,674,674, +740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, +740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, +740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, +740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, +740,740,740,740,740,740,740,740,740,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 160 */ -675,675,675,675,675,675,675,675,675,675,675,675,675,675,675,675, -675,675,675,675,675,675,675,675,675,675,675,675,675,675,675,675, -675,675,675,675,676,676,676,676,116,116,116,116,116,116,116,116, -677,677,677,677,677,677,677,677,677,677,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741, +741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741, +741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741, +741,741,741,119,119,119,119,119,119,119,119,119,119,119,119,119, +742,742,742,742,742,742,742,742,742,742,742,742,742,742,742,742, +742,742,742,742,742,742,742,742,742,742,742,742,742,742,742,742, +742,742,742,742,742,742,742,742,742,742,742,742,742,742,742,742, +742,742,742,119,119,119,119,119,119,119,743,743,743,743,743,743, /* block 161 */ -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -678,678,678,678,678,678,678,678,678,678,678,678,678,678,678,678, -678,678,678,678,678,678,678,678,678,678,678,678,678,678,678,116, +744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744, +744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744, +744,744,744,744,745,745,745,745,119,119,119,119,119,119,119,119, +746,746,746,746,746,746,746,746,746,746,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 162 */ -679,679,679,679,679,679,679,679,679,679,679,679,679,679,679,679, -679,679,679,679,679,679,679,679,679,679,679,679,679,680,680,680, -680,680,680,680,680,680,680,679,116,116,116,116,116,116,116,116, -681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681, -681,681,681,681,681,681,682,682,682,682,682,682,682,682,682,682, -682,683,683,683,683,684,684,684,684,684,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747, +747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,119, /* block 163 */ -685,686,685,687,687,687,687,687,687,687,687,687,687,687,687,687, -687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687, -687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687, -687,687,687,687,687,687,687,687,686,686,686,686,686,686,686,686, -686,686,686,686,686,686,686,688,688,688,688,688,688,688,116,116, -116,116,689,689,689,689,689,689,689,689,689,689,689,689,689,689, -689,689,689,689,689,689,690,690,690,690,690,690,690,690,690,690, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,686, +748,748,748,748,748,748,748,748,748,748,748,748,748,748,748,748, +748,748,748,748,748,748,748,748,748,748,748,748,748,749,749,749, +749,749,749,749,749,749,749,748,119,119,119,119,119,119,119,119, +750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750, +750,750,750,750,750,750,751,751,751,751,751,751,751,751,751,751, +751,752,752,752,752,753,753,753,753,753,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 164 */ -691,691,692,693,693,693,693,693,693,693,693,693,693,693,693,693, -693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693, -693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693, -692,692,692,691,691,691,691,692,692,691,691,694,694,695,694,694, -694,694,116,116,116,116,116,116,116,116,116,116,116,695,116,116, -696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696, -696,696,696,696,696,696,696,696,696,116,116,116,116,116,116,116, -697,697,697,697,697,697,697,697,697,697,116,116,116,116,116,116, +754,755,754,756,756,756,756,756,756,756,756,756,756,756,756,756, +756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756, +756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756, +756,756,756,756,756,756,756,756,755,755,755,755,755,755,755,755, +755,755,755,755,755,755,755,757,757,757,757,757,757,757,119,119, +119,119,758,758,758,758,758,758,758,758,758,758,758,758,758,758, +758,758,758,758,758,758,759,759,759,759,759,759,759,759,759,759, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,755, /* block 165 */ -698,698,698,699,699,699,699,699,699,699,699,699,699,699,699,699, -699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699, -699,699,699,699,699,699,699,698,698,698,698,698,700,698,698,698, -698,698,698,698,698,116,701,701,701,701,701,701,701,701,701,701, -702,702,702,702,699,700,700,116,116,116,116,116,116,116,116,116, -703,703,703,703,703,703,703,703,703,703,703,703,703,703,703,703, -703,703,703,703,703,703,703,703,703,703,703,703,703,703,703,703, -703,703,703,704,705,705,703,116,116,116,116,116,116,116,116,116, +760,760,761,762,762,762,762,762,762,762,762,762,762,762,762,762, +762,762,762,762,762,762,762,762,762,762,762,762,762,762,762,762, +762,762,762,762,762,762,762,762,762,762,762,762,762,762,762,762, +761,761,761,760,760,760,760,761,761,760,760,763,763,764,763,763, +763,763,119,119,119,119,119,119,119,119,119,119,119,764,119,119, +765,765,765,765,765,765,765,765,765,765,765,765,765,765,765,765, +765,765,765,765,765,765,765,765,765,119,119,119,119,119,119,119, +766,766,766,766,766,766,766,766,766,766,119,119,119,119,119,119, /* block 166 */ -706,706,707,708,708,708,708,708,708,708,708,708,708,708,708,708, -708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708, -708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708, -708,708,708,707,707,707,706,706,706,706,706,706,706,706,706,707, -707,708,709,709,708,710,710,710,710,706,706,706,706,710,116,116, -711,711,711,711,711,711,711,711,711,711,708,710,708,710,710,710, -116,712,712,712,712,712,712,712,712,712,712,712,712,712,712,712, -712,712,712,712,712,116,116,116,116,116,116,116,116,116,116,116, +767,767,767,768,768,768,768,768,768,768,768,768,768,768,768,768, +768,768,768,768,768,768,768,768,768,768,768,768,768,768,768,768, +768,768,768,768,768,768,768,767,767,767,767,767,769,767,767,767, +767,767,767,767,767,119,770,770,770,770,770,770,770,770,770,770, +771,771,771,771,768,769,769,119,119,119,119,119,119,119,119,119, +772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,772, +772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,772, +772,772,772,773,774,774,772,119,119,119,119,119,119,119,119,119, /* block 167 */ -713,713,713,713,713,713,713,713,713,713,713,713,713,713,713,713, -713,713,116,713,713,713,713,713,713,713,713,713,713,713,713,713, -713,713,713,713,713,713,713,713,713,713,713,713,714,714,714,715, -715,715,714,714,715,714,715,715,716,716,716,716,716,716,715,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +775,775,776,777,777,777,777,777,777,777,777,777,777,777,777,777, +777,777,777,777,777,777,777,777,777,777,777,777,777,777,777,777, +777,777,777,777,777,777,777,777,777,777,777,777,777,777,777,777, +777,777,777,776,776,776,775,775,775,775,775,775,775,775,775,776, +776,777,778,778,777,779,779,779,779,775,775,775,775,779,119,119, +780,780,780,780,780,780,780,780,780,780,777,779,777,779,779,779, +119,781,781,781,781,781,781,781,781,781,781,781,781,781,781,781, +781,781,781,781,781,119,119,119,119,119,119,119,119,119,119,119, /* block 168 */ -717,717,717,717,717,717,717,116,717,116,717,717,717,717,116,717, -717,717,717,717,717,717,717,717,717,717,717,717,717,717,116,717, -717,717,717,717,717,717,717,717,717,718,116,116,116,116,116,116, -719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719, -719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719, -719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,720, -721,721,721,720,720,720,720,720,720,720,720,116,116,116,116,116, -722,722,722,722,722,722,722,722,722,722,116,116,116,116,116,116, +782,782,782,782,782,782,782,782,782,782,782,782,782,782,782,782, +782,782,119,782,782,782,782,782,782,782,782,782,782,782,782,782, +782,782,782,782,782,782,782,782,782,782,782,782,783,783,783,784, +784,784,783,783,784,783,784,784,785,785,785,785,785,785,784,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 169 */ -723,723,724,724,116,725,725,725,725,725,725,725,725,116,116,725, -725,116,116,725,725,725,725,725,725,725,725,725,725,725,725,725, -725,725,725,725,725,725,725,725,725,116,725,725,725,725,725,725, -725,116,725,725,116,725,725,725,725,725,116,111,723,725,726,724, -723,724,724,724,724,116,116,724,724,116,116,724,724,724,116,116, -725,116,116,116,116,116,116,726,116,116,116,116,116,725,725,725, -725,725,724,724,116,116,723,723,723,723,723,723,723,116,116,116, -723,723,723,723,723,116,116,116,116,116,116,116,116,116,116,116, +786,786,786,786,786,786,786,119,786,119,786,786,786,786,119,786, +786,786,786,786,786,786,786,786,786,786,786,786,786,786,119,786, +786,786,786,786,786,786,786,786,786,787,119,119,119,119,119,119, +788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788, +788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788, +788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,789, +790,790,790,789,789,789,789,789,789,789,789,119,119,119,119,119, +791,791,791,791,791,791,791,791,791,791,119,119,119,119,119,119, /* block 170 */ -727,727,727,727,727,727,727,727,727,727,727,727,727,727,727,727, -727,727,727,727,727,727,727,727,727,727,727,727,727,727,727,727, -727,727,727,727,727,727,727,727,727,727,727,727,727,727,727,727, -727,727,727,727,727,728,728,728,729,729,729,729,729,729,729,729, -728,728,729,729,729,728,729,727,727,727,727,730,730,730,730,730, -731,731,731,731,731,731,731,731,731,731,116,730,116,730,729,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +792,793,794,795,119,796,796,796,796,796,796,796,796,119,119,796, +796,119,119,796,796,796,796,796,796,796,796,796,796,796,796,796, +796,796,796,796,796,796,796,796,796,119,796,796,796,796,796,796, +796,119,796,796,119,796,796,796,796,796,119,797,793,796,798,794, +792,794,794,794,794,119,119,794,794,119,119,794,794,794,119,119, +796,119,119,119,119,119,119,798,119,119,119,119,119,796,796,796, +796,796,794,794,119,119,792,792,792,792,792,792,792,119,119,119, +792,792,792,792,792,119,119,119,119,119,119,119,119,119,119,119, /* block 171 */ -732,732,732,732,732,732,732,732,732,732,732,732,732,732,732,732, -732,732,732,732,732,732,732,732,732,732,732,732,732,732,732,732, -732,732,732,732,732,732,732,732,732,732,732,732,732,732,732,732, -733,734,734,735,735,735,735,735,735,734,735,734,734,733,734,735, -735,734,735,735,732,732,736,732,116,116,116,116,116,116,116,116, -737,737,737,737,737,737,737,737,737,737,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +799,799,799,799,799,799,799,799,799,799,799,799,799,799,799,799, +799,799,799,799,799,799,799,799,799,799,799,799,799,799,799,799, +799,799,799,799,799,799,799,799,799,799,799,799,799,799,799,799, +799,799,799,799,799,800,800,800,801,801,801,801,801,801,801,801, +800,800,801,801,801,800,801,799,799,799,799,802,802,802,802,802, +803,803,803,803,803,803,803,803,803,803,119,802,119,802,801,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 172 */ -738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,738, -738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,738, -738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,739, -740,740,741,741,741,741,116,116,740,740,740,740,741,741,740,741, -741,742,742,742,742,742,742,742,742,742,742,742,742,742,742,742, -742,742,742,742,742,742,742,742,738,738,738,738,741,741,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804, +804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804, +804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804, +805,806,806,807,807,807,807,807,807,806,807,806,806,805,806,807, +807,806,807,807,804,804,808,804,119,119,119,119,119,119,119,119, +809,809,809,809,809,809,809,809,809,809,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 173 */ -743,743,743,743,743,743,743,743,743,743,743,743,743,743,743,743, -743,743,743,743,743,743,743,743,743,743,743,743,743,743,743,743, -743,743,743,743,743,743,743,743,743,743,743,743,743,743,743,743, -744,744,744,745,745,745,745,745,745,745,745,744,744,745,744,745, -745,746,746,746,743,116,116,116,116,116,116,116,116,116,116,116, -747,747,747,747,747,747,747,747,747,747,116,116,116,116,116,116, -373,373,373,373,373,373,373,373,373,373,373,373,373,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +810,810,810,810,810,810,810,810,810,810,810,810,810,810,810,810, +810,810,810,810,810,810,810,810,810,810,810,810,810,810,810,810, +810,810,810,810,810,810,810,810,810,810,810,810,810,810,810,811, +812,812,813,813,813,813,119,119,812,812,812,812,813,813,812,813, +813,814,814,814,814,814,814,814,814,814,814,814,814,814,814,814, +814,814,814,814,814,814,814,814,810,810,810,810,813,813,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 174 */ -748,748,748,748,748,748,748,748,748,748,748,748,748,748,748,748, -748,748,748,748,748,748,748,748,748,748,748,748,748,748,748,748, -748,748,748,748,748,748,748,748,748,748,748,749,750,749,750,750, -749,749,749,749,749,749,750,749,116,116,116,116,116,116,116,116, -751,751,751,751,751,751,751,751,751,751,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +815,815,815,815,815,815,815,815,815,815,815,815,815,815,815,815, +815,815,815,815,815,815,815,815,815,815,815,815,815,815,815,815, +815,815,815,815,815,815,815,815,815,815,815,815,815,815,815,815, +816,816,816,817,817,817,817,817,817,817,817,816,816,817,816,817, +817,818,818,818,815,119,119,119,119,119,119,119,119,119,119,119, +819,819,819,819,819,819,819,819,819,819,119,119,119,119,119,119, +392,392,392,392,392,392,392,392,392,392,392,392,392,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 175 */ -752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752, -752,752,752,752,752,752,752,752,752,752,752,116,116,753,753,753, -754,754,753,753,753,753,754,753,753,753,753,753,116,116,116,116, -755,755,755,755,755,755,755,755,755,755,756,756,757,757,757,758, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820, +820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820, +820,820,820,820,820,820,820,820,820,820,820,821,822,821,822,822, +821,821,821,821,821,821,822,821,119,119,119,119,119,119,119,119, +823,823,823,823,823,823,823,823,823,823,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 176 */ -759,759,759,759,759,759,759,759,759,759,759,759,759,759,759,759, -759,759,759,759,759,759,759,759,759,759,759,759,759,759,759,759, -759,759,759,759,759,759,759,759,759,759,759,759,760,760,760,761, -761,761,761,761,761,761,761,761,760,761,761,762,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +824,824,824,824,824,824,824,824,824,824,824,824,824,824,824,824, +824,824,824,824,824,824,824,824,824,824,824,119,119,825,825,825, +826,826,825,825,825,825,826,825,825,825,825,825,119,119,119,119, +827,827,827,827,827,827,827,827,827,827,828,828,829,829,829,830, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 177 */ -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -763,763,763,763,763,763,763,763,763,763,763,763,763,763,763,763, -763,763,763,763,763,763,763,763,763,763,763,763,763,763,763,763, -764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764, -764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764, -765,765,765,765,765,765,765,765,765,765,766,766,766,766,766,766, -766,766,766,116,116,116,116,116,116,116,116,116,116,116,116,767, +831,831,831,831,831,831,831,831,831,831,831,831,831,831,831,831, +831,831,831,831,831,831,831,831,831,831,831,831,831,831,831,831, +831,831,831,831,831,831,831,831,831,831,831,831,832,832,832,833, +833,833,833,833,833,833,833,833,832,833,833,834,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 178 */ -768,769,769,769,769,769,769,769,769,769,769,768,768,768,768,768, -768,768,768,768,768,768,768,768,768,768,768,768,768,768,768,768, -768,768,768,768,768,768,768,768,768,768,768,768,768,768,768,768, -768,768,768,769,769,769,769,769,769,770,771,769,769,769,769,772, -772,772,772,772,772,772,772,769,116,116,116,116,116,116,116,116, -773,774,774,774,774,774,774,775,775,774,774,774,773,773,773,773, -773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773, -773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +835,835,835,835,835,835,835,835,835,835,835,835,835,835,835,835, +835,835,835,835,835,835,835,835,835,835,835,835,835,835,835,835, +836,836,836,836,836,836,836,836,836,836,836,836,836,836,836,836, +836,836,836,836,836,836,836,836,836,836,836,836,836,836,836,836, +837,837,837,837,837,837,837,837,837,837,838,838,838,838,838,838, +838,838,838,119,119,119,119,119,119,119,119,119,119,119,119,839, /* block 179 */ -773,773,773,773,116,116,776,776,776,776,774,774,774,774,774,774, -774,774,774,774,774,774,774,775,774,774,777,777,777,773,777,777, -777,777,777,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -778,778,778,778,778,778,778,778,778,778,778,778,778,778,778,778, -778,778,778,778,778,778,778,778,778,778,778,778,778,778,778,778, -778,778,778,778,778,778,778,778,778,778,778,778,778,778,778,778, -778,778,778,778,778,778,778,778,778,116,116,116,116,116,116,116, +840,841,841,841,841,841,841,841,841,841,841,840,840,840,840,840, +840,840,840,840,840,840,840,840,840,840,840,840,840,840,840,840, +840,840,840,840,840,840,840,840,840,840,840,840,840,840,840,840, +840,840,840,841,841,841,841,841,841,842,843,841,841,841,841,844, +844,844,844,844,844,844,844,841,119,119,119,119,119,119,119,119, +845,846,846,846,846,846,846,847,847,846,846,846,845,845,845,845, +845,845,845,845,845,845,845,845,845,845,845,845,845,845,845,845, +845,845,845,845,845,845,845,845,845,845,845,845,845,845,845,845, /* block 180 */ -779,779,779,779,779,779,779,779,779,116,779,779,779,779,779,779, -779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779, -779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,780, -781,781,781,781,781,781,781,116,781,781,781,781,781,781,780,781, -779,782,782,782,782,782,116,116,116,116,116,116,116,116,116,116, -783,783,783,783,783,783,783,783,783,783,784,784,784,784,784,784, -784,784,784,784,784,784,784,784,784,784,784,784,784,116,116,116, -785,785,786,786,786,786,786,786,786,786,786,786,786,786,786,786, +845,845,845,845,119,119,848,848,848,848,846,846,846,846,846,846, +846,846,846,846,846,846,846,847,846,846,849,849,849,845,849,849, +849,849,849,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850, +850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850, +850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850, +850,850,850,850,850,850,850,850,850,119,119,119,119,119,119,119, /* block 181 */ -786,786,786,786,786,786,786,786,786,786,786,786,786,786,786,786, -116,116,787,787,787,787,787,787,787,787,787,787,787,787,787,787, -787,787,787,787,787,787,787,787,116,788,787,787,787,787,787,787, -787,788,787,787,788,787,787,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +851,851,851,851,851,851,851,851,851,119,851,851,851,851,851,851, +851,851,851,851,851,851,851,851,851,851,851,851,851,851,851,851, +851,851,851,851,851,851,851,851,851,851,851,851,851,851,851,852, +853,853,853,853,853,853,853,119,853,853,853,853,853,853,852,853, +851,854,854,854,854,854,119,119,119,119,119,119,119,119,119,119, +855,855,855,855,855,855,855,855,855,855,856,856,856,856,856,856, +856,856,856,856,856,856,856,856,856,856,856,856,856,119,119,119, +857,857,858,858,858,858,858,858,858,858,858,858,858,858,858,858, /* block 182 */ -789,789,789,789,789,789,789,116,789,789,116,789,789,789,789,789, -789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, -789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, -789,790,790,790,790,790,790,116,116,116,790,116,790,790,116,790, -790,790,790,790,790,790,791,790,116,116,116,116,116,116,116,116, -792,792,792,792,792,792,792,792,792,792,116,116,116,116,116,116, -793,793,793,793,793,793,116,793,793,116,793,793,793,793,793,793, -793,793,793,793,793,793,793,793,793,793,793,793,793,793,793,793, +858,858,858,858,858,858,858,858,858,858,858,858,858,858,858,858, +119,119,859,859,859,859,859,859,859,859,859,859,859,859,859,859, +859,859,859,859,859,859,859,859,119,860,859,859,859,859,859,859, +859,860,859,859,860,859,859,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 183 */ -793,793,793,793,793,793,793,793,793,793,794,794,794,794,794,116, -795,795,116,794,794,795,794,795,793,116,116,116,116,116,116,116, -796,796,796,796,796,796,796,796,796,796,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +861,861,861,861,861,861,861,119,861,861,119,861,861,861,861,861, +861,861,861,861,861,861,861,861,861,861,861,861,861,861,861,861, +861,861,861,861,861,861,861,861,861,861,861,861,861,861,861,861, +861,862,862,862,862,862,862,119,119,119,862,119,862,862,119,862, +862,862,862,862,862,862,863,862,119,119,119,119,119,119,119,119, +864,864,864,864,864,864,864,864,864,864,119,119,119,119,119,119, +865,865,865,865,865,865,119,865,865,119,865,865,865,865,865,865, +865,865,865,865,865,865,865,865,865,865,865,865,865,865,865,865, /* block 184 */ -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797, -797,797,797,798,798,799,799,800,800,116,116,116,116,116,116,116, +865,865,865,865,865,865,865,865,865,865,866,866,866,866,866,119, +867,867,119,866,866,867,866,867,865,119,119,119,119,119,119,119, +868,868,868,868,868,868,868,868,868,868,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 185 */ -801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801, -801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801, -801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801, -801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801, -801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801, -801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801, -801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801, -801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +869,869,869,869,869,869,869,869,869,869,869,869,869,869,869,869, +869,869,869,870,870,871,871,872,872,119,119,119,119,119,119,119, /* block 186 */ -801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801, -801,801,801,801,801,801,801,801,801,801,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +873,873,873,873,873,873,873,873,873,873,873,873,873,873,873,873, +873,873,873,873,873,873,873,873,873,873,873,873,873,873,873,873, +873,873,873,873,873,873,873,873,873,873,873,873,873,873,873,873, +873,873,873,873,873,873,873,873,873,873,873,873,873,873,873,873, +873,873,873,873,873,873,873,873,873,873,873,873,873,873,873,873, +873,873,873,873,873,873,873,873,873,873,873,873,873,873,873,873, +873,873,873,873,873,873,873,873,873,873,873,873,873,873,873,873, +873,873,873,873,873,873,873,873,873,873,873,873,873,873,873,873, /* block 187 */ -802,802,802,802,802,802,802,802,802,802,802,802,802,802,802,802, -802,802,802,802,802,802,802,802,802,802,802,802,802,802,802,802, -802,802,802,802,802,802,802,802,802,802,802,802,802,802,802,802, -802,802,802,802,802,802,802,802,802,802,802,802,802,802,802,802, -802,802,802,802,802,802,802,802,802,802,802,802,802,802,802,802, -802,802,802,802,802,802,802,802,802,802,802,802,802,802,802,802, -802,802,802,802,802,802,802,802,802,802,802,802,802,802,802,116, -803,803,803,803,803,116,116,116,116,116,116,116,116,116,116,116, +873,873,873,873,873,873,873,873,873,873,873,873,873,873,873,873, +873,873,873,873,873,873,873,873,873,873,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 188 */ -801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801, -801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801, -801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801, -801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801, -801,801,801,801,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +874,874,874,874,874,874,874,874,874,874,874,874,874,874,874,874, +874,874,874,874,874,874,874,874,874,874,874,874,874,874,874,874, +874,874,874,874,874,874,874,874,874,874,874,874,874,874,874,874, +874,874,874,874,874,874,874,874,874,874,874,874,874,874,874,874, +874,874,874,874,874,874,874,874,874,874,874,874,874,874,874,874, +874,874,874,874,874,874,874,874,874,874,874,874,874,874,874,874, +874,874,874,874,874,874,874,874,874,874,874,874,874,874,874,119, +875,875,875,875,875,119,119,119,119,119,119,119,119,119,119,119, /* block 189 */ -804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804, -804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804, -804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804, -804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804, -804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804, -804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804, -804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804, -804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804, +873,873,873,873,873,873,873,873,873,873,873,873,873,873,873,873, +873,873,873,873,873,873,873,873,873,873,873,873,873,873,873,873, +873,873,873,873,873,873,873,873,873,873,873,873,873,873,873,873, +873,873,873,873,873,873,873,873,873,873,873,873,873,873,873,873, +873,873,873,873,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 190 */ -804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804, -804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804, -804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +876,876,876,876,876,876,876,876,876,876,876,876,876,876,876,876, +876,876,876,876,876,876,876,876,876,876,876,876,876,876,876,876, +876,876,876,876,876,876,876,876,876,876,876,876,876,876,876,876, +876,876,876,876,876,876,876,876,876,876,876,876,876,876,876,876, +876,876,876,876,876,876,876,876,876,876,876,876,876,876,876,876, +876,876,876,876,876,876,876,876,876,876,876,876,876,876,876,876, +876,876,876,876,876,876,876,876,876,876,876,876,876,876,876,876, +876,876,876,876,876,876,876,876,876,876,876,876,876,876,876,876, /* block 191 */ -805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805, -805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805, -805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805, -805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805, -805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805, -805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805, -805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805, -805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805, +876,876,876,876,876,876,876,876,876,876,876,876,876,876,876,876, +876,876,876,876,876,876,876,876,876,876,876,876,876,876,876,876, +876,876,876,876,876,876,876,876,876,876,876,876,876,876,876,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 192 */ -805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805, -805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805, -805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805, -805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805, -805,805,805,805,805,805,805,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +877,877,877,877,877,877,877,877,877,877,877,877,877,877,877,877, +877,877,877,877,877,877,877,877,877,877,877,877,877,877,877,877, +877,877,877,877,877,877,877,877,877,877,877,877,877,877,877,877, +877,877,877,877,877,877,877,877,877,877,877,877,877,877,877,877, +877,877,877,877,877,877,877,877,877,877,877,877,877,877,877,877, +877,877,877,877,877,877,877,877,877,877,877,877,877,877,877,877, +877,877,877,877,877,877,877,877,877,877,877,877,877,877,877,877, +877,877,877,877,877,877,877,877,877,877,877,877,877,877,877,877, /* block 193 */ -538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538, -538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538, -538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538, -538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538, -538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538, -538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538, -538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538, -538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538, +877,877,877,877,877,877,877,877,877,877,877,877,877,877,877,877, +877,877,877,877,877,877,877,877,877,877,877,877,877,877,877,877, +877,877,877,877,877,877,877,877,877,877,877,877,877,877,877,877, +877,877,877,877,877,877,877,877,877,877,877,877,877,877,877,877, +877,877,877,877,877,877,877,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 194 */ -538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538, -538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538, -538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538, -538,538,538,538,538,538,538,538,538,116,116,116,116,116,116,116, -806,806,806,806,806,806,806,806,806,806,806,806,806,806,806,806, -806,806,806,806,806,806,806,806,806,806,806,806,806,806,806,116, -807,807,807,807,807,807,807,807,807,807,116,116,116,116,808,808, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592, +592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592, +592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592, +592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592, +592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592, +592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592, +592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592, +592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592, /* block 195 */ -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -809,809,809,809,809,809,809,809,809,809,809,809,809,809,809,809, -809,809,809,809,809,809,809,809,809,809,809,809,809,809,116,116, -810,810,810,810,810,811,116,116,116,116,116,116,116,116,116,116, +592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592, +592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592, +592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592, +592,592,592,592,592,592,592,592,592,119,119,119,119,119,119,119, +878,878,878,878,878,878,878,878,878,878,878,878,878,878,878,878, +878,878,878,878,878,878,878,878,878,878,878,878,878,878,878,119, +879,879,879,879,879,879,879,879,879,879,119,119,119,119,880,880, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 196 */ -812,812,812,812,812,812,812,812,812,812,812,812,812,812,812,812, -812,812,812,812,812,812,812,812,812,812,812,812,812,812,812,812, -812,812,812,812,812,812,812,812,812,812,812,812,812,812,812,812, -813,813,813,813,813,813,813,814,814,814,814,814,815,815,815,815, -816,816,816,816,814,815,116,116,116,116,116,116,116,116,116,116, -817,817,817,817,817,817,817,817,817,817,116,818,818,818,818,818, -818,818,116,812,812,812,812,812,812,812,812,812,812,812,812,812, -812,812,812,812,812,812,812,812,116,116,116,116,116,812,812,812, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +881,881,881,881,881,881,881,881,881,881,881,881,881,881,881,881, +881,881,881,881,881,881,881,881,881,881,881,881,881,881,119,119, +882,882,882,882,882,883,119,119,119,119,119,119,119,119,119,119, /* block 197 */ -812,812,812,812,812,812,812,812,812,812,812,812,812,812,812,812, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +884,884,884,884,884,884,884,884,884,884,884,884,884,884,884,884, +884,884,884,884,884,884,884,884,884,884,884,884,884,884,884,884, +884,884,884,884,884,884,884,884,884,884,884,884,884,884,884,884, +885,885,885,885,885,885,885,886,886,886,886,886,887,887,887,887, +888,888,888,888,886,887,119,119,119,119,119,119,119,119,119,119, +889,889,889,889,889,889,889,889,889,889,119,890,890,890,890,890, +890,890,119,884,884,884,884,884,884,884,884,884,884,884,884,884, +884,884,884,884,884,884,884,884,119,119,119,119,119,884,884,884, /* block 198 */ -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -819,819,819,819,819,819,819,819,819,819,819,819,819,819,819,819, -819,819,819,819,819,819,819,819,819,819,819,819,819,819,819,819, -820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820, -820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820, +884,884,884,884,884,884,884,884,884,884,884,884,884,884,884,884, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 199 */ -821,821,821,821,821,821,821,821,821,821,821,821,821,821,821,821, -821,821,821,821,821,821,821,822,822,822,822,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +891,891,891,891,891,891,891,891,891,891,891,891,891,891,891,891, +891,891,891,891,891,891,891,891,891,891,891,891,891,891,891,891, +892,892,892,892,892,892,892,892,892,892,892,892,892,892,892,892, +892,892,892,892,892,892,892,892,892,892,892,892,892,892,892,892, /* block 200 */ -823,823,823,823,823,823,823,823,823,823,823,823,823,823,823,823, -823,823,823,823,823,823,823,823,823,823,823,823,823,823,823,823, -823,823,823,823,823,823,823,823,823,823,823,823,823,823,823,823, -823,823,823,823,823,823,823,823,823,823,823,823,823,823,823,823, -823,823,823,823,823,116,116,116,116,116,116,116,116,116,116,116, -823,824,824,824,824,824,824,824,824,824,824,824,824,824,824,824, -824,824,824,824,824,824,824,824,824,824,824,824,824,824,824,824, -824,824,824,824,824,824,824,824,824,824,824,824,824,824,824,116, +893,893,893,893,893,893,893,893,893,893,893,893,893,893,893,893, +893,893,893,893,893,893,893,894,894,894,894,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 201 */ -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,825, -825,825,825,826,826,826,826,826,826,826,826,826,826,826,826,826, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -827,828,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895, +895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895, +895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895, +895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895, +895,895,895,895,895,119,119,119,119,119,119,119,119,119,119,119, +895,896,896,896,896,896,896,896,896,896,896,896,896,896,896,896, +896,896,896,896,896,896,896,896,896,896,896,896,896,896,896,896, +896,896,896,896,896,896,896,896,896,896,896,896,896,896,896,119, /* block 202 */ -829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, -829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, -829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, -829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, -829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, -829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, -829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, -829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,897, +897,897,897,898,898,898,898,898,898,898,898,898,898,898,898,898, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +899,900,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 203 */ -829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, -829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, -829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, -829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, -829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, -829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, -829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, -829,829,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +901,901,901,901,901,901,901,901,901,901,901,901,901,901,901,901, +901,901,901,901,901,901,901,901,901,901,901,901,901,901,901,901, +901,901,901,901,901,901,901,901,901,901,901,901,901,901,901,901, +901,901,901,901,901,901,901,901,901,901,901,901,901,901,901,901, +901,901,901,901,901,901,901,901,901,901,901,901,901,901,901,901, +901,901,901,901,901,901,901,901,901,901,901,901,901,901,901,901, +901,901,901,901,901,901,901,901,901,901,901,901,901,901,901,901, +901,901,901,901,901,901,901,901,901,901,901,901,901,901,901,901, /* block 204 */ -829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, -829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, -829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, -829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, -829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, -829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, -829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, -829,829,829,116,116,116,116,116,116,116,116,116,116,116,116,116, +901,901,901,901,901,901,901,901,901,901,901,901,901,901,901,901, +901,901,901,901,901,901,901,901,901,901,901,901,901,901,901,901, +901,901,901,901,901,901,901,901,901,901,901,901,901,901,901,901, +901,901,901,901,901,901,901,901,901,901,901,901,901,901,901,901, +901,901,901,901,901,901,901,901,901,901,901,901,901,901,901,901, +901,901,901,901,901,901,901,901,901,901,901,901,901,901,901,901, +901,901,901,901,901,901,901,901,901,901,901,901,901,901,901,901, +901,901,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 205 */ -517,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, +901,901,901,901,901,901,901,901,901,901,901,901,901,901,901,901, +901,901,901,901,901,901,901,901,901,901,901,901,901,901,901,901, +901,901,901,901,901,901,901,901,901,901,901,901,901,901,901,901, +901,901,901,901,901,901,901,901,901,901,901,901,901,901,901,901, +901,901,901,901,901,901,901,901,901,901,901,901,901,901,901,901, +901,901,901,901,901,901,901,901,901,901,901,901,901,901,901,901, +901,901,901,901,901,901,901,901,901,901,901,901,901,901,901,901, +901,901,901,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 206 */ -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, +569,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564, +564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564, +564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564, +564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564, +564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564, +564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564, +564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564, +564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564, /* block 207 */ -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, +564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564, +564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564, +564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564, +564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564, +564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564, +564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564, +564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564, +564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564, /* block 208 */ -830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, -830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, -830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, -830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, -830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, -830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, -830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, -830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, +564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564, +564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +902,902,902,902,902,902,902,902,902,902,902,902,902,902,902,902, /* block 209 */ -830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, -830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, -830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, -830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, -830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, -830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, -830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, -830,830,830,830,830,830,830,830,830,830,830,830,116,116,116,116, +902,902,902,902,902,902,902,902,902,902,902,902,902,902,902,902, +902,902,902,902,902,902,902,902,902,902,902,902,902,902,902,902, +902,902,902,902,902,902,902,902,902,902,902,902,902,902,902,902, +902,902,902,902,902,902,902,902,902,902,902,902,902,902,902,902, +902,902,902,902,902,902,902,902,902,902,902,902,902,902,902,902, +902,902,902,902,902,902,902,902,902,902,902,902,902,902,902,902, +902,902,902,902,902,902,902,902,902,902,902,902,902,902,902,902, +902,902,902,902,902,902,902,902,902,902,902,902,902,902,902,902, /* block 210 */ -831,831,831,831,831,831,831,831,831,831,831,831,831,831,831,831, -831,831,831,831,831,831,831,831,831,831,831,831,831,831,831,831, -831,831,831,831,831,831,831,831,831,831,831,831,831,831,831,831, -831,831,831,831,831,831,831,831,831,831,831,831,831,831,831,831, -831,831,831,831,831,831,831,831,831,831,831,831,831,831,831,831, -831,831,831,831,831,831,831,831,831,831,831,831,831,831,831,831, -831,831,831,831,831,831,831,831,831,831,831,116,116,116,116,116, -831,831,831,831,831,831,831,831,831,831,831,831,831,116,116,116, +902,902,902,902,902,902,902,902,902,902,902,902,902,902,902,902, +902,902,902,902,902,902,902,902,902,902,902,902,902,902,902,902, +902,902,902,902,902,902,902,902,902,902,902,902,902,902,902,902, +902,902,902,902,902,902,902,902,902,902,902,902,902,902,902,902, +902,902,902,902,902,902,902,902,902,902,902,902,902,902,902,902, +902,902,902,902,902,902,902,902,902,902,902,902,902,902,902,902, +902,902,902,902,902,902,902,902,902,902,902,902,902,902,902,902, +902,902,902,902,902,902,902,902,902,902,902,902,119,119,119,119, /* block 211 */ -831,831,831,831,831,831,831,831,831,116,116,116,116,116,116,116, -831,831,831,831,831,831,831,831,831,831,116,116,832,833,833,834, - 23, 23, 23, 23,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +903,903,903,903,903,903,903,903,903,903,903,903,903,903,903,903, +903,903,903,903,903,903,903,903,903,903,903,903,903,903,903,903, +903,903,903,903,903,903,903,903,903,903,903,903,903,903,903,903, +903,903,903,903,903,903,903,903,903,903,903,903,903,903,903,903, +903,903,903,903,903,903,903,903,903,903,903,903,903,903,903,903, +903,903,903,903,903,903,903,903,903,903,903,903,903,903,903,903, +903,903,903,903,903,903,903,903,903,903,903,119,119,119,119,119, +903,903,903,903,903,903,903,903,903,903,903,903,903,119,119,119, /* block 212 */ - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19,116,116,116,116,116,116,116,116,116,116, +903,903,903,903,903,903,903,903,903,119,119,119,119,119,119,119, +903,903,903,903,903,903,903,903,903,903,119,119,904,905,905,906, +907,907,907,907,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 213 */ - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19,116,116, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19,835,438,111,111,111, 19, 19, 19,438,835,835, -835,835,835, 23, 23, 23, 23, 23, 23, 23, 23,111,111,111,111,111, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20,119,119,119,119,119,119,119,119,119,119, /* block 214 */ -111,111,111, 19, 19,111,111,111,111,111,111,111, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,111,111,111,111, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20,119,119, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20,908,909,112,112,112, 20, 20, 20,909,908,908, +908,908,908, 24, 24, 24, 24, 24, 24, 24, 24,112,112,112,112,112, /* block 215 */ -604,604,604,604,604,604,604,604,604,604,604,604,604,604,604,604, -604,604,604,604,604,604,604,604,604,604,604,604,604,604,604,604, -604,604,604,604,604,604,604,604,604,604,604,604,604,604,604,604, -604,604,604,604,604,604,604,604,604,604,604,604,604,604,604,604, -604,604,836,836,836,604,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +112,112,112, 20, 20,112,112,112,112,112,112,112, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,112,112,112,112, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 216 */ -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24,116,116,116,116,116,116,116,116,116,116,116,116, +671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671, +671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671, +671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671, +671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671, +671,671,910,910,910,671,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 217 */ - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19,116,116,116,116,116,116,116,116,116, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24,116,116,116,116,116,116,116, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25,119,119,119,119,119,119,119,119,119,119,119,119, /* block 218 */ -472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472, -472,472,472,472,472,472,472,472,472,472,473,473,473,473,473,473, -473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473, -473,473,473,473,472,472,472,472,472,472,472,472,472,472,472,472, -472,472,472,472,472,472,472,472,472,472,472,472,472,472,473,473, -473,473,473,473,473,116,473,473,473,473,473,473,473,473,473,473, -473,473,473,473,473,473,473,473,472,472,472,472,472,472,472,472, -472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20,119,119,119,119,119,119,119,119,119, +573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573, +573,573, 25, 25, 25, 25, 25, 25, 25,119,119,119,119,119,119,119, /* block 219 */ -472,472,473,473,473,473,473,473,473,473,473,473,473,473,473,473, -473,473,473,473,473,473,473,473,473,473,473,473,472,116,472,472, -116,116,472,116,116,472,472,116,116,472,472,472,472,116,472,472, -472,472,472,472,472,472,473,473,473,473,116,473,116,473,473,473, -473,473,473,473,116,473,473,473,473,473,473,473,473,473,473,473, -472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472, -472,472,472,472,472,472,472,472,472,472,473,473,473,473,473,473, -473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473, +504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, +504,504,504,504,504,504,504,504,504,504,505,505,505,505,505,505, +505,505,505,505,505,505,505,505,505,505,505,505,505,505,505,505, +505,505,505,505,504,504,504,504,504,504,504,504,504,504,504,504, +504,504,504,504,504,504,504,504,504,504,504,504,504,504,505,505, +505,505,505,505,505,119,505,505,505,505,505,505,505,505,505,505, +505,505,505,505,505,505,505,505,504,504,504,504,504,504,504,504, +504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, /* block 220 */ -473,473,473,473,472,472,116,472,472,472,472,116,116,472,472,472, -472,472,472,472,472,116,472,472,472,472,472,472,472,116,473,473, -473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473, -473,473,473,473,473,473,473,473,472,472,116,472,472,472,472,116, -472,472,472,472,472,116,472,116,116,116,472,472,472,472,472,472, -472,116,473,473,473,473,473,473,473,473,473,473,473,473,473,473, -473,473,473,473,473,473,473,473,473,473,473,473,472,472,472,472, -472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472, +504,504,505,505,505,505,505,505,505,505,505,505,505,505,505,505, +505,505,505,505,505,505,505,505,505,505,505,505,504,119,504,504, +119,119,504,119,119,504,504,119,119,504,504,504,504,119,504,504, +504,504,504,504,504,504,505,505,505,505,119,505,119,505,505,505, +505,505,505,505,119,505,505,505,505,505,505,505,505,505,505,505, +504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, +504,504,504,504,504,504,504,504,504,504,505,505,505,505,505,505, +505,505,505,505,505,505,505,505,505,505,505,505,505,505,505,505, /* block 221 */ -472,472,472,472,472,472,473,473,473,473,473,473,473,473,473,473, -473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473, -472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472, -472,472,472,472,472,472,472,472,472,472,473,473,473,473,473,473, -473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473, -473,473,473,473,472,472,472,472,472,472,472,472,472,472,472,472, -472,472,472,472,472,472,472,472,472,472,472,472,472,472,473,473, -473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473, +505,505,505,505,504,504,119,504,504,504,504,119,119,504,504,504, +504,504,504,504,504,119,504,504,504,504,504,504,504,119,505,505, +505,505,505,505,505,505,505,505,505,505,505,505,505,505,505,505, +505,505,505,505,505,505,505,505,504,504,119,504,504,504,504,119, +504,504,504,504,504,119,504,119,119,119,504,504,504,504,504,504, +504,119,505,505,505,505,505,505,505,505,505,505,505,505,505,505, +505,505,505,505,505,505,505,505,505,505,505,505,504,504,504,504, +504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, /* block 222 */ -473,473,473,473,473,473,473,473,472,472,472,472,472,472,472,472, -472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472, -472,472,473,473,473,473,473,473,473,473,473,473,473,473,473,473, -473,473,473,473,473,473,473,473,473,473,473,473,472,472,472,472, -472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472, -472,472,472,472,472,472,473,473,473,473,473,473,473,473,473,473, -473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473, -472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472, +504,504,504,504,504,504,505,505,505,505,505,505,505,505,505,505, +505,505,505,505,505,505,505,505,505,505,505,505,505,505,505,505, +504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, +504,504,504,504,504,504,504,504,504,504,505,505,505,505,505,505, +505,505,505,505,505,505,505,505,505,505,505,505,505,505,505,505, +505,505,505,505,504,504,504,504,504,504,504,504,504,504,504,504, +504,504,504,504,504,504,504,504,504,504,504,504,504,504,505,505, +505,505,505,505,505,505,505,505,505,505,505,505,505,505,505,505, /* block 223 */ -472,472,472,472,472,472,472,472,472,472,473,473,473,473,473,473, -473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473, -473,473,473,473,473,473,116,116,472,472,472,472,472,472,472,472, -472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472, -472, 8,473,473,473,473,473,473,473,473,473,473,473,473,473,473, -473,473,473,473,473,473,473,473,473,473,473, 8,473,473,473,473, -473,473,472,472,472,472,472,472,472,472,472,472,472,472,472,472, -472,472,472,472,472,472,472,472,472,472,472, 8,473,473,473,473, +505,505,505,505,505,505,505,505,504,504,504,504,504,504,504,504, +504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, +504,504,505,505,505,505,505,505,505,505,505,505,505,505,505,505, +505,505,505,505,505,505,505,505,505,505,505,505,504,504,504,504, +504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, +504,504,504,504,504,504,505,505,505,505,505,505,505,505,505,505, +505,505,505,505,505,505,505,505,505,505,505,505,505,505,505,505, +504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, /* block 224 */ -473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473, -473,473,473,473,473, 8,473,473,473,473,473,473,472,472,472,472, -472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472, -472,472,472,472,472, 8,473,473,473,473,473,473,473,473,473,473, -473,473,473,473,473,473,473,473,473,473,473,473,473,473,473, 8, -473,473,473,473,473,473,472,472,472,472,472,472,472,472,472,472, -472,472,472,472,472,472,472,472,472,472,472,472,472,472,472, 8, -473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473, +504,504,504,504,504,504,504,504,504,504,505,505,505,505,505,505, +505,505,505,505,505,505,505,505,505,505,505,505,505,505,505,505, +505,505,505,505,505,505,119,119,504,504,504,504,504,504,504,504, +504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, +504, 9,505,505,505,505,505,505,505,505,505,505,505,505,505,505, +505,505,505,505,505,505,505,505,505,505,505, 9,505,505,505,505, +505,505,504,504,504,504,504,504,504,504,504,504,504,504,504,504, +504,504,504,504,504,504,504,504,504,504,504, 9,505,505,505,505, /* block 225 */ -473,473,473,473,473,473,473,473,473, 8,473,473,473,473,473,473, -472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472, -472,472,472,472,472,472,472,472,472, 8,473,473,473,473,473,473, -473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473, -473,473,473, 8,473,473,473,473,473,473,472,473,116,116, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, +505,505,505,505,505,505,505,505,505,505,505,505,505,505,505,505, +505,505,505,505,505, 9,505,505,505,505,505,505,504,504,504,504, +504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, +504,504,504,504,504, 9,505,505,505,505,505,505,505,505,505,505, +505,505,505,505,505,505,505,505,505,505,505,505,505,505,505, 9, +505,505,505,505,505,505,504,504,504,504,504,504,504,504,504,504, +504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, 9, +505,505,505,505,505,505,505,505,505,505,505,505,505,505,505,505, /* block 226 */ -837,837,837,837,837,837,837,837,837,837,837,837,837,837,837,837, -837,837,837,837,837,837,837,837,837,837,837,837,837,837,837,837, -837,837,837,837,837,837,837,837,837,837,837,837,837,837,837,837, -837,837,837,837,837,837,837,837,837,837,837,837,837,837,837,837, -837,837,837,837,837,837,837,837,837,837,837,837,837,837,837,837, -837,837,837,837,837,837,837,837,837,837,837,837,837,837,837,837, -837,837,837,837,837,837,837,837,837,837,837,837,837,837,837,837, -837,837,837,837,837,837,837,837,837,837,837,837,837,837,837,837, +505,505,505,505,505,505,505,505,505, 9,505,505,505,505,505,505, +504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, +504,504,504,504,504,504,504,504,504, 9,505,505,505,505,505,505, +505,505,505,505,505,505,505,505,505,505,505,505,505,505,505,505, +505,505,505, 9,505,505,505,505,505,505,504,505,119,119, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, /* block 227 */ -838,838,838,838,838,838,838,838,838,838,838,838,838,838,838,838, -838,838,838,838,838,838,838,838,838,838,838,838,838,838,838,838, -838,838,838,838,838,838,838,838,838,838,838,838,838,838,838,838, -838,838,838,838,838,838,838,837,837,837,837,838,838,838,838,838, -838,838,838,838,838,838,838,838,838,838,838,838,838,838,838,838, -838,838,838,838,838,838,838,838,838,838,838,838,838,838,838,838, -838,838,838,838,838,838,838,838,838,838,838,838,838,837,837,837, -837,837,837,837,837,838,837,837,837,837,837,837,837,837,837,837, +911,911,911,911,911,911,911,911,911,911,911,911,911,911,911,911, +911,911,911,911,911,911,911,911,911,911,911,911,911,911,911,911, +911,911,911,911,911,911,911,911,911,911,911,911,911,911,911,911, +911,911,911,911,911,911,911,911,911,911,911,911,911,911,911,911, +911,911,911,911,911,911,911,911,911,911,911,911,911,911,911,911, +911,911,911,911,911,911,911,911,911,911,911,911,911,911,911,911, +911,911,911,911,911,911,911,911,911,911,911,911,911,911,911,911, +911,911,911,911,911,911,911,911,911,911,911,911,911,911,911,911, /* block 228 */ -837,837,837,837,838,837,837,839,839,839,839,839,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,838,838,838,838,838, -116,838,838,838,838,838,838,838,838,838,838,838,838,838,838,838, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +912,912,912,912,912,912,912,912,912,912,912,912,912,912,912,912, +912,912,912,912,912,912,912,912,912,912,912,912,912,912,912,912, +912,912,912,912,912,912,912,912,912,912,912,912,912,912,912,912, +912,912,912,912,912,912,912,911,911,911,911,912,912,912,912,912, +912,912,912,912,912,912,912,912,912,912,912,912,912,912,912,912, +912,912,912,912,912,912,912,912,912,912,912,912,912,912,912,912, +912,912,912,912,912,912,912,912,912,912,912,912,912,911,911,911, +911,911,911,911,911,912,911,911,911,911,911,911,911,911,911,911, /* block 229 */ -840,840,840,840,840,840,840,116,840,840,840,840,840,840,840,840, -840,840,840,840,840,840,840,840,840,116,116,840,840,840,840,840, -840,840,116,840,840,116,840,840,840,840,840,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +911,911,911,911,912,911,911,913,913,913,913,913,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,912,912,912,912,912, +119,912,912,912,912,912,912,912,912,912,912,912,912,912,912,912, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 230 */ -841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841, -841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841, -841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841, -841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841, -841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841, -841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841, -841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841, -841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841, +914,914,914,914,914,914,914,119,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,119,119,914,914,914,914,914, +914,914,119,914,914,119,914,914,914,914,914,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 231 */ -841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841, -841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841, -841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841, -841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841, -841,841,841,841,841,116,116,842,842,842,842,842,842,842,842,842, -843,843,843,843,843,843,843,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +915,915,915,915,915,915,915,915,915,915,915,915,915,915,915,915, +915,915,915,915,915,915,915,915,915,915,915,915,915,915,915,915, +915,915,915,915,915,915,915,915,915,915,915,915,915,915,915,915, +915,915,915,915,915,915,915,915,915,915,915,915,915,915,915,915, +915,915,915,915,915,915,915,915,915,915,915,915,915,915,915,915, +915,915,915,915,915,915,915,915,915,915,915,915,915,915,915,915, +915,915,915,915,915,915,915,915,915,915,915,915,915,915,915,915, +915,915,915,915,915,915,915,915,915,915,915,915,915,915,915,915, /* block 232 */ -844,844,844,844,844,844,844,844,844,844,844,844,844,844,844,844, -844,844,844,844,844,844,844,844,844,844,844,844,844,844,844,844, -844,844,845,845,845,845,845,845,845,845,845,845,845,845,845,845, -845,845,845,845,845,845,845,845,845,845,845,845,845,845,845,845, -845,845,845,845,846,846,846,846,846,846,846,116,116,116,116,116, -847,847,847,847,847,847,847,847,847,847,116,116,116,116,848,848, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +915,915,915,915,915,915,915,915,915,915,915,915,915,915,915,915, +915,915,915,915,915,915,915,915,915,915,915,915,915,915,915,915, +915,915,915,915,915,915,915,915,915,915,915,915,915,915,915,915, +915,915,915,915,915,915,915,915,915,915,915,915,915,915,915,915, +915,915,915,915,915,119,119,916,916,916,916,916,916,916,916,916, +917,917,917,917,917,917,917,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 233 */ -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, +918,918,918,918,918,918,918,918,918,918,918,918,918,918,918,918, +918,918,918,918,918,918,918,918,918,918,918,918,918,918,918,918, +918,918,919,919,919,919,919,919,919,919,919,919,919,919,919,919, +919,919,919,919,919,919,919,919,919,919,919,919,919,919,919,919, +919,919,919,919,920,920,920,920,920,920,920,119,119,119,119,119, +921,921,921,921,921,921,921,921,921,921,119,119,119,119,922,922, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 234 */ - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 19, 24, 24, 24, - 5, 24, 24, 24, 24,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, /* block 235 */ -217,217,217,217,116,217,217,217,217,217,217,217,217,217,217,217, -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -116,217,217,116,217,116,116,217,116,217,217,217,217,217,217,217, -217,217,217,116,217,217,217,217,116,217,116,217,116,116,116,116, -116,116,217,116,116,116,116,217,116,217,116,217,116,217,217,217, -116,217,217,116,217,116,116,217,116,217,116,217,116,217,116,217, -116,217,217,116,217,116,116,217,217,217,217,116,217,217,217,217, -217,217,217,116,217,217,217,217,116,217,217,217,217,116,217,116, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 20, 25, 25, 25, + 6, 25, 25, 25, 25,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 236 */ -217,217,217,217,217,217,217,217,217,217,116,217,217,217,217,217, -217,217,217,217,217,217,217,217,217,217,217,217,116,116,116,116, -116,217,217,217,116,217,217,217,217,217,116,217,217,217,217,217, -217,217,217,217,217,217,217,217,217,217,217,217,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -211,211,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +224,224,224,224,119,224,224,224,224,224,224,224,224,224,224,224, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +119,224,224,119,224,119,119,224,119,224,224,224,224,224,224,224, +224,224,224,119,224,224,224,224,119,224,119,224,119,119,119,119, +119,119,224,119,119,119,119,224,119,224,119,224,119,224,224,224, +119,224,224,119,224,119,119,224,119,224,119,224,119,224,119,224, +119,224,224,119,224,119,119,224,224,224,224,119,224,224,224,224, +224,224,224,119,224,224,224,224,119,224,224,224,224,119,224,119, /* block 237 */ - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,849,849,849,849, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, +224,224,224,224,224,224,224,224,224,224,119,224,224,224,224,224, +224,224,224,224,224,224,224,224,224,224,224,224,119,119,119,119, +119,224,224,224,119,224,224,224,224,224,119,224,224,224,224,224, +224,224,224,224,224,224,224,224,224,224,224,224,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +217,217,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 238 */ - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20,849,849,849,849,849,849,849,849,849,849,849,849, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,849, -849, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, -849, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, -849, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20,849,849,849,849,849,849,849,849,849,849, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,923,923,923,923, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, /* block 239 */ - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,849,849,849, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,849,849,849,849, - 20, 20, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21,923,923,923,923,923,923,923,923,923,923,923,923, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,923, +923, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, +923, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, +923, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21,923,923,923,923,923,923,923,923,923,923, /* block 240 */ - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 19, - 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,849,849,849, -849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, -849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, -849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, -849,849,849,849,849,849,850,850,850,850,850,850,850,850,850,850, -850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,923,923,923, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,923,923,923,923, + 21, 21, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, /* block 241 */ -851, 20, 20,849,849,849,849,849,849,849,849,849,849,849,849,849, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, - 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 19,849,849,849,849, - 19, 19, 19, 19, 19, 19, 19, 19, 19,849,849,849,849,849,849,849, - 20, 20,849,849,849,849,849,849,849,849,849,849,849,849,849,849, - 20, 20, 20, 20, 20, 20,849,849,849,849,849,849,849,849,849,849, -849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 20, + 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,923,923,923, +923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923, +923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923, +923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923, +923,923,923,923,923,923,924,924,924,924,924,924,924,924,924,924, +924,924,924,924,924,924,924,924,924,924,924,924,924,924,924,924, /* block 242 */ -849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, -849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, -849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, -849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, -849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, -849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, -849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, -849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, +925, 21, 21,923,923,923,923,923,923,923,923,923,923,923,923,923, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, + 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 20,923,923,923,923, + 20, 20, 20, 20, 20, 20, 20, 20, 20,923,923,923,923,923,923,923, +575,575,923,923,923,923,923,923,923,923,923,923,923,923,923,923, + 21, 21, 21, 21, 21, 21,923,923,923,923,923,923,923,923,923,923, +923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923, /* block 243 */ - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, +923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923, +923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923, +923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923, +923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923, +923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923, +923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923, +923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923, +923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923, /* block 244 */ + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + +/* block 245 */ + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,926,926,926,926,926, + +/* block 246 */ + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 20, 20, + 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + +/* block 247 */ + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,852,852,852,852,852, -/* block 245 */ +/* block 248 */ + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21,923,923,923,923,923,923,923,923,923,923,923, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,923,923,923, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,923,923,923,923,923,923, + +/* block 249 */ + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 19, 19, - 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20,923,923,923,923,923,923,923,923,923,923,923,923, -/* block 246 */ +/* block 250 */ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 20, 20, 20, 20, 20, 21, 21, 21, 21,923,923,923,923,923,923,923, +923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923, +923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923, -/* block 247 */ +/* block 251 */ + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,923,923,923,923, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20,923,923,923,923,923,923,923,923, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,923,923,923,923,923,923, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20,849,849,849,849,849,849,849,849,849,849,849, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,849,849,849, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,849,849,849,849,849,849, - -/* block 248 */ - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19,849,849,849,849,849,849,849,849,849,849,849,849, - -/* block 249 */ - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 20, 20, 20, 20,849,849,849,849,849,849,849, -849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, -849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, - -/* block 250 */ - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,849,849,849,849, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19,849,849,849,849,849,849,849,849, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,849,849,849,849,849,849, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - -/* block 251 */ - 19, 19, 19, 19, 19, 19, 19, 19,849,849,849,849,849,849,849,849, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,849,849, -849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, -849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, -849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, -849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, -849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, /* block 252 */ - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,849,849,849,849, + 20, 20, 20, 20, 20, 20, 20, 20,923,923,923,923,923,923,923,923, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 19, 20, 20, 20,849, - 20, 20, 20, 20, 20, 20, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20,849,849, 20, 20, 20, 20,849,849,849, 20,849, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,923,923, +923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923, +923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923, +923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923, +923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923, +923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923, /* block 253 */ - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20,849,849,849,849,849,849,849,849,849,849,849,849,849, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,849,849,849,849,849,849, - 20, 20, 20,849,849,849,849,849,849,849,849,849,849,849,849,849, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,923,923,923,923, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 20, 21, 21, 21,923, + 21, 21, 21, 21, 21, 21, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21,923,923, 21, 21, 21, 21,923,923,923, 21,923, 21, 21, 21, 21, /* block 254 */ -849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, -849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, -849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, -849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, -849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, -849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,849,849, -849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21,923,923,923,923,923,923,923,923,923,923,923,923,923, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,923,923,923,923,923,923, + 21, 21, 21,923,923,923,923,923,923,923,923,923,923,923,923,923, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, /* block 255 */ -849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, -849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, -849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, -849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, -849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, -849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, -849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, -849,849,849,849,849,849,849,849,849,849,849,849,849,849,116,116, +923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923, +923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923, +923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923, +923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923, +923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923, +923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,923,923, +923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923, /* block 256 */ -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923, +923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923, +923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923, +923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923, +923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923, +923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923, +923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923, +923,923,923,923,923,923,923,923,923,923,923,923,923,923,119,119, /* block 257 */ -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,116,116,116,116,116,116,116,116,116,116,116, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 258 */ -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,116,116, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,119,119,119,119,119,119,119,119,119,119,119, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, /* block 259 */ -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,119,119, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, /* block 260 */ -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, /* block 261 */ -523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, -523,523,523,523,523,523,523,523,523,523,523,523,523,523,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 262 */ -471, 23,471,471,471,471,471,471,471,471,471,471,471,471,471,471, -471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471, -853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853, -853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853, -853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853, -853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853, -853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853, -853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, +119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119, /* block 263 */ -471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471, -471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471, -471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471, -471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471, -471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471, -471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471, -471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471, -471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471, +502, 24,502,502,502,502,502,502,502,502,502,502,502,502,502,502, +502,502,502,502,502,502,502,502,502,502,502,502,502,502,502,502, +927,927,927,927,927,927,927,927,927,927,927,927,927,927,927,927, +927,927,927,927,927,927,927,927,927,927,927,927,927,927,927,927, +927,927,927,927,927,927,927,927,927,927,927,927,927,927,927,927, +927,927,927,927,927,927,927,927,927,927,927,927,927,927,927,927, +927,927,927,927,927,927,927,927,927,927,927,927,927,927,927,927, +927,927,927,927,927,927,927,927,927,927,927,927,927,927,927,927, /* block 264 */ -111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, -111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, -111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, -111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, -111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, -111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, -111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, -111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, +502,502,502,502,502,502,502,502,502,502,502,502,502,502,502,502, +502,502,502,502,502,502,502,502,502,502,502,502,502,502,502,502, +502,502,502,502,502,502,502,502,502,502,502,502,502,502,502,502, +502,502,502,502,502,502,502,502,502,502,502,502,502,502,502,502, +502,502,502,502,502,502,502,502,502,502,502,502,502,502,502,502, +502,502,502,502,502,502,502,502,502,502,502,502,502,502,502,502, +502,502,502,502,502,502,502,502,502,502,502,502,502,502,502,502, +502,502,502,502,502,502,502,502,502,502,502,502,502,502,502,502, /* block 265 */ -111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, -111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, -111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, -111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, -111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, -111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, -111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, -471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471, +112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112, +112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112, +112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112, +112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112, +112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112, +112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112, +112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112, +112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112, /* block 266 */ -597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597, -597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597, -597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597, -597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597, -597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597, -597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597, -597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597, -597,597,597,597,597,597,597,597,597,597,597,597,597,597,116,116, +112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112, +112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112, +112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112, +112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112, +112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112, +112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112, +112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112, +502,502,502,502,502,502,502,502,502,502,502,502,502,502,502,502, + +/* block 267 */ +659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659, +659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659, +659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659, +659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659, +659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659, +659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659, +659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659, +659,659,659,659,659,659,659,659,659,659,659,659,659,659,119,119, }; diff --git a/thirdparty/pcre2/src/pcre2_ucp.h b/thirdparty/pcre2/src/pcre2_ucp.h index 0c330edcb2..483abd18fc 100644 --- a/thirdparty/pcre2/src/pcre2_ucp.h +++ b/thirdparty/pcre2/src/pcre2_ucp.h @@ -124,6 +124,7 @@ enum { /* These are the script identifications. */ enum { + ucp_Unknown, ucp_Arabic, ucp_Armenian, ucp_Bengali, diff --git a/thirdparty/pcre2/src/pcre2_xclass.c b/thirdparty/pcre2/src/pcre2_xclass.c index 407d3f5b87..8b052be66a 100644 --- a/thirdparty/pcre2/src/pcre2_xclass.c +++ b/thirdparty/pcre2/src/pcre2_xclass.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016 University of Cambridge + New API code Copyright (c) 2016-2019 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -85,10 +85,10 @@ if (c < 256) if ((*data & XCL_HASPROP) == 0) { if ((*data & XCL_MAP) == 0) return negated; - return (((uint8_t *)(data + 1))[c/8] & (1 << (c&7))) != 0; + return (((uint8_t *)(data + 1))[c/8] & (1u << (c&7))) != 0; } if ((*data & XCL_MAP) != 0 && - (((uint8_t *)(data + 1))[c/8] & (1 << (c&7))) != 0) + (((uint8_t *)(data + 1))[c/8] & (1u << (c&7))) != 0) return !negated; /* char found */ } diff --git a/thirdparty/pcre2/src/sljit/sljitConfigInternal.h b/thirdparty/pcre2/src/sljit/sljitConfigInternal.h index f5703e8e7f..ba60311e45 100644 --- a/thirdparty/pcre2/src/sljit/sljitConfigInternal.h +++ b/thirdparty/pcre2/src/sljit/sljitConfigInternal.h @@ -530,7 +530,7 @@ typedef double sljit_f64; #endif /* !SLJIT_FUNC */ #ifndef SLJIT_INDIRECT_CALL -#if ((defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64) && (defined SLJIT_BIG_ENDIAN && SLJIT_BIG_ENDIAN)) \ +#if ((defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64) && (!defined _CALL_ELF || _CALL_ELF == 1)) \ || ((defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32) && defined _AIX) /* It seems certain ppc compilers use an indirect addressing for functions which makes things complicated. */ diff --git a/thirdparty/pcre2/src/sljit/sljitExecAllocator.c b/thirdparty/pcre2/src/sljit/sljitExecAllocator.c index 7c18578618..3b37a9751f 100644 --- a/thirdparty/pcre2/src/sljit/sljitExecAllocator.c +++ b/thirdparty/pcre2/src/sljit/sljitExecAllocator.c @@ -94,6 +94,46 @@ static SLJIT_INLINE void free_chunk(void *chunk, sljit_uw size) #else +#ifdef __APPLE__ +/* Configures TARGET_OS_OSX when appropriate */ +#include <TargetConditionals.h> + +#if TARGET_OS_OSX && defined(MAP_JIT) +#include <sys/utsname.h> +#endif /* TARGET_OS_OSX && MAP_JIT */ + +#ifdef MAP_JIT + +static SLJIT_INLINE int get_map_jit_flag() +{ +#if TARGET_OS_OSX + /* On macOS systems, returns MAP_JIT if it is defined _and_ we're running on a version + of macOS where it's OK to have more than one JIT block. On non-macOS systems, returns + MAP_JIT if it is defined. */ + static int map_jit_flag = -1; + + /* The following code is thread safe because multiple initialization + sets map_jit_flag to the same value and the code has no side-effects. + Changing the kernel version witout system restart is (very) unlikely. */ + if (map_jit_flag == -1) { + struct utsname name; + + uname(&name); + + /* Kernel version for 10.14.0 (Mojave) */ + map_jit_flag = (atoi(name.release) >= 18) ? MAP_JIT : 0; + } + + return map_jit_flag; +#else /* !TARGET_OS_OSX */ + return MAP_JIT; +#endif /* TARGET_OS_OSX */ +} + +#endif /* MAP_JIT */ + +#endif /* __APPLE__ */ + static SLJIT_INLINE void* alloc_chunk(sljit_uw size) { void *retval; @@ -103,17 +143,17 @@ static SLJIT_INLINE void* alloc_chunk(sljit_uw size) int flags = MAP_PRIVATE | MAP_ANON; #ifdef MAP_JIT - flags |= MAP_JIT; + flags |= get_map_jit_flag(); #endif retval = mmap(NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC, flags, -1, 0); -#else +#else /* !MAP_ANON */ if (dev_zero < 0) { if (open_dev_zero()) return NULL; } retval = mmap(NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE, dev_zero, 0); -#endif +#endif /* MAP_ANON */ return (retval != MAP_FAILED) ? retval : NULL; } diff --git a/thirdparty/pcre2/src/sljit/sljitLir.c b/thirdparty/pcre2/src/sljit/sljitLir.c index 5bdddc10cf..ded9541b31 100644 --- a/thirdparty/pcre2/src/sljit/sljitLir.c +++ b/thirdparty/pcre2/src/sljit/sljitLir.c @@ -201,15 +201,16 @@ # define IS_CALL 0x010 # define IS_BIT26_COND 0x020 # define IS_BIT16_COND 0x040 +# define IS_BIT23_COND 0x080 -# define IS_COND (IS_BIT26_COND | IS_BIT16_COND) +# define IS_COND (IS_BIT26_COND | IS_BIT16_COND | IS_BIT23_COND) -# define PATCH_B 0x080 -# define PATCH_J 0x100 +# define PATCH_B 0x100 +# define PATCH_J 0x200 #if (defined SLJIT_CONFIG_MIPS_64 && SLJIT_CONFIG_MIPS_64) -# define PATCH_ABS32 0x200 -# define PATCH_ABS48 0x400 +# define PATCH_ABS32 0x400 +# define PATCH_ABS48 0x800 #endif /* instruction types */ diff --git a/thirdparty/pcre2/src/sljit/sljitNativeARM_64.c b/thirdparty/pcre2/src/sljit/sljitNativeARM_64.c index 27af741487..b015695c52 100644 --- a/thirdparty/pcre2/src/sljit/sljitNativeARM_64.c +++ b/thirdparty/pcre2/src/sljit/sljitNativeARM_64.c @@ -51,7 +51,7 @@ static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3] = { 0, 0, 1, 2, 3, 4, 5, 6, 7 }; -#define W_OP (1 << 31) +#define W_OP (1u << 31) #define RD(rd) (reg_map[rd]) #define RT(rt) (reg_map[rt]) #define RN(rn) (reg_map[rn] << 5) @@ -560,7 +560,7 @@ static sljit_s32 emit_op_imm(struct sljit_compiler *compiler, sljit_s32 flags, s /* dst must be register, TMP_REG1 arg1 must be register, TMP_REG1, imm arg2 must be register, TMP_REG2, imm */ - sljit_ins inv_bits = (flags & INT_OP) ? (1 << 31) : 0; + sljit_ins inv_bits = (flags & INT_OP) ? W_OP : 0; sljit_ins inst_bits; sljit_s32 op = (flags & 0xffff); sljit_s32 reg; @@ -710,7 +710,7 @@ static sljit_s32 emit_op_imm(struct sljit_compiler *compiler, sljit_s32 flags, s return push_inst(compiler, ORR | RD(dst) | RN(TMP_ZERO) | RM(arg2)); case SLJIT_MOV_U8: SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG1); - return push_inst(compiler, (UBFM ^ (1 << 31)) | RD(dst) | RN(arg2) | (7 << 10)); + return push_inst(compiler, (UBFM ^ W_OP) | RD(dst) | RN(arg2) | (7 << 10)); case SLJIT_MOV_S8: SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG1); if (!(flags & INT_OP)) @@ -718,7 +718,7 @@ static sljit_s32 emit_op_imm(struct sljit_compiler *compiler, sljit_s32 flags, s return push_inst(compiler, (SBFM ^ inv_bits) | RD(dst) | RN(arg2) | (7 << 10)); case SLJIT_MOV_U16: SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG1); - return push_inst(compiler, (UBFM ^ (1 << 31)) | RD(dst) | RN(arg2) | (15 << 10)); + return push_inst(compiler, (UBFM ^ W_OP) | RD(dst) | RN(arg2) | (15 << 10)); case SLJIT_MOV_S16: SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG1); if (!(flags & INT_OP)) @@ -728,7 +728,7 @@ static sljit_s32 emit_op_imm(struct sljit_compiler *compiler, sljit_s32 flags, s SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG1); if ((flags & INT_OP) && dst == arg2) return SLJIT_SUCCESS; - return push_inst(compiler, (ORR ^ (1 << 31)) | RD(dst) | RN(TMP_ZERO) | RM(arg2)); + return push_inst(compiler, (ORR ^ W_OP) | RD(dst) | RN(TMP_ZERO) | RM(arg2)); case SLJIT_MOV_S32: SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG1); if ((flags & INT_OP) && dst == arg2) @@ -1080,7 +1080,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_return(struct sljit_compiler *comp SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compiler, sljit_s32 op) { - sljit_ins inv_bits = (op & SLJIT_I32_OP) ? (1 << 31) : 0; + sljit_ins inv_bits = (op & SLJIT_I32_OP) ? W_OP : 0; CHECK_ERROR(); CHECK(check_sljit_emit_op0(compiler, op)); @@ -1360,7 +1360,7 @@ static SLJIT_INLINE sljit_s32 sljit_emit_fop1_conv_sw_from_f64(struct sljit_comp sljit_ins inv_bits = (op & SLJIT_F32_OP) ? (1 << 22) : 0; if (GET_OPCODE(op) == SLJIT_CONV_S32_FROM_F64) - inv_bits |= (1 << 31); + inv_bits |= W_OP; if (src & SLJIT_MEM) { emit_fop_mem(compiler, (op & SLJIT_F32_OP) ? INT_SIZE : WORD_SIZE, TMP_FREG1, src, srcw); @@ -1382,7 +1382,7 @@ static SLJIT_INLINE sljit_s32 sljit_emit_fop1_conv_f64_from_sw(struct sljit_comp sljit_ins inv_bits = (op & SLJIT_F32_OP) ? (1 << 22) : 0; if (GET_OPCODE(op) == SLJIT_CONV_F64_FROM_S32) - inv_bits |= (1 << 31); + inv_bits |= W_OP; if (src & SLJIT_MEM) { emit_op_mem(compiler, ((GET_OPCODE(op) == SLJIT_CONV_F64_FROM_S32) ? INT_SIZE : WORD_SIZE), TMP_REG1, src, srcw, TMP_REG1); @@ -1662,7 +1662,7 @@ static SLJIT_INLINE struct sljit_jump* emit_cmp_to0(struct sljit_compiler *compi sljit_s32 src, sljit_sw srcw) { struct sljit_jump *jump; - sljit_ins inv_bits = (type & SLJIT_I32_OP) ? (1 << 31) : 0; + sljit_ins inv_bits = (type & SLJIT_I32_OP) ? W_OP : 0; SLJIT_ASSERT((type & 0xff) == SLJIT_EQUAL || (type & 0xff) == SLJIT_NOT_EQUAL); ADJUST_LOCAL_OFFSET(src, srcw); @@ -1787,7 +1787,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_cmov(struct sljit_compiler *compil sljit_s32 dst_reg, sljit_s32 src, sljit_sw srcw) { - sljit_ins inv_bits = (dst_reg & SLJIT_I32_OP) ? (1 << 31) : 0; + sljit_ins inv_bits = (dst_reg & SLJIT_I32_OP) ? W_OP : 0; sljit_ins cc; CHECK_ERROR(); diff --git a/thirdparty/pcre2/src/sljit/sljitNativeMIPS_32.c b/thirdparty/pcre2/src/sljit/sljitNativeMIPS_32.c index 094c9923bc..ad970bf25a 100644 --- a/thirdparty/pcre2/src/sljit/sljitNativeMIPS_32.c +++ b/thirdparty/pcre2/src/sljit/sljitNativeMIPS_32.c @@ -368,16 +368,21 @@ static SLJIT_INLINE sljit_s32 emit_single_op(struct sljit_compiler *compiler, sl SLJIT_ASSERT(!(flags & SRC2_IMM)); if (GET_FLAG_TYPE(op) != SLJIT_MUL_OVERFLOW) { -#if (defined SLJIT_MIPS_R1 && SLJIT_MIPS_R1) +#if (defined SLJIT_MIPS_R1 && SLJIT_MIPS_R1) || (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6) return push_inst(compiler, MUL | S(src1) | T(src2) | D(dst), DR(dst)); -#else +#else /* !SLJIT_MIPS_R1 && !SLJIT_MIPS_R6 */ FAIL_IF(push_inst(compiler, MULT | S(src1) | T(src2), MOVABLE_INS)); return push_inst(compiler, MFLO | D(dst), DR(dst)); -#endif +#endif /* SLJIT_MIPS_R1 || SLJIT_MIPS_R6 */ } +#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6) + FAIL_IF(push_inst(compiler, MUL | S(src1) | T(src2) | D(dst), DR(dst))); + FAIL_IF(push_inst(compiler, MUH | S(src1) | T(src2) | DA(EQUAL_FLAG), EQUAL_FLAG)); +#else /* !SLJIT_MIPS_R6 */ FAIL_IF(push_inst(compiler, MULT | S(src1) | T(src2), MOVABLE_INS)); FAIL_IF(push_inst(compiler, MFHI | DA(EQUAL_FLAG), EQUAL_FLAG)); FAIL_IF(push_inst(compiler, MFLO | D(dst), DR(dst))); +#endif /* SLJIT_MIPS_R6 */ FAIL_IF(push_inst(compiler, SRA | T(dst) | DA(OTHER_FLAG) | SH_IMM(31), OTHER_FLAG)); return push_inst(compiler, SUBU | SA(EQUAL_FLAG) | TA(OTHER_FLAG) | DA(OTHER_FLAG), OTHER_FLAG); diff --git a/thirdparty/pcre2/src/sljit/sljitNativeMIPS_64.c b/thirdparty/pcre2/src/sljit/sljitNativeMIPS_64.c index f841aef5dd..a6a2bcc0c9 100644 --- a/thirdparty/pcre2/src/sljit/sljitNativeMIPS_64.c +++ b/thirdparty/pcre2/src/sljit/sljitNativeMIPS_64.c @@ -459,19 +459,26 @@ static SLJIT_INLINE sljit_s32 emit_single_op(struct sljit_compiler *compiler, sl SLJIT_ASSERT(!(flags & SRC2_IMM)); if (GET_FLAG_TYPE(op) != SLJIT_MUL_OVERFLOW) { -#if (defined SLJIT_MIPS_R1 && SLJIT_MIPS_R1) +#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6) + return push_inst(compiler, SELECT_OP(DMUL, MUL) | S(src1) | T(src2) | D(dst), DR(dst)); +#elif (defined SLJIT_MIPS_R1 && SLJIT_MIPS_R1) if (op & SLJIT_I32_OP) return push_inst(compiler, MUL | S(src1) | T(src2) | D(dst), DR(dst)); FAIL_IF(push_inst(compiler, DMULT | S(src1) | T(src2), MOVABLE_INS)); return push_inst(compiler, MFLO | D(dst), DR(dst)); -#else +#else /* !SLJIT_MIPS_R6 && !SLJIT_MIPS_R1 */ FAIL_IF(push_inst(compiler, SELECT_OP(DMULT, MULT) | S(src1) | T(src2), MOVABLE_INS)); return push_inst(compiler, MFLO | D(dst), DR(dst)); -#endif +#endif /* SLJIT_MIPS_R6 */ } +#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6) + FAIL_IF(push_inst(compiler, SELECT_OP(DMUL, MUL) | S(src1) | T(src2) | D(dst), DR(dst))); + FAIL_IF(push_inst(compiler, SELECT_OP(DMUH, MUH) | S(src1) | T(src2) | DA(EQUAL_FLAG), EQUAL_FLAG)); +#else /* !SLJIT_MIPS_R6 */ FAIL_IF(push_inst(compiler, SELECT_OP(DMULT, MULT) | S(src1) | T(src2), MOVABLE_INS)); FAIL_IF(push_inst(compiler, MFHI | DA(EQUAL_FLAG), EQUAL_FLAG)); FAIL_IF(push_inst(compiler, MFLO | D(dst), DR(dst))); +#endif /* SLJIT_MIPS_R6 */ FAIL_IF(push_inst(compiler, SELECT_OP(DSRA32, SRA) | T(dst) | DA(OTHER_FLAG) | SH_IMM(31), OTHER_FLAG)); return push_inst(compiler, SELECT_OP(DSUBU, SUBU) | SA(EQUAL_FLAG) | TA(OTHER_FLAG) | DA(OTHER_FLAG), OTHER_FLAG); diff --git a/thirdparty/pcre2/src/sljit/sljitNativeMIPS_common.c b/thirdparty/pcre2/src/sljit/sljitNativeMIPS_common.c index 894e21304b..e0d6a3f085 100644 --- a/thirdparty/pcre2/src/sljit/sljitNativeMIPS_common.c +++ b/thirdparty/pcre2/src/sljit/sljitNativeMIPS_common.c @@ -27,17 +27,31 @@ /* Latest MIPS architecture. */ /* Automatically detect SLJIT_MIPS_R1 */ +#if (defined __mips_isa_rev) && (__mips_isa_rev >= 6) +#define SLJIT_MIPS_R6 1 +#endif + SLJIT_API_FUNC_ATTRIBUTE const char* sljit_get_platform_name(void) { -#if (defined SLJIT_MIPS_R1 && SLJIT_MIPS_R1) +#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6) + +#if (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32) + return "MIPS32-R6" SLJIT_CPUINFO; +#else /* !SLJIT_CONFIG_MIPS_32 */ + return "MIPS64-R6" SLJIT_CPUINFO; +#endif /* SLJIT_CONFIG_MIPS_32 */ + +#elif (defined SLJIT_MIPS_R1 && SLJIT_MIPS_R1) + #if (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32) return "MIPS32-R1" SLJIT_CPUINFO; -#else +#else /* !SLJIT_CONFIG_MIPS_32 */ return "MIPS64-R1" SLJIT_CPUINFO; -#endif +#endif /* SLJIT_CONFIG_MIPS_32 */ + #else /* SLJIT_MIPS_R1 */ return "MIPS III" SLJIT_CPUINFO; -#endif +#endif /* SLJIT_MIPS_R6 */ } /* Length of an instruction word @@ -62,6 +76,7 @@ typedef sljit_u32 sljit_ins; #define TMP_FREG1 (SLJIT_NUMBER_OF_FLOAT_REGISTERS + 1) #define TMP_FREG2 (SLJIT_NUMBER_OF_FLOAT_REGISTERS + 2) +#define TMP_FREG3 (SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3) static const sljit_u8 reg_map[SLJIT_NUMBER_OF_REGISTERS + 5] = { 0, 2, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 24, 23, 22, 21, 20, 19, 18, 17, 16, 29, 4, 25, 31 @@ -69,14 +84,14 @@ static const sljit_u8 reg_map[SLJIT_NUMBER_OF_REGISTERS + 5] = { #if (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32) -static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3] = { - 0, 0, 14, 2, 4, 6, 8, 12, 10 +static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 4] = { + 0, 0, 14, 2, 4, 6, 8, 12, 10, 16 }; #else -static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3] = { - 0, 0, 13, 14, 15, 16, 17, 12, 18 +static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 4] = { + 0, 0, 13, 14, 15, 16, 17, 12, 18, 10 }; #endif @@ -102,6 +117,11 @@ static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3] = { #define FR(dr) (freg_map[dr]) #define HI(opcode) ((opcode) << 26) #define LO(opcode) (opcode) +#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6) +/* CMP.cond.fmt */ +/* S = (20 << 21) D = (21 << 21) */ +#define CMP_FMT_S (20 << 21) +#endif /* SLJIT_MIPS_R6 */ /* S = (16 << 21) D = (17 << 21) */ #define FMT_S (16 << 21) #define FMT_D (17 << 21) @@ -114,8 +134,13 @@ static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3] = { #define ANDI (HI(12)) #define B (HI(4)) #define BAL (HI(1) | (17 << 16)) +#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6) +#define BC1EQZ (HI(17) | (9 << 21) | FT(TMP_FREG3)) +#define BC1NEZ (HI(17) | (13 << 21) | FT(TMP_FREG3)) +#else /* !SLJIT_MIPS_R6 */ #define BC1F (HI(17) | (8 << 21)) #define BC1T (HI(17) | (8 << 21) | (1 << 16)) +#endif /* SLJIT_MIPS_R6 */ #define BEQ (HI(4)) #define BGEZ (HI(1) | (1 << 16)) #define BGTZ (HI(7)) @@ -124,20 +149,42 @@ static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3] = { #define BNE (HI(5)) #define BREAK (HI(0) | LO(13)) #define CFC1 (HI(17) | (2 << 21)) -#define C_UN_S (HI(17) | FMT_S | LO(49)) +#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6) +#define C_UEQ_S (HI(17) | CMP_FMT_S | LO(3)) +#define C_ULE_S (HI(17) | CMP_FMT_S | LO(7)) +#define C_ULT_S (HI(17) | CMP_FMT_S | LO(5)) +#define C_UN_S (HI(17) | CMP_FMT_S | LO(1)) +#define C_FD (FD(TMP_FREG3)) +#else /* !SLJIT_MIPS_R6 */ #define C_UEQ_S (HI(17) | FMT_S | LO(51)) #define C_ULE_S (HI(17) | FMT_S | LO(55)) #define C_ULT_S (HI(17) | FMT_S | LO(53)) +#define C_UN_S (HI(17) | FMT_S | LO(49)) +#define C_FD (0) +#endif /* SLJIT_MIPS_R6 */ #define CVT_S_S (HI(17) | FMT_S | LO(32)) #define DADDIU (HI(25)) #define DADDU (HI(0) | LO(45)) +#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6) +#define DDIV (HI(0) | (2 << 6) | LO(30)) +#define DDIVU (HI(0) | (2 << 6) | LO(31)) +#define DMOD (HI(0) | (3 << 6) | LO(30)) +#define DMODU (HI(0) | (3 << 6) | LO(31)) +#define DIV (HI(0) | (2 << 6) | LO(26)) +#define DIVU (HI(0) | (2 << 6) | LO(27)) +#define DMUH (HI(0) | (3 << 6) | LO(28)) +#define DMUHU (HI(0) | (3 << 6) | LO(29)) +#define DMUL (HI(0) | (2 << 6) | LO(28)) +#define DMULU (HI(0) | (2 << 6) | LO(29)) +#else /* !SLJIT_MIPS_R6 */ #define DDIV (HI(0) | LO(30)) #define DDIVU (HI(0) | LO(31)) #define DIV (HI(0) | LO(26)) #define DIVU (HI(0) | LO(27)) -#define DIV_S (HI(17) | FMT_S | LO(3)) #define DMULT (HI(0) | LO(28)) #define DMULTU (HI(0) | LO(29)) +#endif /* SLJIT_MIPS_R6 */ +#define DIV_S (HI(17) | FMT_S | LO(3)) #define DSLL (HI(0) | LO(56)) #define DSLL32 (HI(0) | LO(60)) #define DSLLV (HI(0) | LO(20)) @@ -151,18 +198,34 @@ static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3] = { #define J (HI(2)) #define JAL (HI(3)) #define JALR (HI(0) | LO(9)) +#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6) +#define JR (HI(0) | LO(9)) +#else /* !SLJIT_MIPS_R6 */ #define JR (HI(0) | LO(8)) +#endif /* SLJIT_MIPS_R6 */ #define LD (HI(55)) #define LUI (HI(15)) #define LW (HI(35)) #define MFC1 (HI(17)) +#if !(defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6) #define MFHI (HI(0) | LO(16)) #define MFLO (HI(0) | LO(18)) +#else /* SLJIT_MIPS_R6 */ +#define MOD (HI(0) | (3 << 6) | LO(26)) +#define MODU (HI(0) | (3 << 6) | LO(27)) +#endif /* !SLJIT_MIPS_R6 */ #define MOV_S (HI(17) | FMT_S | LO(6)) #define MTC1 (HI(17) | (4 << 21)) -#define MUL_S (HI(17) | FMT_S | LO(2)) +#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6) +#define MUH (HI(0) | (3 << 6) | LO(24)) +#define MUHU (HI(0) | (3 << 6) | LO(25)) +#define MUL (HI(0) | (2 << 6) | LO(24)) +#define MULU (HI(0) | (2 << 6) | LO(25)) +#else /* !SLJIT_MIPS_R6 */ #define MULT (HI(0) | LO(24)) #define MULTU (HI(0) | LO(25)) +#endif /* SLJIT_MIPS_R6 */ +#define MUL_S (HI(17) | FMT_S | LO(2)) #define NEG_S (HI(17) | FMT_S | LO(7)) #define NOP (HI(0) | LO(0)) #define NOR (HI(0) | LO(39)) @@ -188,14 +251,18 @@ static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3] = { #define XOR (HI(0) | LO(38)) #define XORI (HI(14)) -#if (defined SLJIT_MIPS_R1 && SLJIT_MIPS_R1) +#if (defined SLJIT_MIPS_R1 && SLJIT_MIPS_R1) || (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6) #define CLZ (HI(28) | LO(32)) +#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6) +#define DCLZ (LO(18)) +#else /* !SLJIT_MIPS_R6 */ #define DCLZ (HI(28) | LO(36)) #define MOVF (HI(0) | (0 << 16) | LO(1)) #define MOVN (HI(0) | LO(11)) #define MOVT (HI(0) | (1 << 16) | LO(1)) #define MOVZ (HI(0) | LO(10)) #define MUL (HI(28) | LO(2)) +#endif /* SLJIT_MIPS_R6 */ #define PREF (HI(51)) #define PREFX (HI(19) | LO(15)) #define SEB (HI(31) | (16 << 6) | LO(32)) @@ -234,7 +301,13 @@ static sljit_s32 push_inst(struct sljit_compiler *compiler, sljit_ins ins, sljit static SLJIT_INLINE sljit_ins invert_branch(sljit_s32 flags) { - return (flags & IS_BIT26_COND) ? (1 << 26) : (1 << 16); + if (flags & IS_BIT26_COND) + return (1 << 26); +#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6) + if (flags & IS_BIT23_COND) + return (1 << 23); +#endif /* SLJIT_MIPS_R6 */ + return (1 << 16); } static SLJIT_INLINE sljit_ins* detect_jump_type(struct sljit_jump *jump, sljit_ins *code_ptr, sljit_ins *code, sljit_sw executable_offset) @@ -1075,34 +1148,62 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compile return push_inst(compiler, NOP, UNMOVABLE_INS); case SLJIT_LMUL_UW: case SLJIT_LMUL_SW: +#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6) +#if (defined SLJIT_CONFIG_MIPS_64 && SLJIT_CONFIG_MIPS_64) + FAIL_IF(push_inst(compiler, (op == SLJIT_LMUL_UW ? DMULU : DMUL) | S(SLJIT_R0) | T(SLJIT_R1) | D(TMP_REG3), DR(TMP_REG3))); + FAIL_IF(push_inst(compiler, (op == SLJIT_LMUL_UW ? DMUHU : DMUH) | S(SLJIT_R0) | T(SLJIT_R1) | D(TMP_REG1), DR(TMP_REG1))); +#else /* !SLJIT_CONFIG_MIPS_64 */ + FAIL_IF(push_inst(compiler, (op == SLJIT_LMUL_UW ? MULU : MUL) | S(SLJIT_R0) | T(SLJIT_R1) | D(TMP_REG3), DR(TMP_REG3))); + FAIL_IF(push_inst(compiler, (op == SLJIT_LMUL_UW ? MUHU : MUH) | S(SLJIT_R0) | T(SLJIT_R1) | D(TMP_REG1), DR(TMP_REG1))); +#endif /* SLJIT_CONFIG_MIPS_64 */ + FAIL_IF(push_inst(compiler, ADDU_W | S(TMP_REG3) | TA(0) | D(SLJIT_R0), DR(SLJIT_R0))); + return push_inst(compiler, ADDU_W | S(TMP_REG1) | TA(0) | D(SLJIT_R1), DR(SLJIT_R1)); +#else /* !SLJIT_MIPS_R6 */ #if (defined SLJIT_CONFIG_MIPS_64 && SLJIT_CONFIG_MIPS_64) FAIL_IF(push_inst(compiler, (op == SLJIT_LMUL_UW ? DMULTU : DMULT) | S(SLJIT_R0) | T(SLJIT_R1), MOVABLE_INS)); -#else +#else /* !SLJIT_CONFIG_MIPS_64 */ FAIL_IF(push_inst(compiler, (op == SLJIT_LMUL_UW ? MULTU : MULT) | S(SLJIT_R0) | T(SLJIT_R1), MOVABLE_INS)); -#endif +#endif /* SLJIT_CONFIG_MIPS_64 */ FAIL_IF(push_inst(compiler, MFLO | D(SLJIT_R0), DR(SLJIT_R0))); return push_inst(compiler, MFHI | D(SLJIT_R1), DR(SLJIT_R1)); +#endif /* SLJIT_MIPS_R6 */ case SLJIT_DIVMOD_UW: case SLJIT_DIVMOD_SW: case SLJIT_DIV_UW: case SLJIT_DIV_SW: SLJIT_COMPILE_ASSERT((SLJIT_DIVMOD_UW & 0x2) == 0 && SLJIT_DIV_UW - 0x2 == SLJIT_DIVMOD_UW, bad_div_opcode_assignments); +#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6) +#if (defined SLJIT_CONFIG_MIPS_64 && SLJIT_CONFIG_MIPS_64) + if (int_op) { + FAIL_IF(push_inst(compiler, ((op | 0x2) == SLJIT_DIV_UW ? DIVU : DIV) | S(SLJIT_R0) | T(SLJIT_R1) | D(TMP_REG3), DR(TMP_REG3))); + FAIL_IF(push_inst(compiler, ((op | 0x2) == SLJIT_DIV_UW ? MODU : MOD) | S(SLJIT_R0) | T(SLJIT_R1) | D(TMP_REG1), DR(TMP_REG1))); + } + else { + FAIL_IF(push_inst(compiler, ((op | 0x2) == SLJIT_DIV_UW ? DDIVU : DDIV) | S(SLJIT_R0) | T(SLJIT_R1) | D(TMP_REG3), DR(TMP_REG3))); + FAIL_IF(push_inst(compiler, ((op | 0x2) == SLJIT_DIV_UW ? DMODU : DMOD) | S(SLJIT_R0) | T(SLJIT_R1) | D(TMP_REG1), DR(TMP_REG1))); + } +#else /* !SLJIT_CONFIG_MIPS_64 */ + FAIL_IF(push_inst(compiler, ((op | 0x2) == SLJIT_DIV_UW ? DIVU : DIV) | S(SLJIT_R0) | T(SLJIT_R1) | D(TMP_REG3), DR(TMP_REG3))); + FAIL_IF(push_inst(compiler, ((op | 0x2) == SLJIT_DIV_UW ? MODU : MOD) | S(SLJIT_R0) | T(SLJIT_R1) | D(TMP_REG1), DR(TMP_REG1))); +#endif /* SLJIT_CONFIG_MIPS_64 */ + FAIL_IF(push_inst(compiler, ADDU_W | S(TMP_REG3) | TA(0) | D(SLJIT_R0), DR(SLJIT_R0))); + return (op >= SLJIT_DIV_UW) ? SLJIT_SUCCESS : push_inst(compiler, ADDU_W | S(TMP_REG1) | TA(0) | D(SLJIT_R1), DR(SLJIT_R1)); +#else /* !SLJIT_MIPS_R6 */ #if !(defined SLJIT_MIPS_R1 && SLJIT_MIPS_R1) FAIL_IF(push_inst(compiler, NOP, UNMOVABLE_INS)); FAIL_IF(push_inst(compiler, NOP, UNMOVABLE_INS)); -#endif - +#endif /* !SLJIT_MIPS_R1 */ #if (defined SLJIT_CONFIG_MIPS_64 && SLJIT_CONFIG_MIPS_64) if (int_op) FAIL_IF(push_inst(compiler, ((op | 0x2) == SLJIT_DIV_UW ? DIVU : DIV) | S(SLJIT_R0) | T(SLJIT_R1), MOVABLE_INS)); else FAIL_IF(push_inst(compiler, ((op | 0x2) == SLJIT_DIV_UW ? DDIVU : DDIV) | S(SLJIT_R0) | T(SLJIT_R1), MOVABLE_INS)); -#else +#else /* !SLJIT_CONFIG_MIPS_64 */ FAIL_IF(push_inst(compiler, ((op | 0x2) == SLJIT_DIV_UW ? DIVU : DIV) | S(SLJIT_R0) | T(SLJIT_R1), MOVABLE_INS)); -#endif - +#endif /* SLJIT_CONFIG_MIPS_64 */ FAIL_IF(push_inst(compiler, MFLO | D(SLJIT_R0), DR(SLJIT_R0))); return (op >= SLJIT_DIV_UW) ? SLJIT_SUCCESS : push_inst(compiler, MFHI | D(SLJIT_R1), DR(SLJIT_R1)); +#endif /* SLJIT_MIPS_R6 */ } return SLJIT_SUCCESS; @@ -1408,8 +1509,7 @@ static SLJIT_INLINE sljit_s32 sljit_emit_fop1_cmp(struct sljit_compiler *compile inst = C_UN_S; break; } - - return push_inst(compiler, inst | FMT(op) | FT(src2) | FS(src1), UNMOVABLE_INS); + return push_inst(compiler, inst | FMT(op) | FT(src2) | FS(src1) | C_FD, UNMOVABLE_INS); } SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fop1(struct sljit_compiler *compiler, sljit_s32 op, @@ -1608,16 +1708,30 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_label* sljit_emit_label(struct sljit_compi flags = IS_BIT26_COND; \ delay_check = src; +#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6) + +#define BR_T() \ + inst = BC1NEZ; \ + flags = IS_BIT23_COND; \ + delay_check = FCSR_FCC; +#define BR_F() \ + inst = BC1EQZ; \ + flags = IS_BIT23_COND; \ + delay_check = FCSR_FCC; + +#else /* !SLJIT_MIPS_R6 */ + #define BR_T() \ inst = BC1T | JUMP_LENGTH; \ flags = IS_BIT16_COND; \ delay_check = FCSR_FCC; - #define BR_F() \ inst = BC1F | JUMP_LENGTH; \ flags = IS_BIT16_COND; \ delay_check = FCSR_FCC; +#endif /* SLJIT_MIPS_R6 */ + SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_jump(struct sljit_compiler *compiler, sljit_s32 type) { struct sljit_jump *jump; @@ -1927,7 +2041,11 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_flags(struct sljit_compiler *co case SLJIT_GREATER_EQUAL_F64: case SLJIT_UNORDERED_F64: case SLJIT_ORDERED_F64: +#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6) + FAIL_IF(push_inst(compiler, MFC1 | TA(dst_ar) | FS(TMP_FREG3), dst_ar)); +#else /* !SLJIT_MIPS_R6 */ FAIL_IF(push_inst(compiler, CFC1 | TA(dst_ar) | DA(FCSR_REG), dst_ar)); +#endif /* SLJIT_MIPS_R6 */ FAIL_IF(push_inst(compiler, SRL | TA(dst_ar) | DA(dst_ar) | SH_IMM(23), dst_ar)); FAIL_IF(push_inst(compiler, ANDI | SA(dst_ar) | TA(dst_ar) | IMM(1), dst_ar)); src_ar = dst_ar; diff --git a/thirdparty/pcre2/src/sljit/sljitNativePPC_common.c b/thirdparty/pcre2/src/sljit/sljitNativePPC_common.c index 5ef4ac96c4..b34e3965ed 100644 --- a/thirdparty/pcre2/src/sljit/sljitNativePPC_common.c +++ b/thirdparty/pcre2/src/sljit/sljitNativePPC_common.c @@ -42,7 +42,7 @@ typedef sljit_u32 sljit_ins; #include <sys/cache.h> #endif -#if (defined SLJIT_LITTLE_ENDIAN && SLJIT_LITTLE_ENDIAN) +#if (defined _CALL_ELF && _CALL_ELF == 2) #define SLJIT_PASS_ENTRY_ADDR_TO_CALL 1 #endif diff --git a/thirdparty/tinyexr/tinyexr.h b/thirdparty/tinyexr/tinyexr.h index 3c19391850..f22163738f 100644 --- a/thirdparty/tinyexr/tinyexr.h +++ b/thirdparty/tinyexr/tinyexr.h @@ -1,5 +1,5 @@ /* -Copyright (c) 2014 - 2018, Syoyo Fujita and many contributors. +Copyright (c) 2014 - 2019, Syoyo Fujita and many contributors. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -276,7 +276,8 @@ extern int LoadEXR(float **out_rgba, int *width, int *height, // @deprecated { to be removed. } // Simple wrapper API for ParseEXRHeaderFromFile. // checking given file is a EXR file(by just look up header) -// @return TINYEXR_SUCCEES for EXR image, TINYEXR_ERROR_INVALID_HEADER for others +// @return TINYEXR_SUCCEES for EXR image, TINYEXR_ERROR_INVALID_HEADER for +// others extern int IsEXR(const char *filename); // @deprecated { to be removed. } @@ -469,9 +470,10 @@ extern int LoadEXRFromMemory(float **out_rgba, int *width, int *height, #include <cstdio> #include <cstdlib> #include <cstring> -#include <iostream> #include <sstream> +//#include <iostream> // debug + #include <limits> #include <string> #include <vector> @@ -2537,10 +2539,10 @@ tinfl_status tinfl_decompress(tinfl_decompressor *r, tinfl_status status = TINFL_STATUS_FAILED; mz_uint32 num_bits, dist, counter, num_extra; tinfl_bit_buf_t bit_buf; - const mz_uint8 *pIn_buf_cur = pIn_buf_next, - *const pIn_buf_end = pIn_buf_next + *pIn_buf_size; - mz_uint8 *pOut_buf_cur = pOut_buf_next, - *const pOut_buf_end = pOut_buf_next + *pOut_buf_size; + const mz_uint8 *pIn_buf_cur = pIn_buf_next, *const pIn_buf_end = + pIn_buf_next + *pIn_buf_size; + mz_uint8 *pOut_buf_cur = pOut_buf_next, *const pOut_buf_end = + pOut_buf_next + *pOut_buf_size; size_t out_buf_size_mask = (decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF) ? (size_t)-1 @@ -2957,8 +2959,9 @@ void *tinfl_decompress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len, tinfl_status status = tinfl_decompress( &decomp, (const mz_uint8 *)pSrc_buf + src_buf_ofs, &src_buf_size, (mz_uint8 *)pBuf, pBuf ? (mz_uint8 *)pBuf + *pOut_len : NULL, - &dst_buf_size, (flags & ~TINFL_FLAG_HAS_MORE_INPUT) | - TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF); + &dst_buf_size, + (flags & ~TINFL_FLAG_HAS_MORE_INPUT) | + TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF); if ((status < 0) || (status == TINFL_STATUS_NEEDS_MORE_INPUT)) { MZ_FREE(pBuf); *pOut_len = 0; @@ -3011,9 +3014,8 @@ int tinfl_decompress_mem_to_callback(const void *pIn_buf, size_t *pIn_buf_size, tinfl_status status = tinfl_decompress(&decomp, (const mz_uint8 *)pIn_buf + in_buf_ofs, &in_buf_size, pDict, pDict + dict_ofs, &dst_buf_size, - (flags & - ~(TINFL_FLAG_HAS_MORE_INPUT | - TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF))); + (flags & ~(TINFL_FLAG_HAS_MORE_INPUT | + TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF))); in_buf_ofs += in_buf_size; if ((dst_buf_size) && (!(*pPut_buf_func)(pDict + dict_ofs, (int)dst_buf_size, pPut_buf_user))) @@ -3138,7 +3140,9 @@ static const mz_uint8 s_tdefl_large_dist_extra[128] = { // Radix sorts tdefl_sym_freq[] array by 16-bit key m_key. Returns ptr to sorted // values. -typedef struct { mz_uint16 m_key, m_sym_index; } tdefl_sym_freq; +typedef struct { + mz_uint16 m_key, m_sym_index; +} tdefl_sym_freq; static tdefl_sym_freq *tdefl_radix_sort_syms(mz_uint num_syms, tdefl_sym_freq *pSyms0, tdefl_sym_freq *pSyms1) { @@ -5282,9 +5286,10 @@ mz_bool mz_zip_reader_file_stat(mz_zip_archive *pZip, mz_uint file_index, n = MZ_READ_LE16(p + MZ_ZIP_CDH_COMMENT_LEN_OFS); n = MZ_MIN(n, MZ_ZIP_MAX_ARCHIVE_FILE_COMMENT_SIZE - 1); pStat->m_comment_size = n; - memcpy(pStat->m_comment, p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + - MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS) + - MZ_READ_LE16(p + MZ_ZIP_CDH_EXTRA_LEN_OFS), + memcpy(pStat->m_comment, + p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + + MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS) + + MZ_READ_LE16(p + MZ_ZIP_CDH_EXTRA_LEN_OFS), n); pStat->m_comment[n] = '\0'; @@ -7008,6 +7013,11 @@ static void swap2(unsigned short *val) { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunused-function" #endif + +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-function" +#endif static void cpy4(int *dst_val, const int *src_val) { unsigned char *dst = reinterpret_cast<unsigned char *>(dst_val); const unsigned char *src = reinterpret_cast<const unsigned char *>(src_val); @@ -7037,11 +7047,14 @@ static void cpy4(float *dst_val, const float *src_val) { dst[2] = src[2]; dst[3] = src[3]; } - #ifdef __clang__ #pragma clang diagnostic pop #endif +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif + static void swap4(unsigned int *val) { #ifdef MINIZ_LITTLE_ENDIAN (void)val; @@ -7696,7 +7709,8 @@ static int rleUncompress(int inLength, int maxLength, const signed char in[], int count = -(static_cast<int>(*in++)); inLength -= count + 1; - if (0 > (maxLength -= count)) return 0; + // Fixes #116: Add bounds check to in buffer. + if ((0 > (maxLength -= count)) || (inLength < 0)) return 0; memcpy(out, in, count); out += count; @@ -7790,13 +7804,19 @@ static void CompressRle(unsigned char *dst, } } -static void DecompressRle(unsigned char *dst, +static bool DecompressRle(unsigned char *dst, const unsigned long uncompressed_size, const unsigned char *src, unsigned long src_size) { if (uncompressed_size == src_size) { // Data is not compressed(Issue 40). memcpy(dst, src, src_size); - return; + return true; + } + + // Workaround for issue #112. + // TODO(syoyo): Add more robust out-of-bounds check in `rleUncompress`. + if (src_size <= 2) { + return false; } std::vector<unsigned char> tmpBuf(uncompressed_size); @@ -7805,8 +7825,9 @@ static void DecompressRle(unsigned char *dst, static_cast<int>(uncompressed_size), reinterpret_cast<const signed char *>(src), reinterpret_cast<char *>(&tmpBuf.at(0))); - assert(ret == static_cast<int>(uncompressed_size)); - (void)ret; + if (ret != static_cast<int>(uncompressed_size)) { + return false; + } // // Apply EXR-specific? postprocess. Grabbed from OpenEXR's @@ -7845,6 +7866,8 @@ static void DecompressRle(unsigned char *dst, break; } } + + return true; } #if TINYEXR_USE_PIZ @@ -8556,7 +8579,7 @@ static bool hufUnpackEncTable( int lc = 0; for (; im <= iM; im++) { - if (p - *pcode > ni) { + if (p - *pcode >= ni) { return false; } @@ -8854,7 +8877,7 @@ static bool getCode(int po, int rlc, long long &c, int &lc, const char *&in, if (out + cs > oe) return false; // Bounds check for safety - // Issue 100. + // Issue 100. if ((out - 1) < ob) return false; unsigned short s = out[-1]; @@ -9348,6 +9371,10 @@ static bool DecompressPiz(unsigned char *outPtr, const unsigned char *inPtr, tinyexr::cpy4(&length, reinterpret_cast<const int *>(ptr)); ptr += sizeof(int); + if (size_t((ptr - inPtr) + length) > inLen) { + return false; + } + std::vector<unsigned short> tmpBuffer(tmpBufSize); hufUncompress(reinterpret_cast<const char *>(ptr), length, &tmpBuffer); @@ -9642,8 +9669,9 @@ static bool DecodePixelData(/* out */ unsigned char **out_images, reinterpret_cast<unsigned char *>(&outBuf.at(0)), data_ptr, tmpBufLen, data_len, static_cast<int>(num_channels), channels, width, num_lines); - assert(ret); - (void)ret; + if (!ret) { + return false; + } // For PIZ_COMPRESSION: // pixel sample data for channel 0 for scanline 0 @@ -9688,16 +9716,18 @@ static bool DecodePixelData(/* out */ unsigned char **out_images, } else { // HALF -> FLOAT FP32 f32 = half_to_float(hf); float *image = reinterpret_cast<float **>(out_images)[c]; + size_t offset = 0; if (line_order == 0) { - image += (static_cast<size_t>(line_no) + v) * + offset = (static_cast<size_t>(line_no) + v) * static_cast<size_t>(x_stride) + u; } else { - image += static_cast<size_t>( + offset = static_cast<size_t>( (height - 1 - (line_no + static_cast<int>(v)))) * static_cast<size_t>(x_stride) + u; } + image += offset; *image = f32.f; } } @@ -9824,16 +9854,19 @@ static bool DecodePixelData(/* out */ unsigned char **out_images, } else { // HALF -> FLOAT tinyexr::FP32 f32 = half_to_float(hf); float *image = reinterpret_cast<float **>(out_images)[c]; + size_t offset = 0; if (line_order == 0) { - image += (static_cast<size_t>(line_no) + v) * + offset = (static_cast<size_t>(line_no) + v) * static_cast<size_t>(x_stride) + u; } else { - image += (static_cast<size_t>(height) - 1U - + offset = (static_cast<size_t>(height) - 1U - (static_cast<size_t>(line_no) + v)) * static_cast<size_t>(x_stride) + u; } + image += offset; + *image = f32.f; } } @@ -9906,10 +9939,15 @@ static bool DecodePixelData(/* out */ unsigned char **out_images, pixel_data_size); unsigned long dstLen = static_cast<unsigned long>(outBuf.size()); - assert(dstLen > 0); - tinyexr::DecompressRle(reinterpret_cast<unsigned char *>(&outBuf.at(0)), + if (dstLen == 0) { + return false; + } + + if (!tinyexr::DecompressRle(reinterpret_cast<unsigned char *>(&outBuf.at(0)), dstLen, data_ptr, - static_cast<unsigned long>(data_len)); + static_cast<unsigned long>(data_len))) { + return false; + } // For RLE_COMPRESSION: // pixel sample data for channel 0 for scanline 0 @@ -10739,12 +10777,28 @@ static int DecodeChunk(EXRImage *exr_image, const EXRHeader *exr_header, if ((data_width < 0) || (data_height < 0)) { if (err) { std::stringstream ss; - ss << "Invalid data width or data height: " << data_width << ", " << data_height << std::endl; + ss << "Invalid data width or data height: " << data_width << ", " + << data_height << std::endl; (*err) += ss.str(); } return TINYEXR_ERROR_INVALID_DATA; } + // Do not allow too large data_width and data_height. header invalid? + { + const int threshold = 1024 * 8192; // heuristics + if ((data_width > threshold) || (data_height > threshold)) { + if (err) { + std::stringstream ss; + ss << "data_with or data_height too large. data_width: " << data_width + << ", " + << "data_height = " << data_height << std::endl; + (*err) += ss.str(); + } + return TINYEXR_ERROR_INVALID_DATA; + } + } + size_t num_blocks = offsets.size(); std::vector<size_t> channel_offset_list; @@ -10762,6 +10816,25 @@ static int DecodeChunk(EXRImage *exr_image, const EXRHeader *exr_header, bool invalid_data = false; // TODO(LTE): Use atomic lock for MT safety. if (exr_header->tiled) { + // value check + if (exr_header->tile_size_x < 0) { + if (err) { + std::stringstream ss; + ss << "Invalid tile size x : " << exr_header->tile_size_x << "\n"; + (*err) += ss.str(); + } + return TINYEXR_ERROR_INVALID_HEADER; + } + + if (exr_header->tile_size_y < 0) { + if (err) { + std::stringstream ss; + ss << "Invalid tile size y : " << exr_header->tile_size_y << "\n"; + (*err) += ss.str(); + } + return TINYEXR_ERROR_INVALID_HEADER; + } + size_t num_tiles = offsets.size(); // = # of blocks exr_image->tiles = static_cast<EXRTile *>( @@ -10840,12 +10913,17 @@ static int DecodeChunk(EXRImage *exr_image, const EXRHeader *exr_header, } } else { // scanline format - // Don't allow too large image(256GB * pixel_data_size or more). Workaround for #104. - size_t data_len = size_t(data_width) * size_t(data_height) * size_t(num_channels); - if ((data_len == 0) || (data_len >= 0x4000000000)) { + // Don't allow too large image(256GB * pixel_data_size or more). Workaround + // for #104. + size_t total_data_len = + size_t(data_width) * size_t(data_height) * size_t(num_channels); + const bool total_data_len_overflown = sizeof(void*) == 8 ? (total_data_len >= 0x4000000000) : false; + if ((total_data_len == 0) || total_data_len_overflown ) { if (err) { std::stringstream ss; - ss << "Image data size is zero or too large: width = " << data_width << ", height = " << data_height << ", channels = " << num_channels << std::endl; + ss << "Image data size is zero or too large: width = " << data_width + << ", height = " << data_height << ", channels = " << num_channels + << std::endl; (*err) += ss.str(); } return TINYEXR_ERROR_INVALID_DATA; @@ -10880,12 +10958,21 @@ static int DecodeChunk(EXRImage *exr_image, const EXRHeader *exr_header, if (size_t(data_len) > data_size) { invalid_data = true; + + } else if ((line_no > (2 << 20)) || (line_no < -(2 << 20))) { + // Too large value. Assume this is invalid + // 2**20 = 1048576 = heuristic value. + invalid_data = true; + } else if (data_len == 0) { + // TODO(syoyo): May be ok to raise the threshold for example `data_len + // < 4` + invalid_data = true; } else { + // line_no may be negative. int end_line_no = (std::min)(line_no + num_scanline_blocks, (exr_header->data_window[3] + 1)); int num_lines = end_line_no - line_no; - // assert(num_lines > 0); if (num_lines <= 0) { invalid_data = true; @@ -10894,7 +10981,16 @@ static int DecodeChunk(EXRImage *exr_image, const EXRHeader *exr_header, data_ptr += 8; // Adjust line_no with data_window.bmin.y - line_no -= exr_header->data_window[1]; + + // overflow check + tinyexr_int64 lno = static_cast<tinyexr_int64>(line_no) - static_cast<tinyexr_int64>(exr_header->data_window[1]); + if (lno > std::numeric_limits<int>::max()) { + line_no = -1; // invalid + } else if (lno < -std::numeric_limits<int>::max()) { + line_no = -1; // invalid + } else { + line_no -= exr_header->data_window[1]; + } if (line_no < 0) { invalid_data = true; @@ -10919,6 +11015,10 @@ static int DecodeChunk(EXRImage *exr_image, const EXRHeader *exr_header, } if (invalid_data) { + if (err) { + std::stringstream ss; + (*err) += "Invalid data found when decoding pixels.\n"; + } return TINYEXR_ERROR_INVALID_DATA; } @@ -10995,7 +11095,7 @@ static int DecodeEXRImage(EXRImage *exr_image, const EXRHeader *exr_header, int data_width = exr_header->data_window[2] - exr_header->data_window[0]; if (data_width >= std::numeric_limits<int>::max()) { // Issue 63 - tinyexr::SetErrorMessage("Invalid data window value", err); + tinyexr::SetErrorMessage("Invalid data width value", err); return TINYEXR_ERROR_INVALID_DATA; } data_width++; @@ -11008,10 +11108,23 @@ static int DecodeEXRImage(EXRImage *exr_image, const EXRHeader *exr_header, data_height++; if ((data_width < 0) || (data_height < 0)) { - tinyexr::SetErrorMessage("data window or data height is negative.", err); + tinyexr::SetErrorMessage("data width or data height is negative.", err); return TINYEXR_ERROR_INVALID_DATA; } + // Do not allow too large data_width and data_height. header invalid? + { + const int threshold = 1024 * 8192; // heuristics + if (data_width > threshold) { + tinyexr::SetErrorMessage("data width too large.", err); + return TINYEXR_ERROR_INVALID_DATA; + } + if (data_height > threshold) { + tinyexr::SetErrorMessage("data height too large.", err); + return TINYEXR_ERROR_INVALID_DATA; + } + } + // Read offset tables. size_t num_blocks = 0; @@ -11190,7 +11303,6 @@ int LoadEXR(float **out_rgba, int *width, int *height, const char *filename, static_cast<size_t>(exr_image.height))); if (exr_header.tiled) { - for (int it = 0; it < exr_image.num_tiles; it++) { for (int j = 0; j < exr_header.tile_size_y; j++) { for (int i = 0; i < exr_header.tile_size_x; i++) { @@ -11325,7 +11437,7 @@ int IsEXR(const char *filename) { if (ret != TINYEXR_SUCCESS) { return TINYEXR_ERROR_INVALID_HEADER; } - + return TINYEXR_SUCCESS; } @@ -11434,7 +11546,6 @@ int LoadEXRFromMemory(float **out_rgba, int *width, int *height, static_cast<size_t>(exr_image.height))); if (exr_header.tiled) { - for (int it = 0; it < exr_image.num_tiles; it++) { for (int j = 0; j < exr_header.tile_size_y; j++) { for (int i = 0; i < exr_header.tile_size_x; i++) { @@ -12115,7 +12226,7 @@ size_t SaveEXRImageToMemory(const EXRImage *exr_image, sizeof(tinyexr::tinyexr_uint64) * static_cast<size_t>(num_blocks)); } - if ( memory.size() == 0 ) { + if (memory.size() == 0) { tinyexr::SetErrorMessage("Output memory size is zero", err); return 0; } @@ -12286,6 +12397,9 @@ int LoadDeepEXR(DeepImage *deep_image, const char *filename, const char **err) { size_t marker_size; if (!tinyexr::ReadAttribute(&attr_name, &attr_type, &data, &marker_size, marker, size)) { + std::stringstream ss; + ss << "Failed to parse attribute\n"; + tinyexr::SetErrorMessage(ss.str(), err); return TINYEXR_ERROR_INVALID_DATA; } marker += marker_size; |